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

Unified Diff: include/core/SkCanvas.h

Issue 249253003: Hide SaveFlags from the public SkCanvas API. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Suppress the canvas-state GM. Created 6 years, 8 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 | « gyp/common_conditions.gypi ('k') | 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 91fb642a8f1807431be8015061f75ab72d5154eb..f763be48f4c77ccfe05daf9d053399d402d7f02e 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -300,6 +300,9 @@ public:
///////////////////////////////////////////////////////////////////////////
+#ifndef SK_SUPPORT_LEGACY_SAVEFLAGS
+protected:
+#endif
enum SaveFlags {
/** save the matrix state, restoring it on restore() */
kMatrix_SaveFlag = 0x01,
@@ -323,6 +326,7 @@ public:
#endif
kARGB_ClipLayer_SaveFlag = 0x1F
};
+public:
/** This call saves the current matrix, clip, and drawFilter, and pushes a
copy onto a private stack. Subsequent calls to translate, scale,
@@ -330,7 +334,7 @@ public:
operate on this copy.
When the balancing call to restore() is made, the previous matrix, clip,
and drawFilter are restored.
- @param flags The flags govern what portion of the Matrix/Clip/drawFilter
+ @param flags (deprecated) The flags govern what portion of the Matrix/Clip/drawFilter
state the save (and matching restore) effect. For example,
if only kMatrix is specified, then only the matrix state
will be pushed and popped. Likewise for the clip if kClip
@@ -338,7 +342,11 @@ public:
by calls to save/restore.
@return The value to pass to restoreToCount() to balance this save()
*/
+#ifdef SK_SUPPORT_LEGACY_SAVEFLAGS
int save(SaveFlags flags = kMatrixClip_SaveFlag);
+#else
+ int save();
+#endif
/** This behaves the same as save(), but in addition it allocates an
offscreen bitmap. All drawing calls are directed there, and only when
@@ -350,11 +358,15 @@ public:
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
+ @param flags (deprecated) LayerFlags
@return The value to pass to restoreToCount() to balance this save()
*/
+#ifdef SK_SUPPORT_LEGACY_SAVEFLAGS
int saveLayer(const SkRect* bounds, const SkPaint* paint,
SaveFlags flags = kARGB_ClipLayer_SaveFlag);
+#else
+ int saveLayer(const SkRect* bounds, const SkPaint* paint);
+#endif
/** This behaves the same as save(), but in addition it allocates an
offscreen bitmap. All drawing calls are directed there, and only when
@@ -365,11 +377,15 @@ public:
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
+ @param flags (deprecated) LayerFlags
@return The value to pass to restoreToCount() to balance this save()
*/
+#ifdef SK_SUPPORT_LEGACY_SAVEFLAGS
int saveLayerAlpha(const SkRect* bounds, U8CPU alpha,
SaveFlags flags = kARGB_ClipLayer_SaveFlag);
+#else
+ int saveLayerAlpha(const SkRect* bounds, U8CPU alpha);
+#endif
/** This call balances a previous call to save(), and is used to remove all
modifications to the matrix/clip/drawFilter state since the last save
@@ -1277,6 +1293,11 @@ private:
friend class SkLua; // needs top layer size and offset
friend class SkDeferredDevice; // needs getTopDevice()
+ // These want to play with SaveFlags
+ friend class SkMatrixClipStateMgr;
+ friend class SkDrawCommand;
+ friend class SkObjectParser;
+
SkBaseDevice* createLayerDevice(const SkImageInfo&);
SkBaseDevice* init(SkBaseDevice*);
@@ -1319,6 +1340,8 @@ private:
const char text[], size_t byteLength,
SkScalar x, SkScalar y);
+ static bool bounds_affects_clip(SaveFlags);
+
/* These maintain a cache of the clip bounds in local coordinates,
(converted to 2s-compliment if floats are slow).
*/
« no previous file with comments | « gyp/common_conditions.gypi ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698