diff options
author | Ramkumar Radhakrishnan <ramkumar@codeaurora.org> | 2012-11-06 20:44:04 -0800 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2013-03-10 22:55:58 -0700 |
commit | bbef29560e318cbdb0d4107b7fce6a2a64fd641b (patch) | |
tree | fa25faa6fdf12cc6de6dd74b24ca9405088cc891 /libs/gui/ISurfaceTexture.cpp | |
parent | 31152b94cd0471a3853fb658e9aff507d4eec384 (diff) | |
download | frameworks_native-bbef29560e318cbdb0d4107b7fce6a2a64fd641b.zip frameworks_native-bbef29560e318cbdb0d4107b7fce6a2a64fd641b.tar.gz frameworks_native-bbef29560e318cbdb0d4107b7fce6a2a64fd641b.tar.bz2 |
libgui: Add support to update buffer geometry.
Add native window properties NATIVE_WINDOW_UPDATE_BUFFERS_GEOMETRY
to the perform function of SurfaceTextureClient and SurfaceTexture
to update the width, height and format of the buffer dynamically
from the client before queue buffer call.
Change-Id: I62447fcf523b507d534085cd0835f55a978c4ead
Diffstat (limited to 'libs/gui/ISurfaceTexture.cpp')
-rw-r--r-- | libs/gui/ISurfaceTexture.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/libs/gui/ISurfaceTexture.cpp b/libs/gui/ISurfaceTexture.cpp index 4b20a36..ce31a5b 100644 --- a/libs/gui/ISurfaceTexture.cpp +++ b/libs/gui/ISurfaceTexture.cpp @@ -39,6 +39,7 @@ enum { QUERY, SET_SYNCHRONOUS_MODE, #ifdef QCOM_BSP + UPDATE_BUFFERS_GEOMETRY, SET_BUFFERS_SIZE, #endif CONNECT, @@ -160,6 +161,21 @@ public: } #ifdef QCOM_BSP + virtual status_t updateBuffersGeometry(int w, int h, int f) { + Parcel data, reply; + data.writeInterfaceToken(ISurfaceTexture::getInterfaceDescriptor()); + data.writeInt32(w); + data.writeInt32(h); + data.writeInt32(f); + status_t result = remote()->transact(UPDATE_BUFFERS_GEOMETRY, + data, &reply); + if (result != NO_ERROR) { + return result; + } + result = reply.readInt32(); + return result; + } + virtual status_t setBuffersSize(int size) { Parcel data, reply; data.writeInterfaceToken(ISurfaceTexture::getInterfaceDescriptor()); @@ -284,6 +300,15 @@ status_t BnSurfaceTexture::onTransact( return NO_ERROR; } break; #ifdef QCOM_BSP + case UPDATE_BUFFERS_GEOMETRY: { + CHECK_INTERFACE(ISurfaceTexture, data, reply); + int w = data.readInt32(); + int h = data.readInt32(); + int f = data.readInt32(); + status_t res = updateBuffersGeometry(w, h, f); + reply->writeInt32(res); + return NO_ERROR; + } break; case SET_BUFFERS_SIZE: { CHECK_INTERFACE(ISurfaceTexture, data, reply); int size = data.readInt32(); |