summaryrefslogtreecommitdiffstats
path: root/include/gui/GLConsumer.h
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2013-07-23 17:28:53 -0700
committerMathias Agopian <mathias@google.com>2013-07-26 18:45:02 -0700
commitad678e18b66f495efa78dc3b9ab99b579945c9e2 (patch)
treeb1158419e04a0417533618592ef58d5fa23490b5 /include/gui/GLConsumer.h
parentbf5b849ec7b2050e1fe05aebb3914823da6a0d07 (diff)
downloadframeworks_native-ad678e18b66f495efa78dc3b9ab99b579945c9e2.zip
frameworks_native-ad678e18b66f495efa78dc3b9ab99b579945c9e2.tar.gz
frameworks_native-ad678e18b66f495efa78dc3b9ab99b579945c9e2.tar.bz2
single buffer mode for BufferQueue
Bug: 9891035 Change-Id: Id1ab5f911a6dc4c1d8235e65775b3d3635231ad4
Diffstat (limited to 'include/gui/GLConsumer.h')
-rw-r--r--include/gui/GLConsumer.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/include/gui/GLConsumer.h b/include/gui/GLConsumer.h
index 1df5b42..ac4a832 100644
--- a/include/gui/GLConsumer.h
+++ b/include/gui/GLConsumer.h
@@ -98,6 +98,13 @@ public:
// This calls doGLFenceWait to ensure proper synchronization.
status_t updateTexImage();
+ // releaseTexImage releases the texture acquired in updateTexImage().
+ // This is intended to be used in single buffer mode.
+ //
+ // This call may only be made while the OpenGL ES context to which the
+ // target texture belongs is bound to the calling thread.
+ status_t releaseTexImage();
+
// setReleaseFence stores a fence that will signal when the current buffer
// is no longer being read. This fence will be returned to the producer
// when the current buffer is released by updateTexImage(). Multiple
@@ -251,7 +258,7 @@ protected:
// This releases the buffer in the slot referenced by mCurrentTexture,
// then updates state to refer to the BufferItem, which must be a
// newly-acquired buffer.
- status_t releaseAndUpdateLocked(const BufferQueue::BufferItem& item);
+ status_t updateAndReleaseLocked(const BufferQueue::BufferItem& item);
// Binds mTexName and the current buffer to mTexTarget. Uses
// mCurrentTexture if it's set, mCurrentTextureBuf if not. If the
@@ -416,6 +423,10 @@ private:
// It is set to false by detachFromContext, and then set to true again by
// attachToContext.
bool mAttached;
+
+ // mReleasedTexImageBuffer is a dummy buffer used when in single buffer
+ // mode and releaseTexImage() has been called
+ sp<GraphicBuffer> mReleasedTexImageBuffer;
};
// ----------------------------------------------------------------------------