Make canvas pass rrects along to clip stack
BUG=skia:2181
R=robertphillips@google.com, reed@google.com
Author: bsalomon@google.com
Review URL: https://codereview.chromium.org/167283004
git-svn-id: http://skia.googlecode.com/svn/trunk@13470 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 7025e53..cffc46a 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -1236,12 +1236,28 @@
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) {