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

Unified Diff: src/core/SkRasterClip.cpp

Issue 1461923004: Avoid devolving to a path when conservative clipping with RRects (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Simplify Created 5 years, 1 month 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 | « src/core/SkRasterClip.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkRasterClip.cpp
diff --git a/src/core/SkRasterClip.cpp b/src/core/SkRasterClip.cpp
index 89c22e8601fe67da5f3811e77b5649fb8a554b02..ea1a7db429b468be96c59980de30c4eea6daa874 100644
--- a/src/core/SkRasterClip.cpp
+++ b/src/core/SkRasterClip.cpp
@@ -161,10 +161,19 @@ bool SkRasterClip::setPath(const SkPath& path, const SkRegion& clip, bool doAA)
return this->updateCacheAndReturnNonEmpty();
}
+bool SkRasterClip::op(const SkRRect& rrect, const SkISize& size, SkRegion::Op op, bool doAA) {
+ if (fForceConservativeRects) {
+ return this->op(rrect.getBounds(), size, op, doAA);
+ }
+
+ SkPath path;
+ path.addRRect(rrect);
+
+ return this->op(path, size, op, doAA);
+}
+
bool SkRasterClip::op(const SkPath& path, const SkISize& size, SkRegion::Op op, bool doAA) {
- // base is used to limit the size (and therefore memory allocation) of the
- // region that results from scan converting devPath.
- SkRegion base;
+ AUTO_RASTERCLIP_VALIDATE(*this);
if (fForceConservativeRects) {
SkIRect ir;
@@ -181,6 +190,10 @@ bool SkRasterClip::op(const SkPath& path, const SkISize& size, SkRegion::Op op,
return this->op(ir, op);
}
+ // base is used to limit the size (and therefore memory allocation) of the
+ // region that results from scan converting devPath.
+ SkRegion base;
+
if (SkRegion::kIntersect_Op == op) {
// since we are intersect, we can do better (tighter) with currRgn's
// bounds, than just using the device. However, if currRgn is complex,
« no previous file with comments | « src/core/SkRasterClip.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698