From 09d7ed7b395d66be97c6bcb052039f5c0dce646c Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Wed, 13 Jul 2011 15:24:42 -0700 Subject: Add set_scaling_mode() to ANativeWindow. This allows to specify the scaling mode independently from the buffer size. Change-Id: Iaa2baa660445531a97d3fac192e580f4929c5d3b --- libs/gui/ISurfaceTexture.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'libs/gui/ISurfaceTexture.cpp') diff --git a/libs/gui/ISurfaceTexture.cpp b/libs/gui/ISurfaceTexture.cpp index 41434a4ba902..b4b749280dbb 100644 --- a/libs/gui/ISurfaceTexture.cpp +++ b/libs/gui/ISurfaceTexture.cpp @@ -43,6 +43,7 @@ enum { SET_SYNCHRONOUS_MODE, CONNECT, DISCONNECT, + SET_SCALING_MODE, }; @@ -130,6 +131,15 @@ public: return result; } + virtual status_t setScalingMode(int mode) { + Parcel data, reply; + data.writeInterfaceToken(ISurfaceTexture::getInterfaceDescriptor()); + data.writeInt32(mode); + remote()->transact(SET_SCALING_MODE, data, &reply); + status_t result = reply.readInt32(); + return result; + } + virtual sp getAllocator() { Parcel data, reply; data.writeInterfaceToken(ISurfaceTexture::getInterfaceDescriptor()); @@ -244,6 +254,13 @@ status_t BnSurfaceTexture::onTransact( reply->writeInt32(result); return NO_ERROR; } break; + case SET_SCALING_MODE: { + CHECK_INTERFACE(ISurfaceTexture, data, reply); + int mode = data.readInt32(); + status_t result = setScalingMode(mode); + reply->writeInt32(result); + return NO_ERROR; + } break; case GET_ALLOCATOR: { CHECK_INTERFACE(ISurfaceTexture, data, reply); sp result = getAllocator(); -- cgit v1.2.3-59-g8ed1b