summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2018-10-18 21:56:56 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-10-19 08:13:28 +0200
commitac39aba9b2d08b061b0eef651f5ebc7a84391171 (patch)
tree13c440bf9f1afe3088c43ccd0ae2ff2c2655d3a4
parent67c65aa21335cf28aca2e92a9fa2f180aa800ea6 (diff)
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 <noel.grandin@collabora.co.uk>
-rw-r--r--vcl/win/gdi/salfont.cxx16
1 files changed, 0 insertions, 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<sal_GlyphId, tools::Rectangle> 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<int>( fFontScale * rRect.Top() ));
rRect.SetBottom(static_cast<int>( fFontScale * rRect.Bottom() ) + 1);
- g_BoundRectCache.insert({rGlyph.maGlyphId, rRect});
-
return true;
}