Chromium Code Reviews| Index: src/core/SkCanvas.cpp |
| diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp |
| index e4c03f3e5e0857464e52a43be2fa1518854d6e25..55e8b4ad10361ab9bf3ca7e8ac57a47de42e652e 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); |
|
robertphillips
2015/03/11 16:06:38
I don't think ir can be empty - remove this code?
reed1
2015/03/11 17:02:52
I'll make a new CL that asserts that it is non-emp
|
| // early exit if the clip is now empty |
| - if (!fMCRec->fRasterClip.op(ir, op)) { |
| + if (!fMCRec->fRasterClip.op(ir, SkRegion::kReplace_Op)) { |
| return false; |
| } |
| } |