From 3f3f5af40e409fe5d2f2af2c4906dbb28a982f43 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Queru Date: Sat, 18 Jun 2011 09:42:04 -0700 Subject: [PATCH] Tweaks for forward-compatibility Change-Id: Iec525edc186e78d5d865f82dd5b1f56263c22e86 --- include/gui/SurfaceTexture.h | 1 + include/ui/GraphicBuffer.h | 2 ++ include/ui/android_native_buffer.h | 1 + libs/ui/GraphicBuffer.cpp | 13 +++++++++++++ 4 files changed, 17 insertions(+) diff --git a/include/gui/SurfaceTexture.h b/include/gui/SurfaceTexture.h index 255afdd3c..f5f9ea714 100644 --- a/include/gui/SurfaceTexture.h +++ b/include/gui/SurfaceTexture.h @@ -28,6 +28,7 @@ struct SurfaceTexture { void incStrong(android::sp* const) {} void getTransformMatrix(float mtx[16]) {} void setFrameAvailableListener(const sp&) {} + void setSynchronousMode(bool) {} }; static sp SurfaceTexture_getSurfaceTexture(JNIEnv* env, jobject thiz) diff --git a/include/ui/GraphicBuffer.h b/include/ui/GraphicBuffer.h index 0be26a79a..1da9729d4 100644 --- a/include/ui/GraphicBuffer.h +++ b/include/ui/GraphicBuffer.h @@ -74,6 +74,8 @@ public: GraphicBuffer(); + GraphicBuffer(android_native_buffer_t*, bool); + // creates w * h buffer GraphicBuffer(uint32_t w, uint32_t h, PixelFormat format, uint32_t usage); diff --git a/include/ui/android_native_buffer.h b/include/ui/android_native_buffer.h index a472824bc..85a1638aa 100644 --- a/include/ui/android_native_buffer.h +++ b/include/ui/android_native_buffer.h @@ -63,6 +63,7 @@ typedef struct android_native_buffer_t void* reserved_proc[8]; } android_native_buffer_t; +#define ANativeWindowBuffer android_native_buffer_t /*****************************************************************************/ diff --git a/libs/ui/GraphicBuffer.cpp b/libs/ui/GraphicBuffer.cpp index 367195439..d9efeab4b 100644 --- a/libs/ui/GraphicBuffer.cpp +++ b/libs/ui/GraphicBuffer.cpp @@ -49,6 +49,19 @@ GraphicBuffer::GraphicBuffer() handle = NULL; } +GraphicBuffer::GraphicBuffer(android_native_buffer_t*, bool) + : BASE(), mOwner(ownData), mBufferMapper(GraphicBufferMapper::get()), + mInitCheck(NO_ERROR), mIndex(-1) +{ + width = + height = + stride = + format = + usage = 0; + transform = 0; + handle = NULL; +} + GraphicBuffer::GraphicBuffer(uint32_t w, uint32_t h, PixelFormat reqFormat, uint32_t reqUsage) : BASE(), mOwner(ownData), mBufferMapper(GraphicBufferMapper::get()),