summaryrefslogtreecommitdiff
path: root/libs/gui/ISurfaceComposer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/gui/ISurfaceComposer.cpp')
-rw-r--r--libs/gui/ISurfaceComposer.cpp48
1 files changed, 48 insertions, 0 deletions
diff --git a/libs/gui/ISurfaceComposer.cpp b/libs/gui/ISurfaceComposer.cpp
index e22bc708c9..d2d27e8239 100644
--- a/libs/gui/ISurfaceComposer.cpp
+++ b/libs/gui/ISurfaceComposer.cpp
@@ -332,6 +332,34 @@ public:
return result;
}
+ virtual status_t getDisplayViewport(const sp<IBinder>& display, Rect* outViewport) {
+ Parcel data, reply;
+ status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
+ if (result != NO_ERROR) {
+ ALOGE("getDisplayViewport failed to writeInterfaceToken: %d", result);
+ return result;
+ }
+ result = data.writeStrongBinder(display);
+ if (result != NO_ERROR) {
+ ALOGE("getDisplayViewport failed to writeStrongBinder: %d", result);
+ return result;
+ }
+ result = remote()->transact(BnSurfaceComposer::GET_DISPLAY_VIEWPORT, data, &reply);
+ if (result != NO_ERROR) {
+ ALOGE("getDisplayViewport failed to transact: %d", result);
+ return result;
+ }
+ result = reply.readInt32();
+ if (result == NO_ERROR) {
+ result = reply.read(*outViewport);
+ if (result != NO_ERROR) {
+ ALOGE("getDisplayViewport failed to read: %d", result);
+ return result;
+ }
+ }
+ return result;
+ }
+
virtual int getActiveConfig(const sp<IBinder>& display)
{
Parcel data, reply;
@@ -724,6 +752,26 @@ status_t BnSurfaceComposer::onTransact(
}
return NO_ERROR;
}
+ case GET_DISPLAY_VIEWPORT: {
+ CHECK_INTERFACE(ISurfaceComposer, data, reply);
+ Rect outViewport;
+ sp<IBinder> display = nullptr;
+ status_t result = data.readStrongBinder(&display);
+ if (result != NO_ERROR) {
+ ALOGE("getDisplayViewport failed to readStrongBinder: %d", result);
+ return result;
+ }
+ result = getDisplayViewport(display, &outViewport);
+ result = reply->writeInt32(result);
+ if (result == NO_ERROR) {
+ result = reply->write(outViewport);
+ if (result != NO_ERROR) {
+ ALOGE("getDisplayViewport failed to write: %d", result);
+ return result;
+ }
+ }
+ return NO_ERROR;
+ }
case GET_ACTIVE_CONFIG: {
CHECK_INTERFACE(ISurfaceComposer, data, reply);
sp<IBinder> display = data.readStrongBinder();