OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2008 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
43 #include "platform/fonts/FontSmoothingMode.h" | 43 #include "platform/fonts/FontSmoothingMode.h" |
44 #include "platform/fonts/TextRenderingMode.h" | 44 #include "platform/fonts/TextRenderingMode.h" |
45 #include "platform/fonts/opentype/OpenTypeVerticalData.h" | 45 #include "platform/fonts/opentype/OpenTypeVerticalData.h" |
46 #include "wtf/HashMap.h" | 46 #include "wtf/HashMap.h" |
47 #include "wtf/ListHashSet.h" | 47 #include "wtf/ListHashSet.h" |
48 #include "wtf/StdLibExtras.h" | 48 #include "wtf/StdLibExtras.h" |
49 #include "wtf/Vector.h" | 49 #include "wtf/Vector.h" |
50 #include "wtf/text/AtomicStringHash.h" | 50 #include "wtf/text/AtomicStringHash.h" |
51 #include "wtf/text/StringHash.h" | 51 #include "wtf/text/StringHash.h" |
52 | 52 |
53 using namespace WTF; | |
kangil_
2014/08/13 01:33:10
Name space WTF is alive. I don't think we can dele
heeyoun.lee
2014/08/13 02:57:27
Done.
| |
54 | |
55 namespace blink { | 53 namespace blink { |
56 | 54 |
57 #if !OS(WIN) | 55 #if !OS(WIN) |
58 FontCache::FontCache() | 56 FontCache::FontCache() |
59 : m_purgePreventCount(0) | 57 : m_purgePreventCount(0) |
60 { | 58 { |
61 } | 59 } |
62 #endif // !OS(WIN) | 60 #endif // !OS(WIN) |
63 | 61 |
64 typedef HashMap<FontCacheKey, OwnPtr<FontPlatformData>, FontCacheKeyHash, FontCa cheKeyTraits> FontPlatformDataCache; | 62 typedef HashMap<FontCacheKey, OwnPtr<FontPlatformData>, FontCacheKeyHash, FontCa cheKeyTraits> FontPlatformDataCache; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
107 result = getFontPlatformData(fontDescription, createByAlternateFamil y, true); | 105 result = getFontPlatformData(fontDescription, createByAlternateFamil y, true); |
108 } | 106 } |
109 if (result) | 107 if (result) |
110 gFontPlatformDataCache->set(key, adoptPtr(new FontPlatformData(*resu lt))); // Cache the result under the old name. | 108 gFontPlatformDataCache->set(key, adoptPtr(new FontPlatformData(*resu lt))); // Cache the result under the old name. |
111 } | 109 } |
112 | 110 |
113 return result; | 111 return result; |
114 } | 112 } |
115 | 113 |
116 #if ENABLE(OPENTYPE_VERTICAL) | 114 #if ENABLE(OPENTYPE_VERTICAL) |
117 typedef HashMap<FontCache::FontFileKey, RefPtr<OpenTypeVerticalData>, WTF::IntHa sh<FontCache::FontFileKey>, WTF::UnsignedWithZeroKeyHashTraits<FontCache::FontFi leKey> > FontVerticalDataCache; | 115 typedef HashMap<FontCache::FontFileKey, RefPtr<OpenTypeVerticalData>, WTF::IntHa sh<FontCache::FontFileKey>, WTF::UnsignedWithZeroKeyHashTraits<FontCache::FontFi leKey> > FontVerticalDataCache; |
kangil_
2014/08/13 01:33:10
Rather IMO we can delete WTF:: here.
heeyoun.lee
2014/08/13 02:57:27
Done.
| |
118 | 116 |
119 FontVerticalDataCache& fontVerticalDataCacheInstance() | 117 FontVerticalDataCache& fontVerticalDataCacheInstance() |
120 { | 118 { |
121 DEFINE_STATIC_LOCAL(FontVerticalDataCache, fontVerticalDataCache, ()); | 119 DEFINE_STATIC_LOCAL(FontVerticalDataCache, fontVerticalDataCache, ()); |
122 return fontVerticalDataCache; | 120 return fontVerticalDataCache; |
123 } | 121 } |
124 | 122 |
125 PassRefPtr<OpenTypeVerticalData> FontCache::getVerticalData(const FontFileKey& k ey, const FontPlatformData& platformData) | 123 PassRefPtr<OpenTypeVerticalData> FontCache::getVerticalData(const FontFileKey& k ey, const FontPlatformData& platformData) |
126 { | 124 { |
127 FontVerticalDataCache& fontVerticalDataCache = fontVerticalDataCacheInstance (); | 125 FontVerticalDataCache& fontVerticalDataCache = fontVerticalDataCacheInstance (); |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
284 clients.append(*it); | 282 clients.append(*it); |
285 | 283 |
286 ASSERT(numClients == clients.size()); | 284 ASSERT(numClients == clients.size()); |
287 for (size_t i = 0; i < numClients; ++i) | 285 for (size_t i = 0; i < numClients; ++i) |
288 clients[i]->fontCacheInvalidated(); | 286 clients[i]->fontCacheInvalidated(); |
289 | 287 |
290 purge(ForcePurge); | 288 purge(ForcePurge); |
291 } | 289 } |
292 | 290 |
293 } // namespace blink | 291 } // namespace blink |
OLD | NEW |