From 358fc008f37e81c2a20425b9707fe137d2b1dbc4 Mon Sep 17 00:00:00 2001 From: Dan Stoza Date: Wed, 11 Mar 2015 14:04:22 -0700 Subject: [PATCH] libgui: Add a union to BufferItem for refactoring 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, so this change modifies the one inside of libgui to have a union of both names so that the one inside of IGBC can eventually be refactored away. Change-Id: I64f495105f56cbf5803cea4aa6b072ea29b70cf5 --- include/gui/BufferItem.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/include/gui/BufferItem.h b/include/gui/BufferItem.h index c7a8bc927..fecdbc168 100644 --- a/include/gui/BufferItem.h +++ b/include/gui/BufferItem.h @@ -86,8 +86,13 @@ class BufferItem : public Flattenable { // mFrameNumber is the number of the queued frame for this slot. uint64_t mFrameNumber; - // mSlot is the slot index of this buffer (default INVALID_BUFFER_SLOT). - int mSlot; + union { + // mSlot is the slot index of this buffer (default INVALID_BUFFER_SLOT). + int mSlot; + + // mBuf is the former name for mSlot + int mBuf; + }; // mIsDroppable whether this buffer was queued with the // property that it can be replaced by a new buffer for the purpose of