summaryrefslogtreecommitdiffstats
path: root/libs/gui
diff options
context:
space:
mode:
authorJamie Gennis <jgennis@google.com>2011-11-17 17:10:47 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-11-17 17:10:47 -0800
commite984dd11c1c48bde7ce1054692db9a065f4df5f0 (patch)
tree5541ff6c50c77ceaec3600826032470fc9cf0584 /libs/gui
parent0f83b2f976b5974546182b1b8483c9956aee8496 (diff)
parentaaa3ecff4b49e0918c252e02b3aa18a3ad0d503d (diff)
downloadframeworks_native-e984dd11c1c48bde7ce1054692db9a065f4df5f0.zip
frameworks_native-e984dd11c1c48bde7ce1054692db9a065f4df5f0.tar.gz
frameworks_native-e984dd11c1c48bde7ce1054692db9a065f4df5f0.tar.bz2
Merge "SurfaceTexture: fix a bug with buffer reallocation" into ics-mr1
Diffstat (limited to 'libs/gui')
-rw-r--r--libs/gui/SurfaceTexture.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/libs/gui/SurfaceTexture.cpp b/libs/gui/SurfaceTexture.cpp
index 3c0d475..0561909 100644
--- a/libs/gui/SurfaceTexture.cpp
+++ b/libs/gui/SurfaceTexture.cpp
@@ -437,6 +437,11 @@ status_t SurfaceTexture::dequeueBuffer(int *outBuf, uint32_t w, uint32_t h,
mSlots[buf].mEglImage = EGL_NO_IMAGE_KHR;
mSlots[buf].mEglDisplay = EGL_NO_DISPLAY;
}
+ if (mCurrentTexture == buf) {
+ // The current texture no longer references the buffer in this slot
+ // since we just allocated a new buffer.
+ mCurrentTexture = INVALID_BUFFER_SLOT;
+ }
returnFlags |= ISurfaceTexture::BUFFER_NEEDS_REALLOCATION;
}
ST_LOGV("dequeueBuffer: returning slot=%d buf=%p flags=%#x", buf,