Chromium Code Reviews| Index: third_party/WebKit/Source/platform/fonts/skia/FontCacheSkia.cpp |
| diff --git a/third_party/WebKit/Source/platform/fonts/skia/FontCacheSkia.cpp b/third_party/WebKit/Source/platform/fonts/skia/FontCacheSkia.cpp |
| index 7cb8c5cfac687d8444dd1c689a07e47a4fabcd5d..af11f0f2910833251c9a5036d69edd370690ba9e 100644 |
| --- a/third_party/WebKit/Source/platform/fonts/skia/FontCacheSkia.cpp |
| +++ b/third_party/WebKit/Source/platform/fonts/skia/FontCacheSkia.cpp |
| @@ -32,7 +32,6 @@ |
| #include "SkStream.h" |
| #include "SkTypeface.h" |
| #include "platform/Language.h" |
| -#include "platform/fonts/AcceptLanguagesResolver.h" |
| #include "platform/fonts/AlternateFontFamily.h" |
| #include "platform/fonts/FontCache.h" |
| #include "platform/fonts/FontDescription.h" |
| @@ -81,14 +80,16 @@ AtomicString FontCache::getFamilyNameForCharacter(SkFontMgr* fm, UChar32 c, cons |
| const char* bcp47Locales[kMaxLocales]; |
| size_t localeCount = 0; |
| - if (fallbackPriority == FontFallbackPriority::EmojiEmoji) { |
| + // Fill in the list of locales in the reverse priority order. |
| + // The last one is the highest. |
|
drott
2016/07/28 08:05:23
Perhaps we can rephrase this second line of the co
kojii
2016/07/29 04:27:40
Your text looks great, fixed. Wanted to put a link
|
| + const LayoutLocale* contentLocale = fontDescription.locale(); |
| + if (const LayoutLocale* hanLocale = LayoutLocale::localeForHan(contentLocale)) |
| + bcp47Locales[localeCount++] = hanLocale->localeForHanForSkFontMgr(); |
| + bcp47Locales[localeCount++] = LayoutLocale::getDefault().localeForSkFontMgr(); |
| + if (contentLocale) |
| + bcp47Locales[localeCount++] = contentLocale->localeForSkFontMgr(); |
| + if (fallbackPriority == FontFallbackPriority::EmojiEmoji) |
| bcp47Locales[localeCount++] = kAndroidColorEmojiLocale; |
| - } |
| - if (const char* hanLocale = AcceptLanguagesResolver::preferredHanSkFontMgrLocale()) |
| - bcp47Locales[localeCount++] = hanLocale; |
| - bcp47Locales[localeCount++] = LayoutLocale::getDefault().localeForSkFontMgr().data(); |
| - if (const LayoutLocale* locale = fontDescription.locale()) |
| - bcp47Locales[localeCount++] = locale->localeForSkFontMgr().data(); |
| ASSERT_WITH_SECURITY_IMPLICATION(localeCount < kMaxLocales); |
| RefPtr<SkTypeface> typeface = adoptRef(fm->matchFamilyStyleCharacter(0, SkFontStyle(), bcp47Locales, localeCount, c)); |
| if (!typeface) |