[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - vcl/win

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Oct 19 06:14:34 UTC 2018


 vcl/win/gdi/salfont.cxx |   16 ----------------
 1 file changed, 16 deletions(-)

New commits:
commit ac39aba9b2d08b061b0eef651f5ebc7a84391171
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Thu Oct 18 21:56:56 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Oct 19 08:13:28 2018 +0200

    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 at collabora.co.uk>

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;
 }
 


More information about the Libreoffice-commits mailing list