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

Unified Diff: src/core/SkCanvas.cpp

Issue 2268723002: Mark temporary paths created by SkCanvas for clipping as volatile (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 4 years, 4 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 | « no previous file | 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 2564e3703303f9f8f84fc7f1e6a043adb0509676..8f77afe78e1ca955b668a647b046d773daa83f26 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698