aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/SkCanvas.cpp23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 0f079aac01..7fbb952d22 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -953,9 +953,6 @@ bool SkCanvas::clipRectBounds(const SkRect* bounds, SaveLayerFlags saveLayerFlag
if (imageFilter) {
clipBounds = imageFilter->filterBounds(clipBounds, ctm);
- if (clipBounds.isEmpty()) {
- return false;
- }
if (bounds && !imageFilter->canComputeFastBounds()) {
bounds = nullptr;
}
@@ -963,21 +960,21 @@ bool SkCanvas::clipRectBounds(const SkRect* bounds, SaveLayerFlags saveLayerFlag
SkIRect ir;
if (bounds) {
SkRect r;
-
ctm.mapRect(&r, *bounds);
r.roundOut(&ir);
- // early exit if the layer's bounds are clipped out
- if (!ir.intersect(clipBounds)) {
- if (BoundsAffectsClip(saveLayerFlags)) {
- fMCRec->fTopLayer->fDevice->clipRegion(SkRegion(), SkClipOp::kIntersect); // empty
- fMCRec->fRasterClip.setEmpty();
- fDeviceClipBounds.setEmpty();
- }
- return false;
- }
} else { // no user bounds, so just use the clip
ir = clipBounds;
}
+
+ // early exit if the layer's bounds are clipped out
+ if (!ir.intersect(clipBounds)) {
+ if (BoundsAffectsClip(saveLayerFlags)) {
+ fMCRec->fTopLayer->fDevice->clipRegion(SkRegion(), SkClipOp::kIntersect); // empty
+ fMCRec->fRasterClip.setEmpty();
+ fDeviceClipBounds.setEmpty();
+ }
+ return false;
+ }
SkASSERT(!ir.isEmpty());
if (BoundsAffectsClip(saveLayerFlags)) {