aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-02-16 23:35:31 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-02-16 23:35:31 +0000
commit14e50ae2a1b1cccdace599247b8c788b8db33ef4 (patch)
tree10db15322e348a58d79404ce4d241a314b4c070c /src/core
parente24ad23ae67ffcb0dc545b7e426cf08d102e0868 (diff)
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
Diffstat (limited to 'src/core')
-rw-r--r--src/core/SkCanvas.cpp26
1 files changed, 21 insertions, 5 deletions
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 7025e53eb1..cffc46aed8 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) {