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

Unified Diff: include/core/SkCanvas.h

Issue 1535993003: hide old SaveFlags (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years 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 | src/core/SkCanvas.cpp » ('j') | src/core/SkCanvas.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkCanvas.h
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index ae0dc38202fd5eb82b53028a2e3748e37c8f5433..9265cb483036c39c80ce788f1736e98302d7df6b 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -37,6 +37,10 @@ class SkSurface;
class SkSurface_Base;
class SkTextBlob;
+#ifdef SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG
+ #define SK_SUPPORT_LEGACY_SAVEFLAGS
f(malita) 2015/12/19 18:20:21 Any danger to define multiple times (do we need a
reed1 2015/12/20 03:05:45 Done.
+#endif
+
/** \class SkCanvas
A Canvas encapsulates all of the state about drawing into a device (bitmap).
@@ -281,6 +285,7 @@ public:
///////////////////////////////////////////////////////////////////////////
+#ifdef SK_SUPPORT_LEGACY_SAVEFLAGS
enum SaveFlags {
/** save the matrix state, restoring it on restore() */
// [deprecated] kMatrix_SaveFlag = 0x01,
@@ -307,6 +312,7 @@ public:
#endif
kARGB_ClipLayer_SaveFlag = 0x1F
};
+#endif
/** This call saves the current matrix, clip, and drawFilter, and pushes a
copy onto a private stack. Subsequent calls to translate, scale,
@@ -343,6 +349,7 @@ public:
*/
int saveLayerPreserveLCDTextRequests(const SkRect* bounds, const SkPaint* paint);
+#ifdef SK_SUPPORT_LEGACY_SAVEFLAGS
/** DEPRECATED - use saveLayer(const SkRect*, const SkPaint*) instead.
This behaves the same as saveLayer(const SkRect*, const SkPaint*),
@@ -360,6 +367,7 @@ public:
*/
SK_ATTR_EXTERNALLY_DEPRECATED("SaveFlags use is deprecated")
int saveLayer(const SkRect* bounds, const SkPaint* paint, SaveFlags flags);
+#endif
/** This behaves the same as save(), but in addition it allocates an
offscreen bitmap. All drawing calls are directed there, and only when
@@ -374,6 +382,7 @@ public:
*/
int saveLayerAlpha(const SkRect* bounds, U8CPU alpha);
+#ifdef SK_SUPPORT_LEGACY_SAVEFLAGS
/** DEPRECATED - use saveLayerAlpha(const SkRect*, U8CPU) instead.
This behaves the same as saveLayerAlpha(const SkRect*, U8CPU),
@@ -390,6 +399,7 @@ public:
*/
SK_ATTR_EXTERNALLY_DEPRECATED("SaveFlags use is deprecated")
int saveLayerAlpha(const SkRect* bounds, U8CPU alpha, SaveFlags flags);
+#endif
enum {
kIsOpaque_SaveLayerFlag = 1 << 0,
@@ -1335,7 +1345,10 @@ private:
};
static bool BoundsAffectsClip(SaveLayerFlags);
+#ifdef SK_SUPPORT_LEGACY_SAVEFLAGS
static uint32_t SaveFlagsToSaveLayerFlags(SaveFlags);
+#endif
+ static SaveLayerFlags LegacySaveFlagsToSaveLayerFlags(uint32_t legacySaveFlags);
enum ShaderOverrideOpacity {
kNone_ShaderOverrideOpacity, //!< there is no overriding shader (bitmap or image)
@@ -1574,6 +1587,7 @@ private:
size_t fRowBytes;
};
+#ifdef SK_SUPPORT_LEGACY_SAVEFLAGS
static inline SkCanvas::SaveFlags operator|(const SkCanvas::SaveFlags lhs,
const SkCanvas::SaveFlags rhs) {
return static_cast<SkCanvas::SaveFlags>(static_cast<int>(lhs) | static_cast<int>(rhs));
@@ -1584,6 +1598,7 @@ static inline SkCanvas::SaveFlags& operator|=(SkCanvas::SaveFlags& lhs,
lhs = lhs | rhs;
return lhs;
}
+#endif
class SkCanvasClipVisitor {
public:
« no previous file with comments | « no previous file | src/core/SkCanvas.cpp » ('j') | src/core/SkCanvas.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698