From ac39aba9b2d08b061b0eef651f5ebc7a84391171 Mon Sep 17 00:00:00 2001 From: Jan-Marek Glogowski Date: Thu, 18 Oct 2018 21:56:56 +0200 Subject: tdf#120204 drop simple glyph cache Master has a new shared LRU glyph cache, but that is much more new code. So simply drop the current cache implementation. Change-Id: Ib73f3680f3d6357b1c9d2b07db521867b3742843 Reviewed-on: https://gerrit.libreoffice.org/61961 Tested-by: Jenkins Reviewed-by: Noel Grandin --- vcl/win/gdi/salfont.cxx | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx index 8056b46522a6..a5e240afc480 100644 --- a/vcl/win/gdi/salfont.cxx +++ b/vcl/win/gdi/salfont.cxx @@ -58,11 +58,6 @@ using namespace vcl; -// GetGlyphOutlineW() seems to be a little slow, and doesn't seem to do its own caching (tested on Windows10). -// TODO include the font as part of the cache key, then we won't need to clear it on font change -// The cache limit is set by the rough number of characters needed to read your average Asian newspaper. -static o3tl::lru_map g_BoundRectCache(3000); - static const int MAXFONTHEIGHT = 2048; inline FIXED FixedFromDouble( double d ) @@ -853,8 +848,6 @@ HFONT WinSalGraphics::ImplDoSetFont(FontSelectPattern const * i_pFont, float& o_rFontScale, HFONT& o_rOldFont) { - // clear the cache on font change - g_BoundRectCache.clear(); HFONT hNewFont = nullptr; LOGFONTW aLogFont; @@ -1387,13 +1380,6 @@ void WinSalGraphics::ClearDevFontCache() bool WinSalGraphics::GetGlyphBoundRect(const GlyphItem& rGlyph, tools::Rectangle& rRect) { - auto it = g_BoundRectCache.find(rGlyph.maGlyphId); - if (it != g_BoundRectCache.end()) - { - rRect = it->second; - return true; - } - WinFontInstance* pFont = mpWinFontEntry[rGlyph.mnFallbackLevel]; HFONT hNewFont = pFont ? pFont->GetHFONT() : mhFonts[rGlyph.mnFallbackLevel]; float fFontScale = pFont ? pFont->GetScale() : mfFontScale[rGlyph.mnFallbackLevel]; @@ -1427,8 +1413,6 @@ bool WinSalGraphics::GetGlyphBoundRect(const GlyphItem& rGlyph, tools::Rectangle rRect.SetTop(static_cast( fFontScale * rRect.Top() )); rRect.SetBottom(static_cast( fFontScale * rRect.Bottom() ) + 1); - g_BoundRectCache.insert({rGlyph.maGlyphId, rRect}); - return true; } -- cgit v1.2.3