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

Unified Diff: content/common/font_config_ipc_linux.cc

Issue 2037133002: SkFontConfigInterface createTypeface to makeTypeface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move comes from utility. Created 4 years, 6 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
Index: content/common/font_config_ipc_linux.cc
diff --git a/content/common/font_config_ipc_linux.cc b/content/common/font_config_ipc_linux.cc
index 780e5f08de30767965e65de8e3f6a0cee91716f5..0c65468b75d9d4d5dfe833fc673f4611b7215159 100644
--- a/content/common/font_config_ipc_linux.cc
+++ b/content/common/font_config_ipc_linux.cc
@@ -15,6 +15,7 @@
#include <functional>
#include <memory>
+#include <utility>
#include "base/files/file_util.h"
#include "base/files/memory_mapped_file.h"
@@ -158,21 +159,21 @@ SkStreamAsset* FontConfigIPC::openStream(const FontIdentity& identity) {
return mapFileDescriptorToStream(result_fd);
}
-SkTypeface* FontConfigIPC::createTypeface(
+sk_sp<SkTypeface> FontConfigIPC::makeTypeface(
const SkFontConfigInterface::FontIdentity& identity) {
base::AutoLock lock(lock_);
auto mapped_typefaces_it = mapped_typefaces_.Get(identity);
if (mapped_typefaces_it != mapped_typefaces_.end())
- return SkSafeRef(mapped_typefaces_it->second.get());
+ return mapped_typefaces_it->second;
SkStreamAsset* typeface_stream = openStream(identity);
if (!typeface_stream)
return nullptr;
sk_sp<SkTypeface> typeface_from_stream(
- SkTypeface::CreateFromStream(typeface_stream, identity.fTTCIndex));
+ SkTypeface::MakeFromStream(typeface_stream, identity.fTTCIndex));
auto mapped_typefaces_insert_it =
- mapped_typefaces_.Put(identity, typeface_from_stream);
- return SkSafeRef(mapped_typefaces_insert_it->second.get());
+ mapped_typefaces_.Put(identity, std::move(typeface_from_stream));
+ return mapped_typefaces_insert_it->second;
}
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698