Index: src/core/SkFontDescriptor.cpp |
diff --git a/src/core/SkFontDescriptor.cpp b/src/core/SkFontDescriptor.cpp |
index 85629efa7ec640bf53d5a6d9533b0916c8d3afd7..73ea2058ce79c618022334b970b6d702035e3f67 100644 |
--- a/src/core/SkFontDescriptor.cpp |
+++ b/src/core/SkFontDescriptor.cpp |
@@ -6,6 +6,7 @@ |
*/ |
#include "SkFontDescriptor.h" |
+#include "SkMakeUnique.h" |
#include "SkStream.h" |
#include "SkData.h" |
@@ -106,8 +107,8 @@ bool SkFontDescriptor::Deserialize(SkStream* stream, SkFontDescriptor* result) { |
if (length > 0) { |
sk_sp<SkData> data(SkData::MakeUninitialized(length)); |
if (stream->read(data->writable_data(), length) == length) { |
- result->fFontData.reset(new SkFontData(new SkMemoryStream(data), |
- index, axis, axisCount)); |
+ result->fFontData = skstd::make_unique<SkFontData>( |
+ skstd::make_unique<SkMemoryStream>(data), index, axis, axisCount); |
} else { |
SkDEBUGFAIL("Could not read font data"); |
return false; |
@@ -138,10 +139,10 @@ void SkFontDescriptor::serialize(SkWStream* stream) { |
stream->writePackedUInt(kSentinel); |
if (fFontData.get() && fFontData->hasStream()) { |
- SkAutoTDelete<SkStreamAsset> fontData(fFontData->detachStream()); |
- size_t length = fontData->getLength(); |
+ std::unique_ptr<SkStreamAsset> fontStream = fFontData->detachStream(); |
+ size_t length = fontStream->getLength(); |
stream->writePackedUInt(length); |
- stream->writeStream(fontData, length); |
+ stream->writeStream(fontStream.get(), length); |
} else { |
stream->writePackedUInt(0); |
} |