diff options
author | tfarina <tfarina@chromium.org> | 2014-10-10 06:19:09 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-10 06:19:09 -0700 |
commit | a5414c4a8efc3119ee20fcee96c0bf68a04909c7 (patch) | |
tree | dacfac3ef78ce55b2c8723a17c8001d5c91e7510 /include | |
parent | 40636a53037eadd957b8e43f0961f640aaa93e84 (diff) |
Turn SkCanvasStateUtils into a class with static functions.
That simplifies the way to declare it a friend, as needed in SkCanvas.
BUG=skia:2914
TEST=make most
R=reed@google.com
Review URL: https://codereview.chromium.org/645773002
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkCanvas.h | 6 | ||||
-rw-r--r-- | include/utils/SkCanvasStateUtils.h | 9 |
2 files changed, 6 insertions, 9 deletions
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h index 5998ee5a30..4df523edef 100644 --- a/include/core/SkCanvas.h +++ b/include/core/SkCanvas.h @@ -41,10 +41,6 @@ class GrRenderTarget; class SkCanvasState; -namespace SkCanvasStateUtils { - SK_API SkCanvasState* CaptureCanvasState(SkCanvas*); -} - /** \class SkCanvas A Canvas encapsulates all of the state about drawing into a device (bitmap). @@ -1347,7 +1343,7 @@ private: SkCanvas(const SkBitmap&, const SkSurfaceProps&); // needs gettotalclip() - friend SkCanvasState* SkCanvasStateUtils::CaptureCanvasState(SkCanvas*); + friend class SkCanvasStateUtils; SkBaseDevice* createLayerDevice(const SkImageInfo&); diff --git a/include/utils/SkCanvasStateUtils.h b/include/utils/SkCanvasStateUtils.h index 6ea7b10307..3071c7547c 100644 --- a/include/utils/SkCanvasStateUtils.h +++ b/include/utils/SkCanvasStateUtils.h @@ -27,7 +27,8 @@ class SkCanvasState; * ReleaseCanvasState(...) ||| * */ -namespace SkCanvasStateUtils { +class SK_API SkCanvasStateUtils { +public: /** * Captures the current state of the canvas into an opaque ptr that is safe * to pass to a different instance of Skia (which may be the same version, @@ -47,7 +48,7 @@ namespace SkCanvasStateUtils { * to reconstruct the canvas. The caller is responsible for calling * ReleaseCanvasState to free the memory associated with this state. */ - SK_API SkCanvasState* CaptureCanvasState(SkCanvas* canvas); + static SkCanvasState* CaptureCanvasState(SkCanvas* canvas); /** * Create a new SkCanvas from the captured state of another SkCanvas. The @@ -61,7 +62,7 @@ namespace SkCanvasStateUtils { * identical to the captured canvas. The caller is responsible for * calling unref on the SkCanvas. */ - SK_API SkCanvas* CreateFromCanvasState(const SkCanvasState* state); + static SkCanvas* CreateFromCanvasState(const SkCanvasState* state); /** * Free the memory associated with the captured canvas state. The state @@ -71,7 +72,7 @@ namespace SkCanvasStateUtils { * * @param state The captured state you wish to dispose of. */ - SK_API void ReleaseCanvasState(SkCanvasState* state); + static void ReleaseCanvasState(SkCanvasState* state); }; #endif |