OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2008 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2006, 2008 Apple Computer, Inc. All rights reserved. |
3 * Copyright (C) 2007-2008 Torch Mobile, Inc. | 3 * Copyright (C) 2007-2008 Torch Mobile, Inc. |
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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 // be valid for the duration of the current session, as controlled by | 107 // be valid for the duration of the current session, as controlled by |
108 // disable/enablePurging. | 108 // disable/enablePurging. |
109 ShapeCache* getShapeCache(const FallbackListCompositeKey&); | 109 ShapeCache* getShapeCache(const FallbackListCompositeKey&); |
110 | 110 |
111 void addClient(FontCacheClient*); | 111 void addClient(FontCacheClient*); |
112 | 112 |
113 unsigned short generation(); | 113 unsigned short generation(); |
114 void invalidate(); | 114 void invalidate(); |
115 | 115 |
116 SkFontMgr* fontManager() { return m_fontManager.get(); } | 116 SkFontMgr* fontManager() { return m_fontManager.get(); } |
117 static void setFontManager(const sk_sp<SkFontMgr>&); | 117 static void setFontManager(sk_sp<SkFontMgr>); |
118 | 118 |
119 #if !OS(MACOSX) | 119 #if !OS(MACOSX) |
120 static const AtomicString& systemFontFamily(); | 120 static const AtomicString& systemFontFamily(); |
121 #else | 121 #else |
122 static const AtomicString& legacySystemFontFamily(); | 122 static const AtomicString& legacySystemFontFamily(); |
123 #endif | 123 #endif |
124 #if OS(LINUX) || OS(ANDROID) | 124 #if OS(LINUX) || OS(ANDROID) |
125 static void setSystemFontFamily(const AtomicString&); | 125 static void setSystemFontFamily(const AtomicString&); |
126 #endif | 126 #endif |
127 | 127 |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 #endif | 239 #endif |
240 | 240 |
241 PassRefPtr<SimpleFontData> fallbackOnStandardFontStyle(const FontDescription&, | 241 PassRefPtr<SimpleFontData> fallbackOnStandardFontStyle(const FontDescription&, |
242 UChar32); | 242 UChar32); |
243 | 243 |
244 // Don't purge if this count is > 0; | 244 // Don't purge if this count is > 0; |
245 int m_purgePreventCount; | 245 int m_purgePreventCount; |
246 | 246 |
247 sk_sp<SkFontMgr> m_fontManager; | 247 sk_sp<SkFontMgr> m_fontManager; |
248 | 248 |
| 249 // A leaky owning bare pointer. |
249 static SkFontMgr* s_staticFontManager; | 250 static SkFontMgr* s_staticFontManager; |
250 | 251 |
251 #if OS(WIN) | 252 #if OS(WIN) |
252 static bool s_antialiasedTextEnabled; | 253 static bool s_antialiasedTextEnabled; |
253 static bool s_lcdTextEnabled; | 254 static bool s_lcdTextEnabled; |
254 static float s_deviceScaleFactor; | 255 static float s_deviceScaleFactor; |
255 static HashMap<String, sk_sp<SkTypeface>>* s_sideloadedFonts; | 256 static HashMap<String, sk_sp<SkTypeface>>* s_sideloadedFonts; |
256 // The system font metrics cache. | 257 // The system font metrics cache. |
257 static AtomicString* s_menuFontFamilyName; | 258 static AtomicString* s_menuFontFamilyName; |
258 static int32_t s_menuFontHeight; | 259 static int32_t s_menuFontHeight; |
(...skipping 13 matching lines...) Expand all Loading... |
272 WTF_MAKE_NONCOPYABLE(FontCachePurgePreventer); | 273 WTF_MAKE_NONCOPYABLE(FontCachePurgePreventer); |
273 | 274 |
274 public: | 275 public: |
275 FontCachePurgePreventer() { FontCache::fontCache()->disablePurging(); } | 276 FontCachePurgePreventer() { FontCache::fontCache()->disablePurging(); } |
276 ~FontCachePurgePreventer() { FontCache::fontCache()->enablePurging(); } | 277 ~FontCachePurgePreventer() { FontCache::fontCache()->enablePurging(); } |
277 }; | 278 }; |
278 | 279 |
279 } // namespace blink | 280 } // namespace blink |
280 | 281 |
281 #endif | 282 #endif |
OLD | NEW |