diff options
author | 2015-03-10 19:57:10 -0700 | |
---|---|---|
committer | 2015-03-10 19:57:10 -0700 | |
commit | c275493d4247a2c5ae845d340c4297258f4684bc (patch) | |
tree | e341b97e45b159e4a5a5e54795ff4d4fe5ee01f9 /src/core/SkCanvas.cpp | |
parent | 96e657d0e103b8358a77ecd913f6086929f792b8 (diff) |
simplify clip inside a layer -- will be applied in restore
BUG=skia:
TBR=
NOTREECHECKS=True
speculative land to measure performance
Review URL: https://codereview.chromium.org/997763002
Diffstat (limited to 'src/core/SkCanvas.cpp')
-rw-r--r-- | src/core/SkCanvas.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp index e4c03f3e5e..55e8b4ad10 100644 --- a/src/core/SkCanvas.cpp +++ b/src/core/SkCanvas.cpp @@ -833,7 +833,6 @@ 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; } @@ -842,8 +841,6 @@ 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) { @@ -863,9 +860,10 @@ bool SkCanvas::clipRectBounds(const SkRect* bounds, SaveFlags flags, } if (bounds_affects_clip(flags)) { - fClipStack->clipDevRect(ir, op); + // Simplify the current clips since they will be applied properly during restore() + fClipStack->clipDevRect(ir, SkRegion::kReplace_Op); // early exit if the clip is now empty - if (!fMCRec->fRasterClip.op(ir, op)) { + if (!fMCRec->fRasterClip.op(ir, SkRegion::kReplace_Op)) { return false; } } |