BQ: Allow shared buffer to be the first queued buffer
- When single-buffer mode is enabled the shared buffer will now be
either the first buffer dequeued or the first buffer queued.
Whichever comes first.
Bug 24940410
Change-Id: I9f7e2630640e37fe1fb967aed41a3025567247a8
diff --git a/include/gui/BufferQueueCore.h b/include/gui/BufferQueueCore.h
index acc8c4b..1b950ab 100644
--- a/include/gui/BufferQueueCore.h
+++ b/include/gui/BufferQueueCore.h
@@ -292,9 +292,6 @@
bool mAsyncMode;
// mSingleBufferMode indicates whether or not single buffer mode is enabled.
- // In single buffer mode, the last buffer that was dequeued is cached and
- // returned to all calls to dequeueBuffer and acquireBuffer. This allows the
- // consumer and producer to access the same buffer simultaneously.
bool mSingleBufferMode;
// When single buffer mode is enabled, this indicates whether the consumer
diff --git a/include/gui/IGraphicBufferProducer.h b/include/gui/IGraphicBufferProducer.h
index f6b4230..fee7c63 100644
--- a/include/gui/IGraphicBufferProducer.h
+++ b/include/gui/IGraphicBufferProducer.h
@@ -526,9 +526,10 @@
// Used to enable/disable single buffer mode.
//
- // In single buffer mode the last buffer that was dequeued will be cached
- // and returned to all calls to dequeueBuffer and acquireBuffer. This allows
- // the producer and consumer to simultaneously access the same buffer.
+ // When single buffer mode is enabled the first buffer that is queued or
+ // dequeued will be cached and returned to all subsequent calls to
+ // dequeueBuffer and acquireBuffer. This allows the producer and consumer to
+ // simultaneously access the same buffer.
virtual status_t setSingleBufferMode(bool singleBufferMode) = 0;
// Used to enable/disable auto-refresh.