aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2015-01-07 09:12:43 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-01-07 09:12:43 -0800
commit690fc594f11a987ba0e885a7eb01aff363395f12 (patch)
treebca37044feffc8e2ae1b54f86fd46bd0f9732909 /src
parent7e44bb191633e225fd0455c267dbf67f9ee8633e (diff)
Revert of It is dangerous to ignore SkRect::intersect's return value (patchset #6 id:100001 of https://codereview.chromium.org/833943002/)
Reason for revert: Still more Chromium clean up to do Original issue's description: > It is dangerous to ignore SkRect::intersect's return value > > Committed: https://skia.googlesource.com/skia/+/152f524fd325b7776b01f84afbfe2fa071648a05 TBR=reed@google.com NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/825983005
Diffstat (limited to 'src')
-rw-r--r--src/core/SkScan_AntiPath.cpp5
-rw-r--r--src/effects/SkBlurMaskFilter.cpp4
-rw-r--r--src/gpu/GrReducedClip.cpp5
-rw-r--r--src/utils/SkGatherPixelRefsAndRects.h5
4 files changed, 5 insertions, 14 deletions
diff --git a/src/core/SkScan_AntiPath.cpp b/src/core/SkScan_AntiPath.cpp
index 545a70129e..158f34d265 100644
--- a/src/core/SkScan_AntiPath.cpp
+++ b/src/core/SkScan_AntiPath.cpp
@@ -454,10 +454,7 @@ MaskSuperBlitter::MaskSuperBlitter(SkBlitter* realBlitter, const SkIRect& ir, co
fMask.fFormat = SkMask::kA8_Format;
fClipRect = ir;
- if (!fClipRect.intersect(clip.getBounds())) {
- SkASSERT(0);
- fClipRect.setEmpty();
- }
+ fClipRect.intersect(clip.getBounds());
// For valgrind, write 1 extra byte at the end so we don't read
// uninitialized memory. See comment in add_aa_span and fStorage[].
diff --git a/src/effects/SkBlurMaskFilter.cpp b/src/effects/SkBlurMaskFilter.cpp
index 97ae436367..aa576697e3 100644
--- a/src/effects/SkBlurMaskFilter.cpp
+++ b/src/effects/SkBlurMaskFilter.cpp
@@ -1184,9 +1184,7 @@ bool SkBlurMaskFilterImpl::canFilterMaskGPU(const SkRect& srcBounds,
// Outset srcRect and clipRect by 3 * sigma, to compute affected blur area.
srcRect.outset(sigma3, sigma3);
clipRect.outset(sigma3, sigma3);
- if (!srcRect.intersect(clipRect)) {
- srcRect.setEmpty();
- }
+ srcRect.intersect(clipRect);
*maskRect = srcRect;
return true;
}
diff --git a/src/gpu/GrReducedClip.cpp b/src/gpu/GrReducedClip.cpp
index ca97098794..3040b46313 100644
--- a/src/gpu/GrReducedClip.cpp
+++ b/src/gpu/GrReducedClip.cpp
@@ -409,10 +409,7 @@ void GrReducedClip::ReduceClipStack(const SkClipStack& stack,
if (tighterBounds) {
SkIRect stackIBounds;
stackBounds.roundOut(&stackIBounds);
- if (!tighterBounds->intersect(queryBounds, stackIBounds)) {
- SkASSERT(0);
- tighterBounds->setEmpty();
- }
+ tighterBounds->intersect(queryBounds, stackIBounds);
bounds = tighterBounds;
}
} else {
diff --git a/src/utils/SkGatherPixelRefsAndRects.h b/src/utils/SkGatherPixelRefsAndRects.h
index 9589c3ea38..6e11fbe6d5 100644
--- a/src/utils/SkGatherPixelRefsAndRects.h
+++ b/src/utils/SkGatherPixelRefsAndRects.h
@@ -79,9 +79,8 @@ protected:
SkRect mappedRect;
draw.fMatrix->mapRect(&mappedRect, rect);
SkRect clipRect = SkRect::Make(draw.fRC->getBounds());
- if (mappedRect.intersect(clipRect)) {
- fPRCont->add(bm.pixelRef(), mappedRect);
- }
+ mappedRect.intersect(clipRect);
+ fPRCont->add(bm.pixelRef(), mappedRect);
}
}
virtual void drawOval(const SkDraw& draw, const SkRect& rect,