summaryrefslogtreecommitdiff
path: root/libs/gui/SurfaceTextureClient.cpp
diff options
context:
space:
mode:
author Jesse Hall <jessehall@google.com> 2012-06-25 13:54:23 -0700
committer Jesse Hall <jessehall@google.com> 2012-06-28 17:08:42 -0700
commitf9783af225aa3b41ec0af36f90941a714269abb7 (patch)
tree6d6ff4e211848dddf2314da20cf27548b2bf83c6 /libs/gui/SurfaceTextureClient.cpp
parentb7c839b1103f72f8eb89fc0e19f7805969fc622f (diff)
Return fence to client in dequeuBuffer
Change-Id: Ic19750793ad993f0e85391f3cabd743ba565d4c9
Diffstat (limited to 'libs/gui/SurfaceTextureClient.cpp')
-rw-r--r--libs/gui/SurfaceTextureClient.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/libs/gui/SurfaceTextureClient.cpp b/libs/gui/SurfaceTextureClient.cpp
index 57bc604f14..84f2ff4e91 100644
--- a/libs/gui/SurfaceTextureClient.cpp
+++ b/libs/gui/SurfaceTextureClient.cpp
@@ -222,15 +222,18 @@ int SurfaceTextureClient::dequeueBuffer(android_native_buffer_t** buffer,
}
if (fence.get()) {
- status_t err = fence->wait(Fence::TIMEOUT_NEVER);
- if (err != OK) {
- ALOGE("dequeueBuffer: error waiting for fence: %d", err);
+ *fenceFd = fence->dup();
+ if (*fenceFd == -1) {
+ ALOGE("dequeueBuffer: error duping fence: %d", errno);
+ // dup() should never fail; something is badly wrong. Soldier on
+ // and hope for the best; the worst that should happen is some
+ // visible corruption that lasts until the next frame.
}
- fence.clear();
+ } else {
+ *fenceFd = -1;
}
*buffer = gbuf.get();
- *fenceFd = -1;
return OK;
}