Revert[2] "Change SkCanvas to *not* inherit from SkRefCnt"
Changes over original:
- conditionalize ownership in SkPictureRecorder
- conditionalize ownership in SkCanvasStateUtils
This reverts commit b613c266df48cf45296ecc23d1bd7098c84bb7ba.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4742
Change-Id: Ib25514d6f546c69b6650b5c957403b04f7380dc2
Reviewed-on: https://skia-review.googlesource.com/4742
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
diff --git a/src/svg/SkSVGCanvas.cpp b/src/svg/SkSVGCanvas.cpp
index d3511c0..95a4625 100644
--- a/src/svg/SkSVGCanvas.cpp
+++ b/src/svg/SkSVGCanvas.cpp
@@ -7,11 +7,12 @@
#include "SkSVGCanvas.h"
#include "SkSVGDevice.h"
+#include "SkMakeUnique.h"
-SkCanvas* SkSVGCanvas::Create(const SkRect& bounds, SkXMLWriter* writer) {
+std::unique_ptr<SkCanvas> SkSVGCanvas::Make(const SkRect& bounds, SkXMLWriter* writer) {
// TODO: pass full bounds to the device
SkISize size = bounds.roundOut().size();
sk_sp<SkBaseDevice> device(SkSVGDevice::Create(size, writer));
- return new SkCanvas(device.get());
+ return skstd::make_unique<SkCanvas>(device.get());
}