diff options
author | 2014-03-10 19:47:58 +0000 | |
---|---|---|
committer | 2014-03-10 19:47:58 +0000 | |
commit | b93ba45b58ad24e0e2cb75b842e24ff711c368b0 (patch) | |
tree | 10ea8de391bbc7663cca97e66ac3a83a22537dcb /src/core | |
parent | bf998240837d8798e0b257416ce8832250b64af6 (diff) |
flag to make kClipToLayer_SaveFlag the default behavior
#define SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG to get the old behavior
The goal is to remove the feature of saveLayer that allows the canvas to draw outside of the top-most layer.
R=robertphillips@google.com, scroggo@google.com
Review URL: https://codereview.chromium.org/190723004
git-svn-id: http://skia.googlecode.com/svn/trunk@13730 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkCanvas.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp index 9dcbfdbc38..0888a01fa4 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); |