| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> | 3 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 + (NSFont*)findFontLike:(NSFont*)font forCharacter:(UniChar)uc inLanguage:(id)us
eNil; | 52 + (NSFont*)findFontLike:(NSFont*)font forCharacter:(UniChar)uc inLanguage:(id)us
eNil; |
| 53 @end | 53 @end |
| 54 | 54 |
| 55 namespace blink { | 55 namespace blink { |
| 56 | 56 |
| 57 const char* kColorEmojiFontMac = "Apple Color Emoji"; | 57 const char* kColorEmojiFontMac = "Apple Color Emoji"; |
| 58 | 58 |
| 59 static void invalidateFontCache() | 59 static void invalidateFontCache() |
| 60 { | 60 { |
| 61 if (!isMainThread()) { | 61 if (!isMainThread()) { |
| 62 Platform::current()->mainThread()->getWebTaskRunner()->postTask(BLINK_FR
OM_HERE, bind(&invalidateFontCache)); | 62 Platform::current()->mainThread()->getWebTaskRunner()->postTask(BLINK_FR
OM_HERE, WTF::bind(&invalidateFontCache)); |
| 63 return; | 63 return; |
| 64 } | 64 } |
| 65 FontCache::fontCache()->invalidate(); | 65 FontCache::fontCache()->invalidate(); |
| 66 } | 66 } |
| 67 | 67 |
| 68 static void fontCacheRegisteredFontsChangedNotificationCallback(CFNotificationCe
nterRef, void* observer, CFStringRef name, const void *, CFDictionaryRef) | 68 static void fontCacheRegisteredFontsChangedNotificationCallback(CFNotificationCe
nterRef, void* observer, CFStringRef name, const void *, CFDictionaryRef) |
| 69 { | 69 { |
| 70 ASSERT_UNUSED(observer, observer == FontCache::fontCache()); | 70 ASSERT_UNUSED(observer, observer == FontCache::fontCache()); |
| 71 ASSERT_UNUSED(name, CFEqual(name, kCTFontManagerRegisteredFontsChangedNotifi
cation)); | 71 ASSERT_UNUSED(name, CFEqual(name, kCTFontManagerRegisteredFontsChangedNotifi
cation)); |
| 72 invalidateFontCache(); | 72 invalidateFontCache(); |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 // When loading fails, we do not want to use the returned FontPlatformData s
ince it will not have | 235 // When loading fails, we do not want to use the returned FontPlatformData s
ince it will not have |
| 236 // a valid SkTypeface. | 236 // a valid SkTypeface. |
| 237 std::unique_ptr<FontPlatformData> platformData = wrapUnique(new FontPlatform
Data(platformFont, size, syntheticBold, syntheticItalic, fontDescription.orienta
tion())); | 237 std::unique_ptr<FontPlatformData> platformData = wrapUnique(new FontPlatform
Data(platformFont, size, syntheticBold, syntheticItalic, fontDescription.orienta
tion())); |
| 238 if (!platformData->typeface()) { | 238 if (!platformData->typeface()) { |
| 239 return nullptr; | 239 return nullptr; |
| 240 } | 240 } |
| 241 return platformData; | 241 return platformData; |
| 242 } | 242 } |
| 243 | 243 |
| 244 } // namespace blink | 244 } // namespace blink |
| OLD | NEW |