diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2018-10-05 08:25:40 +0000 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2018-10-06 12:04:40 +0200 |
commit | ede39d78282484650796456327a35a879a475cef (patch) | |
tree | 220e3bff19bea06baf6956507578d92eaa54a992 /vcl/unx/generic/glyphs/glyphcache.cxx | |
parent | 2b3bd14c566e97044b50bb81d8d61bc6bb0fd37b (diff) |
UNX merge FreetypeManager into GlyphCache
Change-Id: I736cc60af6d0c91623a25843bd9ff8fcdd9e8e90
Reviewed-on: https://gerrit.libreoffice.org/61453
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'vcl/unx/generic/glyphs/glyphcache.cxx')
-rw-r--r-- | vcl/unx/generic/glyphs/glyphcache.cxx | 33 |
1 files changed, 7 insertions, 26 deletions
diff --git a/vcl/unx/generic/glyphs/glyphcache.cxx b/vcl/unx/generic/glyphs/glyphcache.cxx index 3ce24ece848c..e2a1358b3567 100644 --- a/vcl/unx/generic/glyphs/glyphcache.cxx +++ b/vcl/unx/generic/glyphs/glyphcache.cxx @@ -37,17 +37,19 @@ GlyphCache::GlyphCache() mnLruIndex(0), mnGlyphCount(0), mpCurrentGCFont(nullptr) + , m_nMaxFontId(0) { pInstance = this; - mpFtManager.reset( new FreetypeManager ); + + InitFreetype(); } GlyphCache::~GlyphCache() { - InvalidateAllGlyphs(); + ClearFontCache(); } -void GlyphCache::InvalidateAllGlyphs() +void GlyphCache::ClearFontCache() { for (auto& font : maFontList) { @@ -59,6 +61,7 @@ void GlyphCache::InvalidateAllGlyphs() maFontList.clear(); mpCurrentGCFont = nullptr; + m_aFontInfoList.clear(); } void GlyphCache::ClearFontOptions() @@ -159,26 +162,6 @@ GlyphCache& GlyphCache::GetInstance() return *pInstance; } -void GlyphCache::AddFontFile( const OString& rNormalizedName, int nFaceNum, - sal_IntPtr nFontId, const FontAttributes& rDFA) -{ - if( mpFtManager ) - mpFtManager->AddFontFile( rNormalizedName, nFaceNum, nFontId, rDFA); -} - -void GlyphCache::AnnounceFonts( PhysicalFontCollection* pFontCollection ) const -{ - if( mpFtManager ) - mpFtManager->AnnounceFonts( pFontCollection ); -} - -void GlyphCache::ClearFontCache() -{ - InvalidateAllGlyphs(); - if (mpFtManager) - mpFtManager->ClearFontList(); -} - FreetypeFont* GlyphCache::CacheFont(LogicalFontInstance* pFontInstance) { // a serverfont request has a fontid > 0 @@ -195,9 +178,7 @@ FreetypeFont* GlyphCache::CacheFont(LogicalFontInstance* pFontInstance) } // font not cached yet => create new font item - FreetypeFont* pNew = nullptr; - if (mpFtManager) - pNew = mpFtManager->CreateFont(pFontInstance); + FreetypeFont* pNew = CreateFont(pFontInstance); if( pNew ) { |