Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Unified Diff: src/core/SkCanvas.cpp

Issue 997103002: Revert of simplify clip inside a layer -- will be applied in restore (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkCanvas.cpp
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 55e8b4ad10361ab9bf3ca7e8ac57a47de42e652e..e4c03f3e5e0857464e52a43be2fa1518854d6e25 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -833,6 +833,7 @@
bool SkCanvas::clipRectBounds(const SkRect* bounds, SaveFlags flags,
SkIRect* intersection, const SkImageFilter* imageFilter) {
SkIRect clipBounds;
+ SkRegion::Op op = SkRegion::kIntersect_Op;
if (!this->getClipDeviceBounds(&clipBounds)) {
return false;
}
@@ -841,6 +842,8 @@
if (imageFilter) {
imageFilter->filterBounds(clipBounds, ctm, &clipBounds);
+ // Filters may grow the bounds beyond the device bounds.
+ op = SkRegion::kReplace_Op;
}
SkIRect ir;
if (bounds) {
@@ -860,10 +863,9 @@
}
if (bounds_affects_clip(flags)) {
- // Simplify the current clips since they will be applied properly during restore()
- fClipStack->clipDevRect(ir, SkRegion::kReplace_Op);
+ fClipStack->clipDevRect(ir, op);
// early exit if the clip is now empty
- if (!fMCRec->fRasterClip.op(ir, SkRegion::kReplace_Op)) {
+ if (!fMCRec->fRasterClip.op(ir, op)) {
return false;
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698