Fix the system
Change-Id: Ie097ea5d6c0af9c5929b8c5deb76b4824d5de787
diff --git a/libs/hwui/Snapshot.cpp b/libs/hwui/Snapshot.cpp
index 5f801fb..de2c674 100644
--- a/libs/hwui/Snapshot.cpp
+++ b/libs/hwui/Snapshot.cpp
@@ -43,6 +43,8 @@
invisible(s->invisible), empty(false),
viewport(s->viewport), height(s->height) {
+ clipRegion = NULL;
+
if (saveFlags & SkCanvas::kMatrix_SaveFlag) {
mTransformRoot.load(*s->transform);
transform = &mTransformRoot;
@@ -57,11 +59,7 @@
if (s->clipRegion) {
mClipRegionRoot.merge(*s->clipRegion);
clipRegion = &mClipRegionRoot;
- } else {
- clipRegion = NULL;
}
-#else
- clipRegion = NULL;
#endif
} else {
clipRect = s->clipRect;
@@ -213,10 +211,12 @@
void Snapshot::setClip(float left, float top, float right, float bottom) {
clipRect->set(left, top, right, bottom);
+#if STENCIL_BUFFER_SIZE
if (clipRegion) {
clipRegion->clear();
clipRegion = NULL;
}
+#endif
flags |= Snapshot::kFlagClipSet;
}