Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Unified Diff: src/core/SkDraw.cpp

Issue 2155213002: check for culled-out paths inside SkDraw (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698