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

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: 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..75f33eefc97d71d68411c6480d5bbd70762598ef 100644
--- a/content/common/font_config_ipc_linux.cc
+++ b/content/common/font_config_ipc_linux.cc
@@ -158,12 +158,12 @@ 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)
@@ -172,7 +172,7 @@ SkTypeface* FontConfigIPC::createTypeface(
SkTypeface::CreateFromStream(typeface_stream, identity.fTTCIndex));
f(malita) 2016/06/03 17:11:59 SkTypeface::MakeFromStream while here?
bungeman-chromium 2016/06/03 18:28:18 Done.
auto mapped_typefaces_insert_it =
mapped_typefaces_.Put(identity, typeface_from_stream);
- return SkSafeRef(mapped_typefaces_insert_it->second.get());
+ return mapped_typefaces_insert_it->second;
f(malita) 2016/06/03 17:11:59 Not new to this CL, but I wonder if it'd help to r
bungeman-chromium 2016/06/03 18:28:18 Ah, I see, the stack has a ref and then the map ge
f(malita) 2016/06/03 19:04:03 Awesome, thanks!
}
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698