Merge "Compare GraphicBuffers using handles." into honeycomb

This commit is contained in:
Jamie Gennis 2011-01-15 17:01:51 -08:00 committed by Android (Google) Code Review
commit 361dcc75b1

View File

@ -111,7 +111,7 @@ int SurfaceTextureClient::cancelBuffer(android_native_buffer_t* buffer) {
LOGV("SurfaceTextureClient::cancelBuffer"); LOGV("SurfaceTextureClient::cancelBuffer");
Mutex::Autolock lock(mMutex); Mutex::Autolock lock(mMutex);
for (int i = 0; i < NUM_BUFFER_SLOTS; i++) { for (int i = 0; i < NUM_BUFFER_SLOTS; i++) {
if (mSlots[i].get() == buffer) { if (mSlots[i]->handle == buffer->handle) {
mSurfaceTexture->cancelBuffer(i); mSurfaceTexture->cancelBuffer(i);
return OK; return OK;
} }
@ -129,7 +129,7 @@ int SurfaceTextureClient::queueBuffer(android_native_buffer_t* buffer) {
LOGV("SurfaceTextureClient::queueBuffer"); LOGV("SurfaceTextureClient::queueBuffer");
Mutex::Autolock lock(mMutex); Mutex::Autolock lock(mMutex);
for (int i = 0; i < NUM_BUFFER_SLOTS; i++) { 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); return mSurfaceTexture->queueBuffer(i);
} }
} }