From ccdfd60d79a8b7f1ed6401d0f2e8e29166a10584 Mon Sep 17 00:00:00 2001 From: Pablo Ceballos Date: Wed, 7 Oct 2015 15:05:45 -0700 Subject: BQ: Add support for single buffer mode - Adds a single buffer mode to BufferQueue. In this mode designate the first dequeued buffer as the shared buffer. All calls to dequeue() and acquire() will then return the shared buffer, allowing the producer and consumer to share it. - Modify the buffer slot state tracking. Add a new SHARED state for the shared buffer in single buffer mode. Also track how many times a buffer has been dequeued/queued/acquired as it's possible for a shared buffer to be both dequeued and acquired at the same time, or dequeued/acquired multiple times. This tracking is needed to know when to drop the buffer out of the SHARED state after single buffer mode has been disabled. - Add plumbing for enabling/disabling single buffer mode from Surface. Bug 24940410 Change-Id: I3fc550c74bacb5523c049a227111356257386853 --- libs/gui/BufferItem.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libs/gui/BufferItem.cpp') diff --git a/libs/gui/BufferItem.cpp b/libs/gui/BufferItem.cpp index 6a883cf807..7305861657 100644 --- a/libs/gui/BufferItem.cpp +++ b/libs/gui/BufferItem.cpp @@ -24,6 +24,8 @@ namespace android { BufferItem::BufferItem() : + mGraphicBuffer(NULL), + mFence(NULL), mCrop(Rect::INVALID_RECT), mTransform(0), mScalingMode(NATIVE_WINDOW_SCALING_MODE_FREEZE), @@ -34,7 +36,8 @@ BufferItem::BufferItem() : mSlot(INVALID_BUFFER_SLOT), mIsDroppable(false), mAcquireCalled(false), - mTransformToDisplayInverse(false) { + mTransformToDisplayInverse(false), + mSurfaceDamage() { } BufferItem::~BufferItem() {} -- cgit v1.2.3-59-g8ed1b