summaryrefslogtreecommitdiffstats
path: root/libs/gui/SurfaceTextureClient.cpp
diff options
context:
space:
mode:
authorJamie Gennis <jgennis@google.com>2011-01-15 13:05:24 -0800
committerJamie Gennis <jgennis@google.com>2011-01-15 17:00:06 -0800
commit4559ea41d849714aba4dffeeb13aa9ee648b7327 (patch)
treed20d3a4940600ae1478dd6d722aa28f5dd97cc7c /libs/gui/SurfaceTextureClient.cpp
parenta47aa87a19c733e28d9d2db1c4eb7f29d668db7b (diff)
downloadframeworks_base-4559ea41d849714aba4dffeeb13aa9ee648b7327.zip
frameworks_base-4559ea41d849714aba4dffeeb13aa9ee648b7327.tar.gz
frameworks_base-4559ea41d849714aba4dffeeb13aa9ee648b7327.tar.bz2
Compare GraphicBuffers using handles.
This change fixes a bug in SurfaceTextureClient where GraphicBuffers were being compared using pointer comparison rather than handles. Change-Id: Ib8989af94be32d4efd86e020a732f5143088a863
Diffstat (limited to 'libs/gui/SurfaceTextureClient.cpp')
-rw-r--r--libs/gui/SurfaceTextureClient.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/gui/SurfaceTextureClient.cpp b/libs/gui/SurfaceTextureClient.cpp
index 24cee24..0ed8be5 100644
--- a/libs/gui/SurfaceTextureClient.cpp
+++ b/libs/gui/SurfaceTextureClient.cpp
@@ -111,7 +111,7 @@ int SurfaceTextureClient::cancelBuffer(android_native_buffer_t* buffer) {
LOGV("SurfaceTextureClient::cancelBuffer");
Mutex::Autolock lock(mMutex);
for (int i = 0; i < NUM_BUFFER_SLOTS; i++) {
- if (mSlots[i].get() == buffer) {
+ if (mSlots[i]->handle == buffer->handle) {
mSurfaceTexture->cancelBuffer(i);
return OK;
}
@@ -129,7 +129,7 @@ int SurfaceTextureClient::queueBuffer(android_native_buffer_t* buffer) {
LOGV("SurfaceTextureClient::queueBuffer");
Mutex::Autolock lock(mMutex);
for (int i = 0; i < NUM_BUFFER_SLOTS; i++) {
- if (mSlots[i].get() == GraphicBuffer::getSelf(buffer)) {
+ if (mSlots[i]->handle == buffer->handle) {
return mSurfaceTexture->queueBuffer(i);
}
}