diff options
author | bsalomon <bsalomon@google.com> | 2016-08-22 13:42:17 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-08-22 13:42:17 -0700 |
commit | bdc335f9b9fb8d2eb1b4a00f88b34288b06112fa (patch) | |
tree | 1e276d706af71b4c599269c07d7d776d36212603 /src | |
parent | 236e272380dcb30ad3ea009efe1be7f734dd6d8c (diff) |
Mark temporary paths created by SkCanvas for clipping as volatile
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2268723002
Review-Url: https://codereview.chromium.org/2268723002
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkCanvas.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp index 2564e37033..8f77afe78e 100644 --- a/src/core/SkCanvas.cpp +++ b/src/core/SkCanvas.cpp @@ -1611,6 +1611,7 @@ void SkCanvas::onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle edg SkPath path; path.addRect(rect); + path.setIsVolatile(true); this->SkCanvas::onClipPath(path, op, edgeStyle); } @@ -1647,6 +1648,7 @@ void SkCanvas::onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyle SkPath path; path.addRRect(rrect); + path.setIsVolatile(true); // call the non-virtual version this->SkCanvas::onClipPath(path, op, edgeStyle); } @@ -1703,7 +1705,12 @@ void SkCanvas::onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle edg } SkPath devPath; - path.transform(fMCRec->fMatrix, &devPath); + if (fMCRec->fMatrix.isIdentity()) { + devPath = path; + } else { + path.transform(fMCRec->fMatrix, &devPath); + devPath.setIsVolatile(true); + } // Check if the transfomation, or the original path itself // made us empty. Note this can also happen if we contained NaN |