summaryrefslogtreecommitdiff
path: root/libs/hwui/DeferredDisplayList.cpp
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2013-04-03 12:37:35 -0700
committerChris Craik <ccraik@google.com>2013-04-03 12:37:35 -0700
commit1ed30c907ffbb71d1bc448ee57c66b0d16f600ef (patch)
tree1e52d895c0a755cd2e9521ea06bb5acbf1661b05 /libs/hwui/DeferredDisplayList.cpp
parent0102443c4f52f2e15fd731c452f0c4745312d448 (diff)
Correct save/restore match up
bug:8480642 With the additional save/restore around the operations in flush, the stored restore batches weren't matching up to the correct saves. Change-Id: I2f48f19009bd97289b6973283f43dc8d3e35affd
Diffstat (limited to 'libs/hwui/DeferredDisplayList.cpp')
-rw-r--r--libs/hwui/DeferredDisplayList.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/libs/hwui/DeferredDisplayList.cpp b/libs/hwui/DeferredDisplayList.cpp
index 5ff92be1a90a..fe51bf956d8c 100644
--- a/libs/hwui/DeferredDisplayList.cpp
+++ b/libs/hwui/DeferredDisplayList.cpp
@@ -34,6 +34,9 @@
namespace android {
namespace uirenderer {
+// Depth of the save stack at the beginning of batch playback at flush time
+#define FLUSH_SAVE_STACK_DEPTH 2
+
/////////////////////////////////////////////////////////////////////////////////
// Operation Batches
/////////////////////////////////////////////////////////////////////////////////
@@ -270,7 +273,7 @@ void DeferredDisplayList::addRestoreToCount(OpenGLRenderer& renderer, StateOp* o
while (!mSaveStack.isEmpty() && mSaveStack.top() >= newSaveCount) mSaveStack.pop();
- storeRestoreToCountBarrier(renderer, op, mSaveStack.size() + 1);
+ storeRestoreToCountBarrier(renderer, op, mSaveStack.size() + FLUSH_SAVE_STACK_DEPTH);
}
void DeferredDisplayList::addDrawOp(OpenGLRenderer& renderer, DrawOp* op) {
@@ -386,6 +389,8 @@ status_t DeferredDisplayList::flush(OpenGLRenderer& renderer, Rect& dirty) {
DrawModifiers restoreDrawModifiers = renderer.getDrawModifiers();
renderer.save(SkCanvas::kMatrix_SaveFlag | SkCanvas::kClip_SaveFlag);
+ // NOTE: depth of the save stack at this point, before playback, should be reflected in
+ // FLUSH_SAVE_STACK_DEPTH, so that save/restores match up correctly
status |= replayBatchList(mBatches, renderer, dirty);
renderer.restoreToCount(1);