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

Unified Diff: include/core/SkCanvas.h

Issue 1648773002: SaveFlags begone! (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 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 | src/core/SkCanvas.cpp » ('j') | no next file with comments »
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 506912eb50572eaadf9b9c46686c077e0019e6fd..2812b32856a082a9913882c276fe4a3d102a2c95 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -285,35 +285,6 @@ public:
///////////////////////////////////////////////////////////////////////////
-#ifdef SK_SUPPORT_LEGACY_SAVEFLAGS
- enum SaveFlags {
- /** save the matrix state, restoring it on restore() */
- // [deprecated] kMatrix_SaveFlag = 0x01,
- kMatrix_SaveFlag = 0x01,
- /** save the clip state, restoring it on restore() */
- // [deprecated] kClip_SaveFlag = 0x02,
- kClip_SaveFlag = 0x02,
- /** the layer needs to support per-pixel alpha */
- kHasAlphaLayer_SaveFlag = 0x04,
- /** the layer needs to support 8-bits per color component */
- kFullColorLayer_SaveFlag = 0x08,
- /**
- * 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
- // [deprecated] kMatrixClip_SaveFlag = 0x03,
- kMatrixClip_SaveFlag = 0x03,
-#ifdef SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG
- kARGB_NoClipLayer_SaveFlag = 0x0F,
-#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,
rotate, skew, concat or clipRect, clipPath, and setDrawFilter all
@@ -349,26 +320,6 @@ 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*),
- but it allows fine-grained control of which state bits to be saved
- (and subsequently restored).
-
- @param bounds (may be null) This rect, if non-null, is used as a hint to
- limit the size of the offscreen, and thus drawing may be
- clipped to it, though that clipping is not guaranteed to
- happen. If exact clipping is desired, use clipRect().
- @param paint (may be null) This is copied, and is applied to the
- offscreen when restore() is called
- @param flags LayerFlags
- @return The value to pass to restoreToCount() to balance this save()
- */
- 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
the balancing call to restore() is made is that offscreen transfered to
@@ -382,25 +333,6 @@ 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),
- but it allows fine-grained control of which state bits to be saved
- (and subsequently restored).
-
- @param bounds (may be null) This rect, if non-null, is used as a hint to
- limit the size of the offscreen, and thus drawing may be
- clipped to it, though that clipping is not guaranteed to
- happen. If exact clipping is desired, use clipRect().
- @param alpha This is applied to the offscreen when restore() is called.
- @param flags LayerFlags
- @return The value to pass to restoreToCount() to balance this save()
- */
- SK_ATTR_EXTERNALLY_DEPRECATED("SaveFlags use is deprecated")
- int saveLayerAlpha(const SkRect* bounds, U8CPU alpha, SaveFlags flags);
-#endif
-
enum {
kIsOpaque_SaveLayerFlag = 1 << 0,
kPreserveLCDText_SaveLayerFlag = 1 << 1,
@@ -1362,16 +1294,8 @@ protected:
bool clipRectBounds(const SkRect* bounds, SaveLayerFlags, SkIRect* intersection,
const SkImageFilter* imageFilter = NULL);
-#ifdef SK_SUPPORT_LEGACY_SAVEFLAGS
- // Needed by SkiaCanvasProxy in Android. Make sure that class is updated
- // before removing this method.
- static uint32_t SaveLayerFlagsToSaveFlags(SaveLayerFlags);
-#endif
private:
static bool BoundsAffectsClip(SaveLayerFlags);
-#ifdef SK_SUPPORT_LEGACY_SAVEFLAGS
- static uint32_t SaveFlagsToSaveLayerFlags(SaveFlags);
-#endif
static SaveLayerFlags LegacySaveFlagsToSaveLayerFlags(uint32_t legacySaveFlags);
f(malita) 2016/01/28 20:42:56 I think we can relocate this helper to SkPicturePl
enum ShaderOverrideOpacity {
@@ -1568,19 +1492,6 @@ private:
};
#define SkAutoCanvasRestore(...) SK_REQUIRE_LOCAL_VAR(SkAutoCanvasRestore)
-#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));
-}
-
-static inline SkCanvas::SaveFlags& operator|=(SkCanvas::SaveFlags& lhs,
- const SkCanvas::SaveFlags rhs) {
- lhs = lhs | rhs;
- return lhs;
-}
-#endif
-
class SkCanvasClipVisitor {
public:
virtual ~SkCanvasClipVisitor();
« no previous file with comments | « no previous file | src/core/SkCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698