summaryrefslogtreecommitdiff
path: root/vcl/inc
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2019-11-08 11:05:04 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-11-08 13:16:27 +0100
commit37e3573bb5739c94890c18ed11b4f4cc8a4df67f (patch)
tree443a9f42312d9ce80226f0c79582de5bd9964431 /vcl/inc
parent023285158bde72dcd73b965ce205cf8550e7a5e2 (diff)
tdf#121740 speed up font loading
by caching whether the font is a graphite font. Takes load time from 27s to 23s for me. Change-Id: I7b14a8bd305b27a088f363d19ebfb6fe774d3b02 Reviewed-on: https://gerrit.libreoffice.org/82267 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/inc')
-rw-r--r--vcl/inc/fontinstance.hxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/vcl/inc/fontinstance.hxx b/vcl/inc/fontinstance.hxx
index da5af02b1089..ed4d92e8ef57 100644
--- a/vcl/inc/fontinstance.hxx
+++ b/vcl/inc/fontinstance.hxx
@@ -30,6 +30,7 @@
#include <tools/fontenum.hxx>
#include <vcl/glyphitem.hxx>
+#include <boost/optional.hpp>
#include <unordered_map>
#include <memory>
@@ -64,6 +65,7 @@ public: // TODO: make data members private
void IgnoreFallbackForUnicode( sal_UCS4, FontWeight eWeight, const OUString& rFontName );
inline hb_font_t* GetHbFont();
+ bool IsGraphiteFont();
void SetAverageWidthFactor(double nFactor) { m_nAveWidthFactor = std::abs(nFactor); }
double GetAverageWidthFactor() const { return m_nAveWidthFactor; }
const FontSelectPattern& GetFontSelectPattern() const { return m_aFontSelData; }
@@ -100,6 +102,7 @@ private:
hb_font_t* m_pHbFont;
double m_nAveWidthFactor;
rtl::Reference<PhysicalFontFace> m_pFontFace;
+ boost::optional<bool> m_xbIsGraphiteFont;
};
inline hb_font_t* LogicalFontInstance::GetHbFont()