diff options
author | 2015-03-11 04:02:20 -0700 | |
---|---|---|
committer | 2015-03-11 04:02:20 -0700 | |
commit | 44124650895833378938b4b174302fbf64403fe2 (patch) | |
tree | 7550b49984dc41d07268bbe516eb34b9c558ed03 | |
parent | c275493d4247a2c5ae845d340c4297258f4684bc (diff) |
Revert of simplify clip inside a layer -- will be applied in restore (patchset #2 id:20001 of https://codereview.chromium.org/997763002/)
Reason for revert:
slight rebaselines needed in layouttests
http://build.chromium.org/p/tryserver.blink/builders/linux_blink_rel/builds/51755
Original issue's description:
> simplify clip inside a layer -- will be applied in restore
>
> BUG=skia:
> TBR=
> NOTREECHECKS=True
>
> speculative land to measure performance
>
> Committed: https://skia.googlesource.com/skia/+/c275493d4247a2c5ae845d340c4297258f4684bc
TBR=
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Review URL: https://codereview.chromium.org/997103002
-rw-r--r-- | src/core/SkCanvas.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp index 55e8b4ad10..e4c03f3e5e 100644 --- a/src/core/SkCanvas.cpp +++ b/src/core/SkCanvas.cpp @@ -833,6 +833,7 @@ static bool bounds_affects_clip(SkCanvas::SaveFlags flags) { 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 @@ bool SkCanvas::clipRectBounds(const SkRect* bounds, SaveFlags flags, 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 @@ bool SkCanvas::clipRectBounds(const SkRect* bounds, SaveFlags flags, } 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; } } |