Changeset 178853 in webkit
- Timestamp:
- Jan 21, 2015 11:33:14 AM (9 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r178822 r178853 1 2015-01-20 Antti Koivisto <antti@apple.com> 2 3 REGRESSION(r178180): Membuster regressed ~4% 4 https://bugs.webkit.org/show_bug.cgi?id=140495 5 6 Reviewed by Andreas Kling. 7 8 After r178180 we keep system fallback fonts that are used on glyph pages alive. 9 Previously we would traverse the glyph pages and remove entries referencing system fallbacks. 10 11 * platform/graphics/FontCache.cpp: 12 (WebCore::FontCache::purgeInactiveFontData): 13 * platform/graphics/FontCascade.cpp: 14 (WebCore::pruneUnreferencedEntriesFromFontGlyphsCache): 15 (WebCore::pruneSystemFallbackFonts): 16 * platform/graphics/FontCascade.h: 17 * platform/graphics/FontGlyphs.cpp: 18 (WebCore::FontGlyphs::pruneSystemFallbacks): 19 20 When clearing the font cache also remove the cached glyph pages that may contain system fallback fonts 21 and release the fallbacks. 22 23 * platform/graphics/FontGlyphs.h: 24 1 25 2015-01-21 Manuel Rego Casasnovas <rego@igalia.com> 2 26 -
trunk/Source/WebCore/platform/graphics/FontCache.cpp
r178673 r178853 428 428 { 429 429 pruneUnreferencedEntriesFromFontGlyphsCache(); 430 pruneSystemFallbackFonts(); 430 431 431 432 #if PLATFORM(IOS) -
trunk/Source/WebCore/platform/graphics/FontCascade.cpp
r178578 r178853 288 288 void pruneUnreferencedEntriesFromFontGlyphsCache() 289 289 { 290 Vector<unsigned, 50> toRemove; 291 FontGlyphsCache::iterator end = fontGlyphsCache().end(); 292 for (FontGlyphsCache::iterator it = fontGlyphsCache().begin(); it != end; ++it) { 293 if (it->value->glyphs.get().hasOneRef()) 294 toRemove.append(it->key); 295 } 296 for (unsigned i = 0; i < toRemove.size(); ++i) 297 fontGlyphsCache().remove(toRemove[i]); 290 fontGlyphsCache().removeIf([](FontGlyphsCache::KeyValuePairType& entry) { 291 return entry.value->glyphs.get().hasOneRef(); 292 }); 293 } 294 295 void pruneSystemFallbackFonts() 296 { 297 for (auto& entry : fontGlyphsCache().values()) 298 entry->glyphs->pruneSystemFallbacks(); 298 299 } 299 300 -
trunk/Source/WebCore/platform/graphics/FontCascade.h
r178510 r178853 346 346 void invalidateFontGlyphsCache(); 347 347 void pruneUnreferencedEntriesFromFontGlyphsCache(); 348 void pruneSystemFallbackFonts(); 348 349 void clearWidthCaches(); 349 350 -
trunk/Source/WebCore/platform/graphics/FontGlyphs.cpp
r178510 r178853 393 393 } 394 394 395 } 395 void FontGlyphs::pruneSystemFallbacks() 396 { 397 if (m_systemFallbackFontDataSet.isEmpty()) 398 return; 399 // Mutable glyph pages may reference fallback fonts. 400 if (m_cachedPageZero && !m_cachedPageZero->isImmutable()) 401 m_cachedPageZero = nullptr; 402 m_cachedPages.removeIf([](decltype(m_cachedPages)::KeyValuePairType& keyAndValue) { 403 return !keyAndValue.value->isImmutable(); 404 }); 405 m_systemFallbackFontDataSet.clear(); 406 } 407 408 } -
trunk/Source/WebCore/platform/graphics/FontGlyphs.h
r178388 r178853 70 70 WEBCORE_EXPORT const FontRanges& realizeFallbackRangesAt(const FontDescription&, unsigned fallbackIndex); 71 71 72 void pruneSystemFallbacks(); 73 72 74 private: 73 75 FontGlyphs(PassRefPtr<FontSelector>);
Note: See TracChangeset
for help on using the changeset viewer.