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

Unified Diff: src/core/SkCanvas.cpp

Issue 167283004: Make canvas pass rrects along to clip stack (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: update comment Created 6 years, 10 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 | « include/core/SkRRect.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkCanvas.cpp
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 7025e53eb197611ef286c622597daa21d8d674aa..cffc46aed8c1819ba341b7511b4d6157e0057b2b 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -1236,12 +1236,28 @@ bool SkCanvas::clipRRect(const SkRRect& rrect, SkRegion::Op op, bool doAA) {
if (rrect.isRect()) {
// call the non-virtual version
return this->SkCanvas::clipRect(rrect.getBounds(), op, doAA);
- } else {
- SkPath path;
- path.addRRect(rrect);
- // call the non-virtual version
- return this->SkCanvas::clipPath(path, op, doAA);
}
+
+ SkRRect transformedRRect;
+ if (rrect.transform(*fMCRec->fMatrix, &transformedRRect)) {
+ AutoValidateClip avc(this);
+
+ fDeviceCMDirty = true;
+ fCachedLocalClipBoundsDirty = true;
+ doAA &= fAllowSoftClip;
+
+ fClipStack.clipDevRRect(transformedRRect, op, doAA);
+
+ SkPath devPath;
+ devPath.addRRect(transformedRRect);
+
+ return clipPathHelper(this, fMCRec->fRasterClip, devPath, op, doAA);
+ }
+
+ SkPath path;
+ path.addRRect(rrect);
+ // call the non-virtual version
+ return this->SkCanvas::clipPath(path, op, doAA);
}
bool SkCanvas::clipPath(const SkPath& path, SkRegion::Op op, bool doAA) {
« no previous file with comments | « include/core/SkRRect.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698