diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-08-21 08:38:57 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-08-22 00:24:15 +0200 |
commit | b10c8f3fce37d72019f4767fdb9612b46845aecd (patch) | |
tree | b6a74975522b301cb9892021a32135ee75bf7a2d /vcl/inc/unx | |
parent | 4790dd4d957827f9b2eeffe23ce1a8d63635df0d (diff) |
turn the cache around to work on LogicalFontInstance
instead of a FontSelectPattern with an associated LogicalFontInstance
use a LogicalFontInstance with owned FontSelectPatternAttributes
Change-Id: I939f84731fcb8db5ff6484dcfbd2f9199bb50d23
Reviewed-on: https://gerrit.libreoffice.org/59388
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/inc/unx')
-rw-r--r-- | vcl/inc/unx/cairotextrender.hxx | 4 | ||||
-rw-r--r-- | vcl/inc/unx/fontmanager.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/unx/freetype_glyphcache.hxx | 6 | ||||
-rw-r--r-- | vcl/inc/unx/genpspgraphics.h | 2 | ||||
-rw-r--r-- | vcl/inc/unx/glyphcache.hxx | 8 | ||||
-rw-r--r-- | vcl/inc/unx/salgdi.h | 4 |
6 files changed, 13 insertions, 13 deletions
diff --git a/vcl/inc/unx/cairotextrender.hxx b/vcl/inc/unx/cairotextrender.hxx index 707bec9a0bf7..8d18836be91b 100644 --- a/vcl/inc/unx/cairotextrender.hxx +++ b/vcl/inc/unx/cairotextrender.hxx @@ -42,7 +42,7 @@ protected: virtual void getSurfaceOffset(double& nDX, double& nDY) = 0; virtual void releaseCairoContext(cairo_t* cr) = 0; - void setFont( LogicalFontInstance *pEntry, int nFallbackLevel ); + void setFont(LogicalFontInstance *pEntry, int nFallbackLevel); virtual void clipRegion(cairo_t* cr) = 0; @@ -51,7 +51,7 @@ public: virtual void SetTextColor( Color nColor ) override; - virtual void SetFont( LogicalFontInstance*, int nFallbackLevel ) override; + virtual void SetFont(LogicalFontInstance*, int nFallbackLevel) override; virtual void GetFontMetric( ImplFontMetricDataRef&, int nFallbackLevel ) override; virtual const FontCharMapRef GetFontCharMap() const override; virtual bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const override; diff --git a/vcl/inc/unx/fontmanager.hxx b/vcl/inc/unx/fontmanager.hxx index bdd2c9e1a850..bd05ec1b4ce9 100644 --- a/vcl/inc/unx/fontmanager.hxx +++ b/vcl/inc/unx/fontmanager.hxx @@ -44,7 +44,7 @@ class FontSubsetInfo; class FontConfigFontOptions; -class FontSelectPattern; +class FontSelectPatternAttributes; class GenericUnixSalData; namespace psp { diff --git a/vcl/inc/unx/freetype_glyphcache.hxx b/vcl/inc/unx/freetype_glyphcache.hxx index b1db824ccdd3..2f09f3069465 100644 --- a/vcl/inc/unx/freetype_glyphcache.hxx +++ b/vcl/inc/unx/freetype_glyphcache.hxx @@ -114,21 +114,21 @@ private: public: FreetypeFontFace( FreetypeFontInfo*, const FontAttributes& ); - virtual rtl::Reference<LogicalFontInstance> CreateFontInstance( const FontSelectPattern& ) const override; + virtual rtl::Reference<LogicalFontInstance> CreateFontInstance( const FontSelectPatternAttributes& ) const override; virtual sal_IntPtr GetFontId() const override { return mpFreetypeFontInfo->GetFontId(); } }; // a class for cache entries for physical font instances that are based on serverfonts class VCL_DLLPUBLIC FreetypeFontInstance : public LogicalFontInstance { - friend rtl::Reference<LogicalFontInstance> FreetypeFontFace::CreateFontInstance(const FontSelectPattern&) const; + friend rtl::Reference<LogicalFontInstance> FreetypeFontFace::CreateFontInstance(const FontSelectPatternAttributes&) const; FreetypeFont* mpFreetypeFont; virtual hb_font_t* ImplInitHbFont() override; protected: - explicit FreetypeFontInstance(const PhysicalFontFace& rPFF, const FontSelectPattern& rFSP); + explicit FreetypeFontInstance(const PhysicalFontFace& rPFF, const FontSelectPatternAttributes& rFSP); public: virtual ~FreetypeFontInstance() override; diff --git a/vcl/inc/unx/genpspgraphics.h b/vcl/inc/unx/genpspgraphics.h index ecd4ce9a11d9..fd06248ff19f 100644 --- a/vcl/inc/unx/genpspgraphics.h +++ b/vcl/inc/unx/genpspgraphics.h @@ -83,7 +83,7 @@ public: virtual void SetROPFillColor( SalROPColor nROPColor ) override; virtual void SetTextColor( Color nColor ) override; - virtual void SetFont( LogicalFontInstance*, int nFallbackLevel ) override; + virtual void SetFont(LogicalFontInstance*, int nFallbackLevel) override; virtual void GetFontMetric( ImplFontMetricDataRef&, int nFallbackLevel ) override; virtual const FontCharMapRef GetFontCharMap() const override; virtual bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const override; diff --git a/vcl/inc/unx/glyphcache.hxx b/vcl/inc/unx/glyphcache.hxx index a7c49797bc48..2d1caf537b9c 100644 --- a/vcl/inc/unx/glyphcache.hxx +++ b/vcl/inc/unx/glyphcache.hxx @@ -65,7 +65,7 @@ public: void AnnounceFonts( PhysicalFontCollection* ) const; - FreetypeFont* CacheFont( const FontSelectPattern& ); + FreetypeFont* CacheFont(LogicalFontInstance* pFontInstance); void UncacheFont( FreetypeFont& ); void ClearFontCache(); void InvalidateAllGlyphs(); @@ -83,9 +83,9 @@ private: // the GlyphCache's FontList matches a font request to a serverfont instance // the FontList key's mpFontData member is reinterpreted as integer font id - struct IFSD_Equal{ bool operator()( const FontSelectPattern&, const FontSelectPattern& ) const; }; - struct IFSD_Hash{ size_t operator()( const FontSelectPattern& ) const; }; - typedef std::unordered_map<FontSelectPattern,std::unique_ptr<FreetypeFont>,IFSD_Hash,IFSD_Equal > FontList; + struct IFSD_Equal{ bool operator()( const rtl::Reference<LogicalFontInstance>&, const rtl::Reference<LogicalFontInstance>& ) const; }; + struct IFSD_Hash{ size_t operator()( const rtl::Reference<LogicalFontInstance>& ) const; }; + typedef std::unordered_map<rtl::Reference<LogicalFontInstance>,std::unique_ptr<FreetypeFont>,IFSD_Hash,IFSD_Equal > FontList; FontList maFontList; sal_uLong mnMaxSize; // max overall cache size in bytes diff --git a/vcl/inc/unx/salgdi.h b/vcl/inc/unx/salgdi.h index 5bca1ae938c7..057d1953caab 100644 --- a/vcl/inc/unx/salgdi.h +++ b/vcl/inc/unx/salgdi.h @@ -43,7 +43,7 @@ typedef unsigned long Pixel; class FontAttributes; -class FontSelectPattern; +class FontSelectPatternAttributes; class SalBitmap; class SalColormap; class SalDisplay; @@ -115,7 +115,7 @@ public: virtual void SetROPFillColor( SalROPColor nROPColor ) override; virtual void SetTextColor( Color nColor ) override; - virtual void SetFont( LogicalFontInstance*, int nFallbackLevel ) override; + virtual void SetFont(LogicalFontInstance*, int nFallbackLevel) override; virtual void GetFontMetric( ImplFontMetricDataRef&, int nFallbackLevel ) override; virtual const FontCharMapRef GetFontCharMap() const override; virtual bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const override; |