DO NOT MERGE libgui: Prepare for IGBC::BufferItem removal
Currently, there are two instances of BufferItem: one inside of
IGraphicBufferConsumer, and a standalone one inside of libgui. They
only differ in the name of one of the fields, and we want to remove
the IGBC version. This changes things so that client code may be
incrementally switched over to the libgui version.
This is a squashed commit containing the following changes:
I64f495105f56cbf5803cea4aa6b072ea29b70cf5
I1394e693314429ada93427889f10b7b01c948053
I9c3bc8037fa9438d4d9080b8afb694219ef2f71f
I699ed0a6837076867ca756b28d1ffb2238f7a0d9
Iac8425e1241774304a131da2fb9dec6e82922f13
Change-Id: Ic4d51f5df6dbc70b376d13fceba2335b9bae4f3d
diff --git a/libs/gui/ConsumerBase.cpp b/libs/gui/ConsumerBase.cpp
index 5fc83ee..c8b5d0c 100644
--- a/libs/gui/ConsumerBase.cpp
+++ b/libs/gui/ConsumerBase.cpp
@@ -27,6 +27,7 @@
#include <hardware/hardware.h>
+#include <gui/BufferItem.h>
#include <gui/IGraphicBufferAlloc.h>
#include <gui/ISurfaceComposer.h>
#include <gui/SurfaceComposerClient.h>
@@ -179,7 +180,7 @@
}
}
-status_t ConsumerBase::acquireBufferLocked(BufferQueue::BufferItem *item,
+status_t ConsumerBase::acquireBufferLocked(BufferItem *item,
nsecs_t presentWhen) {
status_t err = mConsumer->acquireBuffer(item, presentWhen);
if (err != NO_ERROR) {
@@ -199,6 +200,17 @@
return OK;
}
+status_t ConsumerBase::acquireBufferLocked(BufferQueue::BufferItem *outItem,
+ nsecs_t presentWhen) {
+ BufferItem item;
+ status_t result = acquireBufferLocked(&item, presentWhen);
+ if (result != NO_ERROR) {
+ return result;
+ }
+ *outItem = item;
+ return NO_ERROR;
+}
+
status_t ConsumerBase::addReleaseFence(int slot,
const sp<GraphicBuffer> graphicBuffer, const sp<Fence>& fence) {
Mutex::Autolock lock(mMutex);