diff options
author | Jamie Gennis <jgennis@google.com> | 2012-09-09 17:48:42 -0700 |
---|---|---|
committer | Jamie Gennis <jgennis@google.com> | 2012-09-10 13:27:23 -0700 |
commit | 61e04b92bdeafc6fca89052d14dab1bd0c384a71 (patch) | |
tree | bbc279dd485ae70f48b57cca2cc8b9daf46252cc /include/gui | |
parent | 010dd4fb892aecf71e4631c22148fe57ef5b3958 (diff) | |
download | frameworks_native-61e04b92bdeafc6fca89052d14dab1bd0c384a71.zip frameworks_native-61e04b92bdeafc6fca89052d14dab1bd0c384a71.tar.gz frameworks_native-61e04b92bdeafc6fca89052d14dab1bd0c384a71.tar.bz2 |
SurfaceTexture: use eglWaitSync
This change adds a compile-option to use eglWaitSyncANDROID to ensure that
texturing operations that access the current buffer of a SurfaceTexture do not
occur until the buffer is completely written. It also moves this
synchronization into a new SurfaceTexture method called doGLFenceWait and
changes SurfaceFlinger's Layer class to use that method rather than performing
its own wait on the fence.
Change-Id: I70afa88086ca7ff49a80e3cd03d423767db7cb88
Diffstat (limited to 'include/gui')
-rw-r--r-- | include/gui/SurfaceTexture.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/gui/SurfaceTexture.h b/include/gui/SurfaceTexture.h index 80a010b..6e5a478 100644 --- a/include/gui/SurfaceTexture.h +++ b/include/gui/SurfaceTexture.h @@ -77,6 +77,9 @@ public: // // This call may only be made while the OpenGL ES context to which the // target texture belongs is bound to the calling thread. + // + // After calling this method the doGLFenceWait method must be called + // before issuing OpenGL ES commands that access the texture contents. status_t updateTexImage(); // setReleaseFence stores a fence file descriptor that will signal when the @@ -154,6 +157,12 @@ public: // ready to be read from. sp<Fence> getCurrentFence() const; + // doGLFenceWait inserts a wait command into the OpenGL ES command stream + // to ensure that it is safe for future OpenGL ES commands to access the + // current texture buffer. This must be called each time updateTexImage + // is called before issuing OpenGL ES commands that access the texture. + status_t doGLFenceWait() const; + // isSynchronousMode returns whether the SurfaceTexture is currently in // synchronous mode. bool isSynchronousMode() const; |