aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPictureRecord.cpp
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-11-07 13:01:25 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-11-07 13:01:25 +0000
commit3302783ea7edf667794b088e5fc0656946b99816 (patch)
tree505ca54d415f22b5a4b8876cabb0c067aed7e8bf /src/core/SkPictureRecord.cpp
parent796a1753d96eb0c76e742c8288617d758ddf33df (diff)
Convert clipPaths to clipRects where possible in pictureRecord
Diffstat (limited to 'src/core/SkPictureRecord.cpp')
-rw-r--r--src/core/SkPictureRecord.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/SkPictureRecord.cpp b/src/core/SkPictureRecord.cpp
index edc67a064e..96467387b7 100644
--- a/src/core/SkPictureRecord.cpp
+++ b/src/core/SkPictureRecord.cpp
@@ -365,6 +365,12 @@ bool SkPictureRecord::clipRect(const SkRect& rect, SkRegion::Op op, bool doAA) {
}
bool SkPictureRecord::clipPath(const SkPath& path, SkRegion::Op op, bool doAA) {
+
+ SkRect r;
+ if (path.isRect(&r)) {
+ return this->clipRect(r, op, doAA);
+ }
+
addDraw(CLIP_PATH);
addPath(path);
addInt(ClipParams_pack(op, doAA));