libgui: Add BufferItem(IGBC::BufferItem)

Add a constructor for building a BufferItem from an
IGraphicBufferConsumer::BufferItem.

Change-Id: I1394e693314429ada93427889f10b7b01c948053
This commit is contained in:
Dan Stoza 2015-03-11 15:35:39 -07:00
parent 358fc008f3
commit 8757c016c8
2 changed files with 16 additions and 0 deletions

View File

@ -44,6 +44,7 @@ class BufferItem : public Flattenable<BufferItem> {
// The default value of mBuf, used to indicate this doesn't correspond to a slot.
enum { INVALID_BUFFER_SLOT = -1 };
BufferItem();
BufferItem(const IGraphicBufferConsumer::BufferItem& item);
~BufferItem();
operator IGraphicBufferConsumer::BufferItem() const;

View File

@ -37,6 +37,21 @@ BufferItem::BufferItem() :
mCrop.makeInvalid();
}
BufferItem::BufferItem(const IGraphicBufferConsumer::BufferItem& item) :
mGraphicBuffer(item.mGraphicBuffer),
mFence(item.mFence),
mCrop(item.mCrop),
mTransform(item.mTransform),
mScalingMode(item.mScalingMode),
mTimestamp(item.mTimestamp),
mIsAutoTimestamp(item.mIsAutoTimestamp),
mDataSpace(item.mDataSpace),
mFrameNumber(item.mFrameNumber),
mSlot(item.mBuf),
mIsDroppable(item.mIsDroppable),
mAcquireCalled(item.mAcquireCalled),
mTransformToDisplayInverse(item.mTransformToDisplayInverse) {}
BufferItem::~BufferItem() {}
BufferItem::operator IGraphicBufferConsumer::BufferItem() const {