OSDN Git Service

SurfaceTexture: fix a bug with buffer reallocation
authorJamie Gennis <jgennis@google.com>
Fri, 18 Nov 2011 00:00:44 +0000 (16:00 -0800)
committerJamie Gennis <jgennis@google.com>
Fri, 18 Nov 2011 00:00:44 +0000 (16:00 -0800)
commitaaa3ecff4b49e0918c252e02b3aa18a3ad0d503d
tree49e6cc5b6e605938bfc83d470e42aea3ef60635b
parent6a6ff2015d23c68875f7e64aa6fe9fda4c4ea6f4
SurfaceTexture: fix a bug with buffer reallocation

This change fixes an issue involving buffer reallocation and the
ALLOW_DEQUEUE_CURRENT_BUFFER mode in SurfaceTexture.  The bug happened
when the buffer slot currently attached to the GL texture was selected
for dequeuing, but the dequeue operation caused the buffer to be
reallocated.  Because the buffer is new, the image producer could fill
the buffer and queue it before an updateTexImage call, which would
result in the "slot %d is current" error in queueBuffer.

Bug: 5631630
Change-Id: Icdd8bc5cad3c7db43953446d9be2603aaea11a8d
libs/gui/SurfaceTexture.cpp