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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 void removeClient(FontCacheClient*); | 101 void removeClient(FontCacheClient*); |
102 #endif | 102 #endif |
103 | 103 |
104 unsigned short generation(); | 104 unsigned short generation(); |
105 void invalidate(); | 105 void invalidate(); |
106 | 106 |
107 #if OS(WIN) | 107 #if OS(WIN) |
108 bool useSubpixelPositioning() const { return s_useSubpixelPositioning; } | 108 bool useSubpixelPositioning() const { return s_useSubpixelPositioning; } |
109 SkFontMgr* fontManager() { return m_fontManager.get(); } | 109 SkFontMgr* fontManager() { return m_fontManager.get(); } |
110 static bool useDirectWrite() { return s_useDirectWrite; } | 110 static bool useDirectWrite() { return s_useDirectWrite; } |
| 111 static bool antialiasedTextEnabled() { return s_antialiasedTextEnabled; } |
| 112 static bool lcdTextEnabled() { return s_lcdTextEnabled; } |
111 static float deviceScaleFactor() { return s_deviceScaleFactor; } | 113 static float deviceScaleFactor() { return s_deviceScaleFactor; } |
112 static void setUseDirectWrite(bool useDirectWrite) { s_useDirectWrite = useD
irectWrite; } | 114 static void setUseDirectWrite(bool useDirectWrite) { s_useDirectWrite = useD
irectWrite; } |
| 115 static void setAntialiasedTextEnabled(bool enabled) { s_antialiasedTextEnabl
ed = enabled; } |
| 116 static void setLCDTextEnabled(bool enabled) { s_lcdTextEnabled = enabled; } |
113 static void setFontManager(const RefPtr<SkFontMgr>&); | 117 static void setFontManager(const RefPtr<SkFontMgr>&); |
114 static void setDeviceScaleFactor(float deviceScaleFactor) { s_deviceScaleFac
tor = deviceScaleFactor; } | 118 static void setDeviceScaleFactor(float deviceScaleFactor) { s_deviceScaleFac
tor = deviceScaleFactor; } |
115 static void addSideloadedFontForTesting(SkTypeface*); | 119 static void addSideloadedFontForTesting(SkTypeface*); |
116 // Functions to cache and retrieve the system font metrics. | 120 // Functions to cache and retrieve the system font metrics. |
117 static void setMenuFontMetrics(const wchar_t* familyName, int32_t fontHeight
); | 121 static void setMenuFontMetrics(const wchar_t* familyName, int32_t fontHeight
); |
118 static void setSmallCaptionFontMetrics(const wchar_t* familyName, int32_t fo
ntHeight); | 122 static void setSmallCaptionFontMetrics(const wchar_t* familyName, int32_t fo
ntHeight); |
119 static void setStatusFontMetrics(const wchar_t* familyName, int32_t fontHeig
ht); | 123 static void setStatusFontMetrics(const wchar_t* familyName, int32_t fontHeig
ht); |
120 static int32_t menuFontHeight() { return s_menuFontHeight; } | 124 static int32_t menuFontHeight() { return s_menuFontHeight; } |
121 static const AtomicString& menuFontFamily() { return *s_smallCaptionFontFami
lyName; } | 125 static const AtomicString& menuFontFamily() { return *s_smallCaptionFontFami
lyName; } |
122 static int32_t smallCaptionFontHeight() { return s_smallCaptionFontHeight; } | 126 static int32_t smallCaptionFontHeight() { return s_smallCaptionFontHeight; } |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 PassRefPtr<SkTypeface> createTypeface(const FontDescription&, const FontFace
CreationParams&, CString& name); | 179 PassRefPtr<SkTypeface> createTypeface(const FontDescription&, const FontFace
CreationParams&, CString& name); |
176 | 180 |
177 PassRefPtr<SimpleFontData> fallbackOnStandardFontStyle(const FontDescription
&, UChar32); | 181 PassRefPtr<SimpleFontData> fallbackOnStandardFontStyle(const FontDescription
&, UChar32); |
178 | 182 |
179 // Don't purge if this count is > 0; | 183 // Don't purge if this count is > 0; |
180 int m_purgePreventCount; | 184 int m_purgePreventCount; |
181 | 185 |
182 #if OS(WIN) | 186 #if OS(WIN) |
183 RefPtr<SkFontMgr> m_fontManager; | 187 RefPtr<SkFontMgr> m_fontManager; |
184 static bool s_useDirectWrite; | 188 static bool s_useDirectWrite; |
| 189 static bool s_antialiasedTextEnabled; |
| 190 static bool s_lcdTextEnabled; |
185 static SkFontMgr* s_fontManager; | 191 static SkFontMgr* s_fontManager; |
186 static float s_deviceScaleFactor; | 192 static float s_deviceScaleFactor; |
187 static bool s_useSubpixelPositioning; | 193 static bool s_useSubpixelPositioning; |
188 static HashMap<String, RefPtr<SkTypeface>>* s_sideloadedFonts; | 194 static HashMap<String, RefPtr<SkTypeface>>* s_sideloadedFonts; |
189 // The system font metrics cache. | 195 // The system font metrics cache. |
190 static AtomicString* s_menuFontFamilyName; | 196 static AtomicString* s_menuFontFamilyName; |
191 static int32_t s_menuFontHeight; | 197 static int32_t s_menuFontHeight; |
192 static AtomicString* s_smallCaptionFontFamilyName; | 198 static AtomicString* s_smallCaptionFontFamilyName; |
193 static int32_t s_smallCaptionFontHeight; | 199 static int32_t s_smallCaptionFontHeight; |
194 static AtomicString* s_statusFontFamilyName; | 200 static AtomicString* s_statusFontFamilyName; |
195 static int32_t s_statusFontHeight; | 201 static int32_t s_statusFontHeight; |
196 #endif | 202 #endif |
197 | 203 |
198 friend class SimpleFontData; // For fontDataFromFontPlatformData | 204 friend class SimpleFontData; // For fontDataFromFontPlatformData |
199 friend class FontFallbackList; | 205 friend class FontFallbackList; |
200 }; | 206 }; |
201 | 207 |
202 class PLATFORM_EXPORT FontCachePurgePreventer { | 208 class PLATFORM_EXPORT FontCachePurgePreventer { |
203 USING_FAST_MALLOC(FontCachePurgePreventer); | 209 USING_FAST_MALLOC(FontCachePurgePreventer); |
204 WTF_MAKE_NONCOPYABLE(FontCachePurgePreventer); | 210 WTF_MAKE_NONCOPYABLE(FontCachePurgePreventer); |
205 public: | 211 public: |
206 FontCachePurgePreventer() { FontCache::fontCache()->disablePurging(); } | 212 FontCachePurgePreventer() { FontCache::fontCache()->disablePurging(); } |
207 ~FontCachePurgePreventer() { FontCache::fontCache()->enablePurging(); } | 213 ~FontCachePurgePreventer() { FontCache::fontCache()->enablePurging(); } |
208 }; | 214 }; |
209 | 215 |
210 } // namespace blink | 216 } // namespace blink |
211 | 217 |
212 #endif | 218 #endif |
OLD | NEW |