aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/svg
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2016-11-09 13:59:58 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-11-09 19:40:06 +0000
commit824075071885b6b741c141cbe2134d8345d34589 (patch)
tree828b9fd105e92a6ff21b0dc942da6c015ea8ac73 /include/svg
parentc78eff97549e8e346394d3e228395ceb8a467b35 (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/svg')
-rw-r--r--include/svg/SkSVGCanvas.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/svg/SkSVGCanvas.h b/include/svg/SkSVGCanvas.h
index e285faa459..b72f273123 100644
--- a/include/svg/SkSVGCanvas.h
+++ b/include/svg/SkSVGCanvas.h
@@ -25,7 +25,13 @@ public:
* The 'bounds' parameter defines an initial SVG viewport (viewBox attribute on the root
* SVG element).
*/
- static SkCanvas* Create(const SkRect& bounds, SkXMLWriter*);
+ static std::unique_ptr<SkCanvas> Make(const SkRect& bounds, SkXMLWriter*);
+
+#ifdef SK_SUPPORT_LEGACY_CANVAS_IS_REFCNT
+ static SkCanvas* Create(const SkRect& bounds, SkXMLWriter* writer) {
+ return Make(bounds, writer).release();
+ }
+#endif
};
#endif