diff options
author | Chris Craik <ccraik@google.com> | 2013-04-03 20:31:49 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-04-03 20:31:49 +0000 |
commit | ff7ae2dccd3b8ba015963126d8a655b417d3fcd3 (patch) | |
tree | eeca06b57efb30de5242c49214ab6ac95f96a5c9 /libs | |
parent | 75827d4a3155c190f455329a67c84ac8fbb9bda0 (diff) | |
parent | 1ed30c907ffbb71d1bc448ee57c66b0d16f600ef (diff) | |
download | frameworks_base-ff7ae2dccd3b8ba015963126d8a655b417d3fcd3.zip frameworks_base-ff7ae2dccd3b8ba015963126d8a655b417d3fcd3.tar.gz frameworks_base-ff7ae2dccd3b8ba015963126d8a655b417d3fcd3.tar.bz2 |
Merge "Correct save/restore match up" into jb-mr2-dev
Diffstat (limited to 'libs')
-rw-r--r-- | libs/hwui/DeferredDisplayList.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libs/hwui/DeferredDisplayList.cpp b/libs/hwui/DeferredDisplayList.cpp index 5ff92be..fe51bf9 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); |