summaryrefslogtreecommitdiff
path: root/libs/hwui/OpenGLRenderer.cpp
diff options
context:
space:
mode:
author Romain Guy <romainguy@google.com> 2013-02-11 18:01:20 -0800
committer Romain Guy <romainguy@google.com> 2013-02-11 18:04:23 -0800
commite67307c816f3fdae2bfba8e9a4410dc015645e91 (patch)
treea97695ed6c6e087364fba51b3a848d4aedebdb41 /libs/hwui/OpenGLRenderer.cpp
parentf16c7a97548cedccea291ffebc4388a7f15c9aa1 (diff)
Prevent crash when setting up a stencil-based clip
Bug #8177690 Clear the layers before we setup the stencil to avoid dereferencing the recently deleted rects. Change-Id: I5dce5f965672f276f9490636d85b6018d3ab9422
Diffstat (limited to 'libs/hwui/OpenGLRenderer.cpp')
-rw-r--r--libs/hwui/OpenGLRenderer.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index 08e2332df80b..62f268dab291 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -1179,6 +1179,10 @@ void OpenGLRenderer::clearLayerRegions() {
delete bounds;
}
+ // We must clear the list of dirty rects before we
+ // call setupDraw() to prevent stencil setup to do
+ // the same thing again
+ mLayers.clear();
setupDraw(false);
setupDrawColor(0.0f, 0.0f, 0.0f, 1.0f);
@@ -1195,9 +1199,8 @@ void OpenGLRenderer::clearLayerRegions() {
for (uint32_t i = 0; i < count; i++) {
delete mLayers.itemAt(i);
}
+ mLayers.clear();
}
-
- mLayers.clear();
}
///////////////////////////////////////////////////////////////////////////////