Index: src/core/SkDraw.cpp |
diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp |
index efc43d2e8080df0a7395ddb52b1c46400527c25e..8899a109abac1bc7e93aaccfcabfea79b176cbd8 100644 |
--- a/src/core/SkDraw.cpp |
+++ b/src/core/SkDraw.cpp |
@@ -1017,6 +1017,19 @@ SkScalar SkDraw::ComputeResScaleForStroking(const SkMatrix& matrix) { |
void SkDraw::drawDevPath(const SkPath& devPath, const SkPaint& paint, bool drawCoverage, |
SkBlitter* customBlitter, bool doFill) const { |
+ // Do a quick-reject test, since a looper or other modifier may have moved us out of range. |
+ { |
+ // outset 1 in case we're antialiasing |
+ SkRect clipBounds = SkRect::Make(fRC->getBounds()).makeOffset(1, 1); |
f(malita)
2016/07/18 16:34:15
makeOutset()
|
+ |
+ if (paint.getMaskFilter()) { |
+ paint.getMaskFilter()->computeFastBounds(clipBounds, &clipBounds); |
+ } |
+ if (!clipBounds.intersects(devPath.getBounds())) { |
+ return; |
+ } |
+ } |
+ |
SkBlitter* blitter = nullptr; |
SkAutoBlitterChoose blitterStorage; |
if (nullptr == customBlitter) { |