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

Unified Diff: src/core/SkCanvas.cpp

Issue 190723004: flag to make kClipToLayer_SaveFlag the default behavior (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: officially ignore the gm that was exercising this (now removed) feature Created 6 years, 9 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 | « include/core/SkCanvas.h ('k') | tests/CanvasStateTest.cpp » ('j') | 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 9dcbfdbc38891c65deb30feb8bf047dfc42022c4..0888a01fa459615322717b5896d68bed5e0dc229 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -812,7 +812,11 @@ int SkCanvas::save(SaveFlags flags) {
}
static bool bounds_affects_clip(SkCanvas::SaveFlags flags) {
+#ifdef SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG
return (flags & SkCanvas::kClipToLayer_SaveFlag) != 0;
+#else
+ return true;
+#endif
}
bool SkCanvas::clipRectBounds(const SkRect* bounds, SaveFlags flags,
@@ -872,6 +876,10 @@ static SkBaseDevice* createCompatibleDevice(SkCanvas* canvas,
int SkCanvas::internalSaveLayer(const SkRect* bounds, const SkPaint* paint,
SaveFlags flags, bool justForImageFilter) {
+#ifndef SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG
+ flags = (SaveFlags)(flags | kClipToLayer_SaveFlag);
+#endif
+
// do this before we create the layer. We don't call the public save() since
// that would invoke a possibly overridden virtual
int count = this->internalSave(flags);
« no previous file with comments | « include/core/SkCanvas.h ('k') | tests/CanvasStateTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698