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

Unified Diff: src/core/SkDraw.cpp

Issue 2073873002: Simplify mask/clip intersection, making sure to explicitly check for an empty mask. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: becoming frustrating Created 4 years, 6 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 | tests/DrawTextTest.cpp » ('j') | 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 24fc9064a6dd092a91301d3608834fb9256f9b87..f615b83d1678f2fd9bae249df34e4ecbd4264ced 100644
--- a/src/core/SkDraw.cpp
+++ b/src/core/SkDraw.cpp
@@ -1488,19 +1488,14 @@ public:
} while (!clipper.done());
}
} else {
- SkIRect storage;
- SkIRect* bounds = &mask.fBounds;
-
- // this extra test is worth it, assuming that most of the time it succeeds
- // since we can avoid writing to storage
- if (!fClipBounds.containsNoEmptyCheck(mask.fBounds)) {
- if (!storage.intersectNoEmptyCheck(mask.fBounds, fClipBounds))
- return;
- bounds = &storage;
+ SkIRect storage;
+ if (mask.fBounds.isEmpty() ||
reed1 2016/06/17 10:39:42 I wonder 1. if it would be clearer to put this e
+ !storage.intersectNoEmptyCheck(mask.fBounds, fClipBounds)) {
+ return;
}
if (this->getImageData(glyph, &mask)) {
- this->blitMask(mask, *bounds);
+ this->blitMask(mask, storage);
}
}
}
« no previous file with comments | « no previous file | tests/DrawTextTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698