| 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 30 matching lines...) Expand all Loading... |
| 41 #import <wtf/MainThread.h> | 41 #import <wtf/MainThread.h> |
| 42 #import <wtf/StdLibExtras.h> | 42 #import <wtf/StdLibExtras.h> |
| 43 | 43 |
| 44 // Forward declare Mac SPIs. | 44 // Forward declare Mac SPIs. |
| 45 // Request for public API: rdar://13803570 | 45 // Request for public API: rdar://13803570 |
| 46 @interface NSFont (WebKitSPI) | 46 @interface NSFont (WebKitSPI) |
| 47 + (NSFont*)findFontLike:(NSFont*)font forString:(NSString*)string withRange:(NSR
ange)range inLanguage:(id)useNil; | 47 + (NSFont*)findFontLike:(NSFont*)font forString:(NSString*)string withRange:(NSR
ange)range inLanguage:(id)useNil; |
| 48 + (NSFont*)findFontLike:(NSFont*)font forCharacter:(UniChar)uc inLanguage:(id)us
eNil; | 48 + (NSFont*)findFontLike:(NSFont*)font forCharacter:(UniChar)uc inLanguage:(id)us
eNil; |
| 49 @end | 49 @end |
| 50 | 50 |
| 51 namespace WebCore { | 51 namespace blink { |
| 52 | 52 |
| 53 // The "void*" parameter makes the function match the prototype for callbacks fr
om callOnMainThread. | 53 // The "void*" parameter makes the function match the prototype for callbacks fr
om callOnMainThread. |
| 54 static void invalidateFontCache(void*) | 54 static void invalidateFontCache(void*) |
| 55 { | 55 { |
| 56 if (!isMainThread()) { | 56 if (!isMainThread()) { |
| 57 callOnMainThread(&invalidateFontCache, 0); | 57 callOnMainThread(&invalidateFontCache, 0); |
| 58 return; | 58 return; |
| 59 } | 59 } |
| 60 FontCache::fontCache()->invalidate(); | 60 FontCache::fontCache()->invalidate(); |
| 61 } | 61 } |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 bool syntheticOblique = ((traits & NSFontItalicTrait) && !(actualTraits & NS
FontItalicTrait)) || fontDescription.isSyntheticItalic(); | 223 bool syntheticOblique = ((traits & NSFontItalicTrait) && !(actualTraits & NS
FontItalicTrait)) || fontDescription.isSyntheticItalic(); |
| 224 | 224 |
| 225 // FontPlatformData::font() can be null for the case of Chromium out-of-proc
ess font loading. | 225 // FontPlatformData::font() can be null for the case of Chromium out-of-proc
ess font loading. |
| 226 // In that case, we don't want to use the platformData. | 226 // In that case, we don't want to use the platformData. |
| 227 OwnPtr<FontPlatformData> platformData = adoptPtr(new FontPlatformData(platfo
rmFont, size, syntheticBold, syntheticOblique, fontDescription.orientation(), fo
ntDescription.widthVariant())); | 227 OwnPtr<FontPlatformData> platformData = adoptPtr(new FontPlatformData(platfo
rmFont, size, syntheticBold, syntheticOblique, fontDescription.orientation(), fo
ntDescription.widthVariant())); |
| 228 if (!platformData->font()) | 228 if (!platformData->font()) |
| 229 return 0; | 229 return 0; |
| 230 return platformData.leakPtr(); | 230 return platformData.leakPtr(); |
| 231 } | 231 } |
| 232 | 232 |
| 233 } // namespace WebCore | 233 } // namespace blink |
| OLD | NEW |