Do not apply transforms when using drawColor().
This fixes an issue in the way the clip transformations were applied.
Change-Id: I91e7b5d15baf244d1280e48938282bb33609081d
diff --git a/libs/hwui/Snapshot.h b/libs/hwui/Snapshot.h
index ef9269f..7265d91 100644
--- a/libs/hwui/Snapshot.h
+++ b/libs/hwui/Snapshot.h
@@ -56,6 +56,8 @@
previous(s),
layer(NULL),
fbo(s->fbo) {
+ mappedClip.set(s->clipRect);
+ transform.mapRect(mappedClip);
}
/**
@@ -87,12 +89,20 @@
* Returns the current clip region mapped by the current transform.
*/
const Rect& getMappedClip() {
+ return mappedClip;
+ }
+
+ /**
+ * Intersects the current clip with the new clip rectangle.
+ */
+ bool clip(float left, float top, float right, float bottom) {
+ bool clipped = clipRect.intersect(left, top, right, bottom);
if (flags & kFlagDirtyTransform) {
flags &= ~kFlagDirtyTransform;
mappedClip.set(clipRect);
transform.mapRect(mappedClip);
}
- return mappedClip;
+ return clipped;
}
/**