aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkCanvas.cpp
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2015-03-11 10:39:04 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-03-11 10:39:05 -0700
commit180aec43451dd951fdaae81a92efc710ba093260 (patch)
tree878c17965e920ebf5dcc333755351c6eb0ff7522 /src/core/SkCanvas.cpp
parentd5b98404ece3b1d29bc47f75dec58430d16e39e5 (diff)
Simplify clip inside a layer -- will be applied in restore
This reverts commit 44124650895833378938b4b174302fbf64403fe2. NOTREECHECKS=True BUG=skia: Review URL: https://codereview.chromium.org/996233002
Diffstat (limited to 'src/core/SkCanvas.cpp')
-rw-r--r--src/core/SkCanvas.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 55b3b7ba7a..a31ded0586 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) {
@@ -862,14 +859,13 @@ bool SkCanvas::clipRectBounds(const SkRect* bounds, SaveFlags flags,
} else { // no user bounds, so just use the clip
ir = clipBounds;
}
+ SkASSERT(!ir.isEmpty());
if (bounds_affects_clip(flags)) {
+ // Simplify the current clips since they will be applied properly during restore()
fCachedLocalClipBoundsDirty = true;
- fClipStack->clipDevRect(ir, op);
- // early exit if the clip is now empty
- if (!fMCRec->fRasterClip.op(ir, op)) {
- return false;
- }
+ fClipStack->clipDevRect(ir, SkRegion::kReplace_Op);
+ fMCRec->fRasterClip.setRect(ir);
}
if (intersection) {