From cf3834db104e0b052056e3a06d46e3f222f0d372 Mon Sep 17 00:00:00 2001 From: Dan Stoza Date: Wed, 11 Mar 2015 14:04:22 -0700 Subject: 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 --- libs/gui/BufferItemConsumer.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'libs/gui/BufferItemConsumer.cpp') diff --git a/libs/gui/BufferItemConsumer.cpp b/libs/gui/BufferItemConsumer.cpp index 655bfe6e8c..fb978ddf0a 100644 --- a/libs/gui/BufferItemConsumer.cpp +++ b/libs/gui/BufferItemConsumer.cpp @@ -19,6 +19,7 @@ //#define ATRACE_TAG ATRACE_TAG_GRAPHICS #include +#include #include //#define BI_LOGV(x, ...) ALOGV("[%s] " x, mName.string(), ##__VA_ARGS__) @@ -52,7 +53,7 @@ void BufferItemConsumer::setName(const String8& name) { mConsumer->setConsumerName(name); } -status_t BufferItemConsumer::acquireBuffer(BufferItem *item, +status_t BufferItemConsumer::acquireBuffer(BufferQueue::BufferItem *item, nsecs_t presentWhen, bool waitForFence) { status_t err; @@ -82,6 +83,17 @@ status_t BufferItemConsumer::acquireBuffer(BufferItem *item, return OK; } +status_t BufferItemConsumer::acquireBuffer(android::BufferItem* outItem, + nsecs_t presentWhen, bool waitForFence) { + BufferQueue::BufferItem item; + status_t result = acquireBuffer(&item, presentWhen, waitForFence); + if (result != NO_ERROR) { + return result; + } + *outItem = item; + return NO_ERROR; +} + status_t BufferItemConsumer::releaseBuffer(const BufferItem &item, const sp& releaseFence) { status_t err; -- cgit v1.2.3-59-g8ed1b