summaryrefslogtreecommitdiffstats
path: root/libs/gui/SurfaceTextureClient.cpp
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2011-04-01 14:58:43 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-04-01 14:58:43 -0700
commit756484c2bb110c7c2155e41b6f51672ecc638a23 (patch)
treea89dabf3f14bc93f1727b8c2dea76499039ab9ba /libs/gui/SurfaceTextureClient.cpp
parent9aa26ee3bc47170e0bebef8df48c6199ca147c3c (diff)
parente5a1bffd9106b1d82259de1a202e1f2f28742392 (diff)
downloadframeworks_base-756484c2bb110c7c2155e41b6f51672ecc638a23.zip
frameworks_base-756484c2bb110c7c2155e41b6f51672ecc638a23.tar.gz
frameworks_base-756484c2bb110c7c2155e41b6f51672ecc638a23.tar.bz2
Merge "SurfaceTexture can now force the client to request a buffer"
Diffstat (limited to 'libs/gui/SurfaceTextureClient.cpp')
-rw-r--r--libs/gui/SurfaceTextureClient.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/libs/gui/SurfaceTextureClient.cpp b/libs/gui/SurfaceTextureClient.cpp
index a4812d0..29fc4d3 100644
--- a/libs/gui/SurfaceTextureClient.cpp
+++ b/libs/gui/SurfaceTextureClient.cpp
@@ -25,8 +25,8 @@ namespace android {
SurfaceTextureClient::SurfaceTextureClient(
const sp<ISurfaceTexture>& surfaceTexture):
- mSurfaceTexture(surfaceTexture), mAllocator(0), mReqWidth(1),
- mReqHeight(1), mReqFormat(DEFAULT_FORMAT), mReqUsage(0),
+ mSurfaceTexture(surfaceTexture), mAllocator(0), mReqWidth(0),
+ mReqHeight(0), mReqFormat(DEFAULT_FORMAT), mReqUsage(0),
mTimestamp(NATIVE_WINDOW_TIMESTAMP_AUTO), mMutex() {
// Initialize the ANativeWindow function pointers.
ANativeWindow::setSwapInterval = setSwapInterval;
@@ -100,7 +100,8 @@ int SurfaceTextureClient::dequeueBuffer(android_native_buffer_t** buffer) {
return err;
}
sp<GraphicBuffer>& gbuf(mSlots[buf]);
- if (gbuf == 0 || gbuf->getWidth() != mReqWidth ||
+ if (err == ISurfaceTexture::BUFFER_NEEDS_REALLOCATION ||
+ gbuf == 0 || gbuf->getWidth() != mReqWidth ||
gbuf->getHeight() != mReqHeight ||
uint32_t(gbuf->getPixelFormat()) != mReqFormat ||
(gbuf->getUsage() & mReqUsage) != mReqUsage) {