summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJamie Gennis <jgennis@google.com>2012-09-05 20:09:05 -0700
committerJamie Gennis <jgennis@google.com>2012-09-06 17:54:53 -0700
commitb27254154642575dfb4bbfa79fbedde7d7ee23dd (patch)
tree20f11812c640baf475d46d04f6c3ac88e47d1829 /include
parent331841b96b92646c93c87627c03f77b892f711cd (diff)
downloadframeworks_native-b27254154642575dfb4bbfa79fbedde7d7ee23dd.zip
frameworks_native-b27254154642575dfb4bbfa79fbedde7d7ee23dd.tar.gz
frameworks_native-b27254154642575dfb4bbfa79fbedde7d7ee23dd.tar.bz2
libgui: move fence handling into ConsumerBase
This change moves some common fence handling code into the base class for BufferQueue consumer classes. It also makes the ConsumerBase class initialize a buffer slot's fence with the acquire fence every time a buffer is acquired. Change-Id: I0bd88bc269e919653b659bfb3ebfb04dd61692a0
Diffstat (limited to 'include')
-rw-r--r--include/gui/ConsumerBase.h9
-rw-r--r--include/gui/SurfaceTexture.h2
2 files changed, 9 insertions, 2 deletions
diff --git a/include/gui/ConsumerBase.h b/include/gui/ConsumerBase.h
index a0ddca8..68cce5a 100644
--- a/include/gui/ConsumerBase.h
+++ b/include/gui/ConsumerBase.h
@@ -152,7 +152,14 @@ protected:
// it is overridden the derived class's implementation must call
// ConsumerBase::acquireBufferLocked.
virtual status_t releaseBufferLocked(int buf, EGLDisplay display,
- EGLSyncKHR eglFence, const sp<Fence>& fence);
+ EGLSyncKHR eglFence);
+
+ // addReleaseFence adds the sync points associated with a fence to the set
+ // of sync points that must be reached before the buffer in the given slot
+ // may be used after the slot has been released. This should be called by
+ // derived classes each time some asynchronous work is kicked off that
+ // references the buffer.
+ status_t addReleaseFence(int slot, const sp<Fence>& fence);
// Slot contains the information and object references that
// ConsumerBase maintains about a BufferQueue buffer slot.
diff --git a/include/gui/SurfaceTexture.h b/include/gui/SurfaceTexture.h
index 2570cd9..80a010b 100644
--- a/include/gui/SurfaceTexture.h
+++ b/include/gui/SurfaceTexture.h
@@ -220,7 +220,7 @@ protected:
// releaseBufferLocked overrides the ConsumerBase method to update the
// mEglSlots array in addition to the ConsumerBase.
virtual status_t releaseBufferLocked(int buf, EGLDisplay display,
- EGLSyncKHR eglFence, const sp<Fence>& fence);
+ EGLSyncKHR eglFence);
static bool isExternalFormat(uint32_t format);