diff options
author | 2016-02-03 19:45:06 -0800 | |
---|---|---|
committer | 2016-02-03 20:09:00 -0800 | |
commit | 7fc1b0349bc2ac8c880120dc5611f703faa7f06f (patch) | |
tree | 6eb28dc729ca8fcecc3be81bffb27828e32052e9 /libs/hwui/ClipArea.cpp | |
parent | d38308e4d0599836f9c5446ba9d6edbc0713c428 (diff) |
Fix ripple clipping + quick rejection
bug:26524690
Don't intersect the first clip with the viewport. Instead, the first
clip op should always be a replace op.
Additionally, only quick reject nodes that clip to bounds, since some
nodes (like ripples) draw outside their own bounds.
Change-Id: I96a52029f360328aba19af7349888cc0a026b5b1
Diffstat (limited to 'libs/hwui/ClipArea.cpp')
-rw-r--r-- | libs/hwui/ClipArea.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libs/hwui/ClipArea.cpp b/libs/hwui/ClipArea.cpp index 160090dcd8cc..9c08b4dd22ae 100644 --- a/libs/hwui/ClipArea.cpp +++ b/libs/hwui/ClipArea.cpp @@ -213,6 +213,7 @@ void ClipArea::setClip(float left, float top, float right, float bottom) { void ClipArea::clipRectWithTransform(const Rect& r, const mat4* transform, SkRegion::Op op) { + if (!mPostViewportClipObserved && op == SkRegion::kIntersect_Op) op = SkRegion::kReplace_Op; onClipUpdated(); switch (mMode) { case ClipMode::Rectangle: @@ -228,6 +229,7 @@ void ClipArea::clipRectWithTransform(const Rect& r, const mat4* transform, } void ClipArea::clipRegion(const SkRegion& region, SkRegion::Op op) { + if (!mPostViewportClipObserved && op == SkRegion::kIntersect_Op) op = SkRegion::kReplace_Op; onClipUpdated(); enterRegionMode(); mClipRegion.op(region, op); @@ -236,6 +238,7 @@ void ClipArea::clipRegion(const SkRegion& region, SkRegion::Op op) { void ClipArea::clipPathWithTransform(const SkPath& path, const mat4* transform, SkRegion::Op op) { + if (!mPostViewportClipObserved && op == SkRegion::kIntersect_Op) op = SkRegion::kReplace_Op; onClipUpdated(); SkMatrix skTransform; transform->copyTo(skTransform); |