Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Unified Diff: src/core/SkFontDescriptor.cpp

Issue 2343933002: Revert of SkFontData to use smart pointers. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkFontDescriptor.h ('k') | src/core/SkFontMgr.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkFontDescriptor.cpp
diff --git a/src/core/SkFontDescriptor.cpp b/src/core/SkFontDescriptor.cpp
index 73ea2058ce79c618022334b970b6d702035e3f67..85629efa7ec640bf53d5a6d9533b0916c8d3afd7 100644
--- a/src/core/SkFontDescriptor.cpp
+++ b/src/core/SkFontDescriptor.cpp
@@ -6,7 +6,6 @@
*/
#include "SkFontDescriptor.h"
-#include "SkMakeUnique.h"
#include "SkStream.h"
#include "SkData.h"
@@ -107,8 +106,8 @@
if (length > 0) {
sk_sp<SkData> data(SkData::MakeUninitialized(length));
if (stream->read(data->writable_data(), length) == length) {
- result->fFontData = skstd::make_unique<SkFontData>(
- skstd::make_unique<SkMemoryStream>(data), index, axis, axisCount);
+ result->fFontData.reset(new SkFontData(new SkMemoryStream(data),
+ index, axis, axisCount));
} else {
SkDEBUGFAIL("Could not read font data");
return false;
@@ -139,10 +138,10 @@
stream->writePackedUInt(kSentinel);
if (fFontData.get() && fFontData->hasStream()) {
- std::unique_ptr<SkStreamAsset> fontStream = fFontData->detachStream();
- size_t length = fontStream->getLength();
+ SkAutoTDelete<SkStreamAsset> fontData(fFontData->detachStream());
+ size_t length = fontData->getLength();
stream->writePackedUInt(length);
- stream->writeStream(fontStream.get(), length);
+ stream->writeStream(fontData, length);
} else {
stream->writePackedUInt(0);
}
« no previous file with comments | « src/core/SkFontDescriptor.h ('k') | src/core/SkFontMgr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698