diff options
author | Mike Reed <reed@google.com> | 2016-11-09 13:59:58 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-11-09 19:40:06 +0000 |
commit | 824075071885b6b741c141cbe2134d8345d34589 (patch) | |
tree | 828b9fd105e92a6ff21b0dc942da6c015ea8ac73 /include/utils/SkCanvasStateUtils.h | |
parent | c78eff97549e8e346394d3e228395ceb8a467b35 (diff) |
Change SkCanvas to *not* inherit from SkRefCnt
Definitely tricky for classes like SkNWayCanvas, where the caller (today)
need not pay attention to ownership of the canvases it gave the NWay
(after this CL, the caller *must* managed ownership)
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4441
DOCS_PREVIEW= https://skia.org/?cl=4441
Change-Id: Ib1ac07a3cdf0686d78e7aaa4735d45cc90bea081
Reviewed-on: https://skia-review.googlesource.com/4441
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'include/utils/SkCanvasStateUtils.h')
-rw-r--r-- | include/utils/SkCanvasStateUtils.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/utils/SkCanvasStateUtils.h b/include/utils/SkCanvasStateUtils.h index 3071c7547c..fbc3a6f6e4 100644 --- a/include/utils/SkCanvasStateUtils.h +++ b/include/utils/SkCanvasStateUtils.h @@ -62,7 +62,12 @@ public: * identical to the captured canvas. The caller is responsible for * calling unref on the SkCanvas. */ - static SkCanvas* CreateFromCanvasState(const SkCanvasState* state); + static std::unique_ptr<SkCanvas> MakeFromCanvasState(const SkCanvasState* state); +#ifdef SK_SUPPORT_LEGACY_CANVAS_IS_REFCNT + static SkCanvas* CreateFromCanvasState(const SkCanvasState* state) { + return MakeFromCanvasState(state).release(); + } +#endif /** * Free the memory associated with the captured canvas state. The state |