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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 static AtomicString getGenericFamilyNameForScript(const AtomicString& family
Name, UScriptCode); | 110 static AtomicString getGenericFamilyNameForScript(const AtomicString& family
Name, UScriptCode); |
111 #else | 111 #else |
112 struct SimpleFontFamily { | 112 struct SimpleFontFamily { |
113 String name; | 113 String name; |
114 bool isBold; | 114 bool isBold; |
115 bool isItalic; | 115 bool isItalic; |
116 }; | 116 }; |
117 static void getFontFamilyForCharacter(UChar32, const char* preferredLocale,
SimpleFontFamily*); | 117 static void getFontFamilyForCharacter(UChar32, const char* preferredLocale,
SimpleFontFamily*); |
118 #endif | 118 #endif |
119 | 119 |
120 // Multiplying the floating point size by 100 gives two decimal | |
121 // point precision which should be sufficient. | |
122 static const unsigned s_fontSizePrecisionMultiplier = 100; | |
123 | |
124 private: | 120 private: |
125 FontCache(); | 121 FontCache(); |
126 ~FontCache(); | 122 ~FontCache(); |
127 | 123 |
128 void disablePurging() { m_purgePreventCount++; } | 124 void disablePurging() { m_purgePreventCount++; } |
129 void enablePurging() | 125 void enablePurging() |
130 { | 126 { |
131 ASSERT(m_purgePreventCount); | 127 ASSERT(m_purgePreventCount); |
132 if (!--m_purgePreventCount) | 128 if (!--m_purgePreventCount) |
133 purgeInactiveFontDataIfNeeded(); | 129 purgeInactiveFontDataIfNeeded(); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 | 162 |
167 class FontCachePurgePreventer { | 163 class FontCachePurgePreventer { |
168 public: | 164 public: |
169 FontCachePurgePreventer() { fontCache()->disablePurging(); } | 165 FontCachePurgePreventer() { fontCache()->disablePurging(); } |
170 ~FontCachePurgePreventer() { fontCache()->enablePurging(); } | 166 ~FontCachePurgePreventer() { fontCache()->enablePurging(); } |
171 }; | 167 }; |
172 | 168 |
173 } | 169 } |
174 | 170 |
175 #endif | 171 #endif |
OLD | NEW |