From 23b4abe024ea88c45e0b94c80e1fb537a573b143 Mon Sep 17 00:00:00 2001 From: Pablo Ceballos Date: Fri, 8 Jan 2016 12:15:22 -0800 Subject: BQ: Improved buffer/slot tracking - Explicitly track active buffers and unused slots on top of the already existing tracking for free slots and free buffers. Change-Id: Ife2678678e96f0eb0b3fb21571058378134bd868 --- libs/gui/Surface.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libs/gui/Surface.cpp') diff --git a/libs/gui/Surface.cpp b/libs/gui/Surface.cpp index 9e90ad0f5c..6fc55c344e 100644 --- a/libs/gui/Surface.cpp +++ b/libs/gui/Surface.cpp @@ -759,6 +759,13 @@ int Surface::detachNextBuffer(sp* outBuffer, *outFence = Fence::NO_FENCE; } + for (int i = 0; i < NUM_BUFFER_SLOTS; i++) { + if (mSlots[i].buffer != NULL && + mSlots[i].buffer->handle == buffer->handle) { + mSlots[i].buffer = NULL; + } + } + return NO_ERROR; } -- cgit v1.2.3-59-g8ed1b