aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-03-10 19:47:58 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-03-10 19:47:58 +0000
commitb93ba45b58ad24e0e2cb75b842e24ff711c368b0 (patch)
tree10ea8de391bbc7663cca97e66ac3a83a22537dcb /include
parentbf998240837d8798e0b257416ce8832250b64af6 (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 'include')
-rw-r--r--include/core/SkCanvas.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index 093185c940..773df89d78 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -18,6 +18,10 @@
#include "SkRegion.h"
#include "SkXfermode.h"
+// if not defined, we always assume ClipToLayer for saveLayer()
+//#define SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG
+
+
//#define SK_SUPPORT_LEGACY_WRITEPIXELSCONFIG
//#define SK_SUPPORT_LEGACY_GETCLIPTYPE
//#define SK_SUPPORT_LEGACY_GETTOTALCLIP
@@ -325,12 +329,18 @@ public:
kHasAlphaLayer_SaveFlag = 0x04,
/** the layer needs to support 8-bits per color component */
kFullColorLayer_SaveFlag = 0x08,
- /** the layer should clip against the bounds argument */
+ /**
+ * the layer should clip against the bounds argument
+ *
+ * if SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG is undefined, this is treated as always on.
+ */
kClipToLayer_SaveFlag = 0x10,
// helper masks for common choices
kMatrixClip_SaveFlag = 0x03,
+#ifdef SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG
kARGB_NoClipLayer_SaveFlag = 0x0F,
+#endif
kARGB_ClipLayer_SaveFlag = 0x1F
};