diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2017-12-26 15:58:21 +0100 |
---|---|---|
committer | Khaled Hosny <khaledhosny@eglug.org> | 2018-05-07 23:03:37 +0200 |
commit | 083b7ca26bbf4b9bad2922520caaf5c0227dac5e (patch) | |
tree | b33576cd90c64cb2ede5ab1a930b11828f110105 /vcl/inc/impfontcache.hxx | |
parent | 1ca1886d46f38a0759ab466e6a4a8c3c0866c523 (diff) |
Move PhysicalFontFace member of FontSelectPattern
A FontSelectPattern describes a general font request. It can be
used to find the best matching LogicalFontInstance. The instance
will be created based on a PhysicalFontFace, which is really a
factory since commit 8b700794b2746070814e9ff416ecd7bbb1c902e7.
Following this workflow, this moves the PhysicalFontFace pointer
to the instance and makes it constant.
Which leaves some special symbol font handling code in the hash
and instance lookup code path. It used to query the font face
directly from the instance.
I'm not sure of the correct handling. The related commits where
made to fix #i89002#, which has an attached test document.
1. commit 849f618270da313f9339dda29a9f35938434c91d
2. commit 8c9823d311fdf8092cc75873e4565325d204a658
The document is as broken as it was before the patch. The symbol
substitution still works, but the 'Q's are missing when displaying
a symbol font.
I also don't understand all the reinterpret_casts for fake font
ids. I guess this was used to prevent the crashes I see, where a
PhysicalFontFace referenced in a valid LogicalFontInstance is
freed and a later FontId check in the GlyphCache crashes. So this
now checks for a valid cache instead.
Change-Id: If8ee5a6288e66cfa4c419289fbdd5b5da128c6ea
Reviewed-on: https://gerrit.libreoffice.org/47279
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
Diffstat (limited to 'vcl/inc/impfontcache.hxx')
-rw-r--r-- | vcl/inc/impfontcache.hxx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/vcl/inc/impfontcache.hxx b/vcl/inc/impfontcache.hxx index c5c7a4718d19..a99283fb300e 100644 --- a/vcl/inc/impfontcache.hxx +++ b/vcl/inc/impfontcache.hxx @@ -35,9 +35,10 @@ class ImplFontCache { // For access to Acquire and Release friend class LogicalFontInstance; + private: - LogicalFontInstance* mpFirstEntry; - int mnRef0Count; // number of unreferenced LogicalFontInstances + LogicalFontInstance* mpLastHitCacheEntry; ///< keeps the last hit cache entry + int mnRef0Count; ///< number of unreferenced LogicalFontInstances // cache of recently used font instances struct IFSD_Equal { bool operator()( const FontSelectPattern&, const FontSelectPattern& ) const; }; @@ -53,13 +54,14 @@ private: /// Decrease the refcount and potentially cleanup the entries with zero refcount from the cache. void Release(LogicalFontInstance*); + LogicalFontInstance* GetFontInstance(PhysicalFontCollection const*, FontSelectPattern&); + public: ImplFontCache(); ~ImplFontCache(); LogicalFontInstance* GetFontInstance( PhysicalFontCollection const *, const vcl::Font&, const Size& rPixelSize, float fExactHeight); - LogicalFontInstance* GetFontInstance( PhysicalFontCollection const *, FontSelectPattern& ); LogicalFontInstance* GetGlyphFallbackFont( PhysicalFontCollection const *, FontSelectPattern&, int nFallbackLevel, OUString& rMissingCodes ); |