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

Unified Diff: Source/platform/fonts/android/FontCacheAndroid.cpp

Issue 665223004: Adaptation to Skia FontMgr API change (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix lifetime of locale names Created 6 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/android/FontCacheAndroid.cpp
diff --git a/Source/platform/fonts/android/FontCacheAndroid.cpp b/Source/platform/fonts/android/FontCacheAndroid.cpp
index 59dafdc1c8143bee60cb8bcf82727242a9e53dfd..f2c6de5b5186ddcb1042ff950690ecdc2b94882b 100644
--- a/Source/platform/fonts/android/FontCacheAndroid.cpp
+++ b/Source/platform/fonts/android/FontCacheAndroid.cpp
@@ -43,7 +43,16 @@ namespace blink {
static AtomicString getFamilyNameForCharacter(UChar32 c, const FontDescription& fontDescription)
{
RefPtr<SkFontMgr> fm = adoptRef(SkFontMgr::RefDefault());
- RefPtr<SkTypeface> typeface = adoptRef(fm->matchFamilyStyleCharacter(0, SkFontStyle(), fontDescription.locale().isEmpty() ? defaultLanguage().ascii().data() : fontDescription.locale().ascii().data(), c));
+ const char* bcp47Locales[2];
+ int localeCount = 0;
+ CString fontLocale;
+ if (!fontDescription.locale().isEmpty()) {
+ fontLocale = fontDescription.locale().ascii();
+ bcp47Locales[localeCount++] = fontLocale.data();
+ }
+ CString defaultLocale = defaultLanguage().ascii();
+ bcp47Locales[localeCount++] = defaultLocale.data();
bungeman-chromium 2014/10/23 16:55:41 I now have this documented and working more like a
+ RefPtr<SkTypeface> typeface = adoptRef(fm->matchFamilyStyleCharacter(0, SkFontStyle(), bcp47Locales, localeCount, c));
if (!typeface)
return emptyAtom;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698