summaryrefslogtreecommitdiffstats
path: root/libs/gui/SurfaceTexture.cpp
diff options
context:
space:
mode:
authorJesse Hall <jessehall@google.com>2012-06-28 14:27:53 -0700
committerJesse Hall <jessehall@google.com>2012-06-30 21:38:51 -0700
commitb42b1ac1587aebda5e2f334d95b620271fafba4e (patch)
tree5852fb46f80587194d109b3baa04a91af443181b /libs/gui/SurfaceTexture.cpp
parentc777b0b3b9b0ea5d8e378fccde6935765e28e329 (diff)
downloadframeworks_native-b42b1ac1587aebda5e2f334d95b620271fafba4e.zip
frameworks_native-b42b1ac1587aebda5e2f334d95b620271fafba4e.tar.gz
frameworks_native-b42b1ac1587aebda5e2f334d95b620271fafba4e.tar.bz2
Return fence from acquireBuffer
Change-Id: Iab22054c1dc4fd84affab3cc5bbdcd5a1e689666
Diffstat (limited to 'libs/gui/SurfaceTexture.cpp')
-rw-r--r--libs/gui/SurfaceTexture.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/libs/gui/SurfaceTexture.cpp b/libs/gui/SurfaceTexture.cpp
index 9a36bf9..435a665 100644
--- a/libs/gui/SurfaceTexture.cpp
+++ b/libs/gui/SurfaceTexture.cpp
@@ -236,8 +236,7 @@ status_t SurfaceTexture::updateTexImage(BufferRejecter* rejecter) {
// not accept this buffer. this is used by SurfaceFlinger to
// reject buffers which have the wrong size
if (rejecter && rejecter->reject(mEGLSlots[buf].mGraphicBuffer, item)) {
- mBufferQueue->releaseBuffer(buf, dpy, EGL_NO_SYNC_KHR,
- Fence::NO_FENCE);
+ mBufferQueue->releaseBuffer(buf, dpy, EGL_NO_SYNC_KHR, item.mFence);
glBindTexture(mTexTarget, mTexName);
return NO_ERROR;
}
@@ -261,6 +260,14 @@ status_t SurfaceTexture::updateTexImage(BufferRejecter* rejecter) {
}
}
+ // Temporary; fence will be provided to clients soon
+ if (item.mFence.get()) {
+ err = item.mFence->wait(Fence::TIMEOUT_NEVER);
+ if (err != OK) {
+ ST_LOGE("updateTexImage: failure waiting for fence: %d", err);
+ }
+ }
+
if (err == NO_ERROR) {
GLint error;
while ((error = glGetError()) != GL_NO_ERROR) {
@@ -284,8 +291,7 @@ status_t SurfaceTexture::updateTexImage(BufferRejecter* rejecter) {
if (err != NO_ERROR) {
// Release the buffer we just acquired. It's not safe to
// release the old buffer, so instead we just drop the new frame.
- mBufferQueue->releaseBuffer(buf, dpy, EGL_NO_SYNC_KHR,
- Fence::NO_FENCE);
+ mBufferQueue->releaseBuffer(buf, dpy, EGL_NO_SYNC_KHR, item.mFence);
return err;
}