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

Unified Diff: third_party/WebKit/Source/platform/fonts/mac/FontCacheMac.mm

Issue 1757703003: Extend FontCache fallback API to support FontFallbackPriority (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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: third_party/WebKit/Source/platform/fonts/mac/FontCacheMac.mm
diff --git a/third_party/WebKit/Source/platform/fonts/mac/FontCacheMac.mm b/third_party/WebKit/Source/platform/fonts/mac/FontCacheMac.mm
index 29be5a084e8670e036ce5aa458dd683e37bdb1db..2696403e961d2e25addc4bbe37a9653bef35e310 100644
--- a/third_party/WebKit/Source/platform/fonts/mac/FontCacheMac.mm
+++ b/third_party/WebKit/Source/platform/fonts/mac/FontCacheMac.mm
@@ -53,6 +53,8 @@
namespace blink {
+const char* kColorEmojiFontMac = { "Apple Color Emoji" };
eae 2016/03/02 18:26:54 Remove curly brackets.
+
static void invalidateFontCache()
{
if (!isMainThread()) {
@@ -87,8 +89,19 @@ static inline bool isAppKitFontWeightBold(NSInteger appKitFontWeight)
return appKitFontWeight >= 7;
}
-PassRefPtr<SimpleFontData> FontCache::fallbackFontForCharacter(const FontDescription& fontDescription, UChar32 character, const SimpleFontData* fontDataToSubstitute)
+PassRefPtr<SimpleFontData> FontCache::fallbackFontForCharacter(
+ const FontDescription& fontDescription,
+ UChar32 character,
+ const SimpleFontData* fontDataToSubstitute,
+ FontFallbackPriority fallbackPriority)
{
+
+ if (fallbackPriority == FontFallbackPriority::EmojiEmoji) {
+ RefPtr<SimpleFontData> emojiFont = getFontData(fontDescription, AtomicString(kColorEmojiFontMac));
+ if (emojiFont)
+ return emojiFont;
+ }
+
// FIXME: We should fix getFallbackFamily to take a UChar32
// and remove this split-to-UChar16 code.
UChar codeUnits[2];

Powered by Google App Engine
This is Rietveld 408576698