From d1b7d7a8d16d222536534ccf92576ed1eb05e1a8 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 25 Oct 2022 11:16:47 +0200 Subject: tdf#126788 speed up export to pdf of complex table document Shaves another 20% off the export time, bringing us to roughly the same time as before commit commit 4fc3466d23010d9553c31c662650072483b81588 Date: Thu Apr 14 09:19:35 2022 +0200 do not cache layout glyphs if fallback is involved Change-Id: Ic595d4be7b05d857f3328ec28d1ef1232203cb03 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141798 Tested-by: Jenkins Reviewed-by: Noel Grandin --- include/vcl/glyphitemcache.hxx | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/vcl/glyphitemcache.hxx b/include/vcl/glyphitemcache.hxx index 6c151ffaabaf..6c4c1ea1294b 100644 --- a/include/vcl/glyphitemcache.hxx +++ b/include/vcl/glyphitemcache.hxx @@ -57,6 +57,12 @@ public: const vcl::text::TextLayoutCache* layoutCache = nullptr); void clear(); + /// Normally, we cannot cache glyphs when doing font fallback, because the font fallbacks + /// can cache during the lifetime of the cache, and they are not included in the cache key. + /// But during some processes, we can turn this on, as long as we remember to turn it off + /// at the end. + void SetCacheGlyphsWhenDoingFallbackFonts(bool bOK); + static SalLayoutGlyphsCache* self(); SalLayoutGlyphsCache(int size) // needs to be public for vcl::DeleteOnDeinit : mCachedGlyphs(size) @@ -102,6 +108,7 @@ private: SalLayoutGlyphs mLastTemporaryGlyphs; // If set, info about the last call which wanted a substring of the full text. std::optional mLastSubstringKey; + bool mbCacheGlyphsWhenDoingFallbackFonts = false; SalLayoutGlyphsCache(const SalLayoutGlyphsCache&) = delete; SalLayoutGlyphsCache& operator=(const SalLayoutGlyphsCache&) = delete; -- cgit