Index: src/core/SkFontMgr.cpp |
diff --git a/src/core/SkFontMgr.cpp b/src/core/SkFontMgr.cpp |
index 0f0066792636837af660e610ab96ede11b5d7bb2..57f82b03ba28201a21959f67ace59c7787191bc7 100644 |
--- a/src/core/SkFontMgr.cpp |
+++ b/src/core/SkFontMgr.cpp |
@@ -139,11 +139,11 @@ SkTypeface* SkFontMgr::createFromStream(SkStreamAsset* stream, const FontParamet |
return this->onCreateFromStream(stream, params); |
} |
-SkTypeface* SkFontMgr::createFromFontData(SkFontData* data) const { |
+SkTypeface* SkFontMgr::createFromFontData(std::unique_ptr<SkFontData> data) const { |
if (nullptr == data) { |
return nullptr; |
} |
- return this->onCreateFromFontData(data); |
+ return this->onCreateFromFontData(std::move(data)); |
} |
// This implementation is temporary until it can be made pure virtual. |
@@ -152,10 +152,8 @@ SkTypeface* SkFontMgr::onCreateFromStream(SkStreamAsset* stream, const FontParam |
} |
// This implementation is temporary until it can be made pure virtual. |
-SkTypeface* SkFontMgr::onCreateFromFontData(SkFontData* data) const { |
- SkTypeface* ret = this->createFromStream(data->detachStream(), data->getIndex()); |
- delete data; |
- return ret; |
+SkTypeface* SkFontMgr::onCreateFromFontData(std::unique_ptr<SkFontData> data) const { |
+ return this->createFromStream(data->detachStream().release(), data->getIndex()); |
} |
SkTypeface* SkFontMgr::createFromFile(const char path[], int ttcIndex) const { |