[Libreoffice-commits] core.git: vcl/inc vcl/unx

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Aug 21 19:36:48 UTC 2018


 vcl/inc/unx/freetype_glyphcache.hxx            |    2 +-
 vcl/inc/unx/glyphcache.hxx                     |    2 +-
 vcl/unx/generic/glyphs/freetype_glyphcache.cxx |   14 ++++++++------
 vcl/unx/generic/glyphs/glyphcache.cxx          |    2 +-
 4 files changed, 11 insertions(+), 9 deletions(-)

New commits:
commit fb4a58fcaefc2f437c0ec4a7cb40281aef4162da
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Aug 20 17:29:49 2018 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Aug 21 21:36:23 2018 +0200

    CreateFont from LogicalFontInstance instead of FontSelectPattern
    
    Change-Id: I75e5dc2934a208c30be18b3ce3b033059fdf1164
    Reviewed-on: https://gerrit.libreoffice.org/59373
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/inc/unx/freetype_glyphcache.hxx b/vcl/inc/unx/freetype_glyphcache.hxx
index 57c9f02df2ad..b1db824ccdd3 100644
--- a/vcl/inc/unx/freetype_glyphcache.hxx
+++ b/vcl/inc/unx/freetype_glyphcache.hxx
@@ -97,7 +97,7 @@ public:
     void                AnnounceFonts( PhysicalFontCollection* ) const;
     void                ClearFontList();
 
-    FreetypeFont* CreateFont( const FontSelectPattern& );
+    FreetypeFont* CreateFont(LogicalFontInstance* pLogicalFont);
 
 private:
     typedef std::unordered_map<sal_IntPtr, std::unique_ptr<FreetypeFontInfo>> FontList;
diff --git a/vcl/inc/unx/glyphcache.hxx b/vcl/inc/unx/glyphcache.hxx
index 03571c3ee4e4..a7c49797bc48 100644
--- a/vcl/inc/unx/glyphcache.hxx
+++ b/vcl/inc/unx/glyphcache.hxx
@@ -118,7 +118,7 @@ private:
 class VCL_DLLPUBLIC FreetypeFont final
 {
 public:
-                            FreetypeFont( const FontSelectPattern&, FreetypeFontInfo* );
+                            FreetypeFont(LogicalFontInstance* pFontInstance, FreetypeFontInfo*);
                             ~FreetypeFont();
 
     const OString&          GetFontFileName() const;
diff --git a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
index c747da4dae18..da5d6e650ed6 100644
--- a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
+++ b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
@@ -327,13 +327,13 @@ void FreetypeManager::ClearFontList( )
     maFontList.clear();
 }
 
-FreetypeFont* FreetypeManager::CreateFont( const FontSelectPattern& rFSD )
+FreetypeFont* FreetypeManager::CreateFont(LogicalFontInstance* pFontInstance)
 {
     // find a FontInfo matching to the font id
-    if (!rFSD.mpFontInstance)
+    if (!pFontInstance)
         return nullptr;
 
-    const PhysicalFontFace* pFontFace = rFSD.mpFontInstance->GetFontFace();
+    const PhysicalFontFace* pFontFace = pFontInstance->GetFontFace();
     if (!pFontFace)
         return nullptr;
 
@@ -344,7 +344,7 @@ FreetypeFont* FreetypeManager::CreateFont( const FontSelectPattern& rFSD )
     if (!pFontInfo)
         return nullptr;
 
-    return new FreetypeFont(rFSD, pFontInfo);
+    return new FreetypeFont(pFontInstance, pFontInfo);
 }
 
 FreetypeFontFace::FreetypeFontFace( FreetypeFontInfo* pFI, const FontAttributes& rDFA )
@@ -360,9 +360,9 @@ rtl::Reference<LogicalFontInstance> FreetypeFontFace::CreateFontInstance(const F
 
 // FreetypeFont
 
-FreetypeFont::FreetypeFont( const FontSelectPattern& rFSD, FreetypeFontInfo* pFI )
+FreetypeFont::FreetypeFont(LogicalFontInstance* pFontInstance, FreetypeFontInfo* pFI )
 :   maGlyphList( 0),
-    mpFontInstance(static_cast<FreetypeFontInstance*>(rFSD.mpFontInstance.get())),
+    mpFontInstance(static_cast<FreetypeFontInstance*>(pFontInstance)),
     mnRefCount(1),
     mnBytesUsed( sizeof(FreetypeFont) ),
     mpPrevGCFont( nullptr ),
@@ -385,6 +385,8 @@ FreetypeFont::FreetypeFont( const FontSelectPattern& rFSD, FreetypeFontInfo* pFI
 
     maFaceFT = pFI->GetFaceFT();
 
+    const FontSelectPatternAttributes& rFSD = pFontInstance->GetFontSelectPattern();
+
     if( rFSD.mnOrientation != 0 )
     {
         const double dRad = rFSD.mnOrientation * ( F_2PI / 3600.0 );
diff --git a/vcl/unx/generic/glyphs/glyphcache.cxx b/vcl/unx/generic/glyphs/glyphcache.cxx
index 908f570a1c9d..321707a97535 100644
--- a/vcl/unx/generic/glyphs/glyphcache.cxx
+++ b/vcl/unx/generic/glyphs/glyphcache.cxx
@@ -192,7 +192,7 @@ FreetypeFont* GlyphCache::CacheFont( const FontSelectPattern& rFontSelData )
     // font not cached yet => create new font item
     FreetypeFont* pNew = nullptr;
     if( mpFtManager )
-        pNew = mpFtManager->CreateFont( rFontSelData );
+        pNew = mpFtManager->CreateFont(rFontSelData.mpFontInstance.get());
 
     if( pNew )
     {


More information about the Libreoffice-commits mailing list