summaryrefslogtreecommitdiffstats
path: root/libs/ui
diff options
context:
space:
mode:
authorRamkumar Radhakrishnan <ramkumar@codeaurora.org>2012-11-06 20:44:04 -0800
committerGerrit Code Review <gerrit@cyanogenmod.org>2013-03-10 22:55:58 -0700
commitbbef29560e318cbdb0d4107b7fce6a2a64fd641b (patch)
treefa25faa6fdf12cc6de6dd74b24ca9405088cc891 /libs/ui
parent31152b94cd0471a3853fb658e9aff507d4eec384 (diff)
downloadframeworks_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/ui')
-rw-r--r--libs/ui/GraphicBuffer.cpp10
-rw-r--r--libs/ui/GraphicBufferMapper.cpp13
2 files changed, 23 insertions, 0 deletions
diff --git a/libs/ui/GraphicBuffer.cpp b/libs/ui/GraphicBuffer.cpp
index b447d00..219375e 100644
--- a/libs/ui/GraphicBuffer.cpp
+++ b/libs/ui/GraphicBuffer.cpp
@@ -213,6 +213,16 @@ status_t GraphicBuffer::unlock()
return res;
}
+#ifdef QCOM_BSP
+status_t GraphicBuffer::perform(buffer_handle_t hnd, int operation,
+ uint32_t w, uint32_t h, PixelFormat format)
+{
+ status_t res = getBufferMapper().perform(hnd,
+ GRALLOC_MODULE_PERFORM_UPDATE_BUFFER_GEOMETRY, w, h, format);
+ return res;
+}
+#endif
+
size_t GraphicBuffer::getFlattenedSize() const {
return (8 + (handle ? handle->numInts : 0))*sizeof(int);
}
diff --git a/libs/ui/GraphicBufferMapper.cpp b/libs/ui/GraphicBufferMapper.cpp
index 19c549d..d16a1bb 100644
--- a/libs/ui/GraphicBufferMapper.cpp
+++ b/libs/ui/GraphicBufferMapper.cpp
@@ -108,5 +108,18 @@ status_t GraphicBufferMapper::getphys(buffer_handle_t handle, void** paddr)
}
#endif
+#ifdef QCOM_BSP
+status_t GraphicBufferMapper::perform(buffer_handle_t handle, int operation,
+ uint32_t w, uint32_t h, uint32_t format)
+{
+ ATRACE_CALL();
+ status_t err;
+
+ err = mAllocMod->perform(mAllocMod, operation, w, h, format, handle);
+
+ ALOGW_IF(err, "perform(...) failed %d (%s)", err, strerror(-err));
+ return err;
+}
+#endif
// ---------------------------------------------------------------------------
}; // namespace android