summaryrefslogtreecommitdiffstats
path: root/libs/gui/SurfaceTexture.cpp
diff options
context:
space:
mode:
authorJamie Gennis <jgennis@google.com>2011-11-18 02:37:41 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2011-11-18 02:37:41 -0800
commit892a9d674db33586719f98df5c9a0a44769ebd54 (patch)
tree566190171598bae8ef9cc76ccc6d3051d1e13c3b /libs/gui/SurfaceTexture.cpp
parent99f0528b5eed9de4b9c59e806df32a58954c65a9 (diff)
parent9da22d2cc31069d86a92021d8540bb5a77c9591b (diff)
downloadframeworks_base-892a9d674db33586719f98df5c9a0a44769ebd54.zip
frameworks_base-892a9d674db33586719f98df5c9a0a44769ebd54.tar.gz
frameworks_base-892a9d674db33586719f98df5c9a0a44769ebd54.tar.bz2
am 9da22d2c: am 2ba13186: Merge "SurfaceTexture: fix a bug with buffer reallocation" into ics-mr1
* commit '9da22d2cc31069d86a92021d8540bb5a77c9591b': SurfaceTexture: fix a bug with buffer reallocation
Diffstat (limited to 'libs/gui/SurfaceTexture.cpp')
-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 9332aac..175de69 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,