OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 if (it == m_cache.end()) | 89 if (it == m_cache.end()) |
90 return; | 90 return; |
91 | 91 |
92 ASSERT(it->value.second); | 92 ASSERT(it->value.second); |
93 if (!--it->value.second) | 93 if (!--it->value.second) |
94 m_inactiveFontData.add(it->value.first); | 94 m_inactiveFontData.add(it->value.first); |
95 } | 95 } |
96 | 96 |
97 void FontDataCache::markAllVerticalData() | 97 void FontDataCache::markAllVerticalData() |
98 { | 98 { |
99 #if ENABLE(OPENTYPE_VERTICAL) | |
100 Cache::iterator end = m_cache.end(); | 99 Cache::iterator end = m_cache.end(); |
101 for (Cache::iterator fontData = m_cache.begin(); fontData != end; ++fontData
) { | 100 for (Cache::iterator fontData = m_cache.begin(); fontData != end; ++fontData
) { |
102 OpenTypeVerticalData* verticalData = const_cast<OpenTypeVerticalData*>(f
ontData->value.first->verticalData()); | 101 OpenTypeVerticalData* verticalData = const_cast<OpenTypeVerticalData*>(f
ontData->value.first->verticalData()); |
103 if (verticalData) | 102 if (verticalData) |
104 verticalData->setInFontCache(true); | 103 verticalData->setInFontCache(true); |
105 } | 104 } |
106 #endif | |
107 } | 105 } |
108 | 106 |
109 bool FontDataCache::purge(PurgeSeverity PurgeSeverity) | 107 bool FontDataCache::purge(PurgeSeverity PurgeSeverity) |
110 { | 108 { |
111 if (PurgeSeverity == ForcePurge) | 109 if (PurgeSeverity == ForcePurge) |
112 return purgeLeastRecentlyUsed(INT_MAX); | 110 return purgeLeastRecentlyUsed(INT_MAX); |
113 | 111 |
114 if (m_inactiveFontData.size() > cMaxInactiveFontData) | 112 if (m_inactiveFontData.size() > cMaxInactiveFontData) |
115 return purgeLeastRecentlyUsed(m_inactiveFontData.size() - cTargetInactiv
eFontData); | 113 return purgeLeastRecentlyUsed(m_inactiveFontData.size() - cTargetInactiv
eFontData); |
116 | 114 |
(...skipping 29 matching lines...) Expand all Loading... |
146 bool didWork = fontDataToDelete.size(); | 144 bool didWork = fontDataToDelete.size(); |
147 | 145 |
148 fontDataToDelete.clear(); | 146 fontDataToDelete.clear(); |
149 | 147 |
150 isPurging = false; | 148 isPurging = false; |
151 | 149 |
152 return didWork; | 150 return didWork; |
153 } | 151 } |
154 | 152 |
155 } // namespace blink | 153 } // namespace blink |
OLD | NEW |