summaryrefslogtreecommitdiff
path: root/libs/gui/Surface.cpp
diff options
context:
space:
mode:
author Pablo Ceballos <pceballos@google.com> 2016-01-08 12:15:22 -0800
committer Pablo Ceballos <pceballos@google.com> 2016-02-02 11:15:47 -0800
commit23b4abe024ea88c45e0b94c80e1fb537a573b143 (patch)
tree410a141ea14a17a668076f28de3f5260cd43543d /libs/gui/Surface.cpp
parentc2a3d7aa1636d1fda62d65d7bd557a26428f1380 (diff)
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
Diffstat (limited to 'libs/gui/Surface.cpp')
-rw-r--r--libs/gui/Surface.cpp7
1 files changed, 7 insertions, 0 deletions
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<GraphicBuffer>* 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;
}