diff options
| author | 2016-01-11 17:50:08 -0800 | |
|---|---|---|
| committer | 2016-01-11 17:54:49 -0800 | |
| commit | 15f046866cb650d78f55d03327cfa4a474fc9471 (patch) | |
| tree | f92c4437ed703e3346f885f1ec02fb645e08556d /libs/hwui/BakedOpState.cpp | |
| parent | 5ea1724be4d3b6039818f91fc087e1216c1463d5 (diff) | |
Fix clip serialization crash
Can't safely rewind clip allocations, since those pointers are cached by
ClipArea. Instead add early rejection to handle most cases, and update
tests.
Change-Id: Ic32f95cf95602f427f25761a8da1583c4495f36d
Diffstat (limited to 'libs/hwui/BakedOpState.cpp')
| -rw-r--r-- | libs/hwui/BakedOpState.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libs/hwui/BakedOpState.cpp b/libs/hwui/BakedOpState.cpp index f1cc846593db..f0406fa13a3d 100644 --- a/libs/hwui/BakedOpState.cpp +++ b/libs/hwui/BakedOpState.cpp @@ -48,10 +48,10 @@ ResolvedRenderState::ResolvedRenderState(LinearAllocator& allocator, Snapshot& s const Rect& clipRect = clipState->rect; if (CC_UNLIKELY(clipRect.isEmpty() || !clippedBounds.intersects(clipRect))) { // Rejected based on either empty clip, or bounds not intersecting with clip - if (clipState) { - allocator.rewindIfLastAlloc(clipState); - clipState = nullptr; - } + + // Note: we could rewind the clipState object in situations where the clipRect is empty, + // but *only* if the caching logic within ClipArea was aware of the rewind. + clipState = nullptr; clippedBounds.setEmpty(); } else { // Not rejected! compute true clippedBounds and clipSideFlags |