diff options
author | 2011-07-13 15:24:42 -0700 | |
---|---|---|
committer | 2011-07-19 13:05:11 -0700 | |
commit | 09d7ed7b395d66be97c6bcb052039f5c0dce646c (patch) | |
tree | f707f6e46bd9a0edeaac9b33bffe054a64e3062c /libs/gui/ISurfaceTexture.cpp | |
parent | 9d29d155c51a26d789cce2c4c24c659487c63554 (diff) |
Add set_scaling_mode() to ANativeWindow.
This allows to specify the scaling mode independently from
the buffer size.
Change-Id: Iaa2baa660445531a97d3fac192e580f4929c5d3b
Diffstat (limited to 'libs/gui/ISurfaceTexture.cpp')
-rw-r--r-- | libs/gui/ISurfaceTexture.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
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<IBinder> 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<IBinder> result = getAllocator(); |