summaryrefslogtreecommitdiffstats
path: root/include/gui
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2011-11-30 10:50:52 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2011-11-30 10:50:52 -0800
commit993b2099cee5c3ad86a5fbbd29194994336187be (patch)
tree418b272f4f123457611c33146a53cf5ad3abb0fb /include/gui
parentdf96385b9acf9ec74c62edc34ffa9c8d9dae1c03 (diff)
parent55d3880eed3450748eb7b97281e030902ee29c2a (diff)
downloadframeworks_base-993b2099cee5c3ad86a5fbbd29194994336187be.zip
frameworks_base-993b2099cee5c3ad86a5fbbd29194994336187be.tar.gz
frameworks_base-993b2099cee5c3ad86a5fbbd29194994336187be.tar.bz2
am 55d3880e: am bb1e7d43: Merge changes I7e973a35,Ib3386fcc into ics-mr1
* commit '55d3880eed3450748eb7b97281e030902ee29c2a': SurfaceTexture: add EGL_KHR_fence_sync option SurfaceTexture: add a blit-to-FBO test
Diffstat (limited to 'include/gui')
-rw-r--r--include/gui/SurfaceTexture.h26
1 files changed, 22 insertions, 4 deletions
diff --git a/include/gui/SurfaceTexture.h b/include/gui/SurfaceTexture.h
index 15c2bab..a8c7672 100644
--- a/include/gui/SurfaceTexture.h
+++ b/include/gui/SurfaceTexture.h
@@ -60,10 +60,16 @@ public:
virtual void onFrameAvailable() = 0;
};
- // tex indicates the name OpenGL texture to which images are to be streamed.
- // This texture name cannot be changed once the SurfaceTexture is created.
+ // SurfaceTexture constructs a new SurfaceTexture object. tex indicates the
+ // name of the OpenGL ES texture to which images are to be streamed. This
+ // texture name cannot be changed once the SurfaceTexture is created.
+ // allowSynchronousMode specifies whether or not synchronous mode can be
+ // enabled. texTarget specifies the OpenGL ES texture target to which the
+ // texture will be bound in updateTexImage. useFenceSync specifies whether
+ // fences should be used to synchronize access to buffers if that behavior
+ // is enabled at compile-time.
SurfaceTexture(GLuint tex, bool allowSynchronousMode = true,
- GLenum texTarget = GL_TEXTURE_EXTERNAL_OES);
+ GLenum texTarget = GL_TEXTURE_EXTERNAL_OES, bool useFenceSync = true);
virtual ~SurfaceTexture();
@@ -276,7 +282,8 @@ private:
mTransform(0),
mScalingMode(NATIVE_WINDOW_SCALING_MODE_FREEZE),
mTimestamp(0),
- mFrameNumber(0) {
+ mFrameNumber(0),
+ mFence(EGL_NO_SYNC_KHR) {
mCrop.makeInvalid();
}
@@ -349,6 +356,11 @@ private:
// mFrameNumber is the number of the queued frame for this slot.
uint64_t mFrameNumber;
+ // mFence is the EGL sync object that must signal before the buffer
+ // associated with this buffer slot may be dequeued. It is initialized
+ // to EGL_NO_SYNC_KHR when the buffer is created and (optionally, based
+ // on a compile-time option) set to a new sync object in updateTexImage.
+ EGLSyncKHR mFence;
};
// mSlots is the array of buffer slots that must be mirrored on the client
@@ -472,6 +484,12 @@ private:
// It is set by the setName method.
String8 mName;
+ // mUseFenceSync indicates whether creation of the EGL_KHR_fence_sync
+ // extension should be used to prevent buffers from being dequeued before
+ // it's safe for them to be written. It gets set at construction time and
+ // never changes.
+ const bool mUseFenceSync;
+
// mMutex is the mutex used to prevent concurrent access to the member
// variables of SurfaceTexture objects. It must be locked whenever the
// member variables are accessed.