summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-10-25 11:16:47 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-10-25 15:04:17 +0200
commitd1b7d7a8d16d222536534ccf92576ed1eb05e1a8 (patch)
tree878aaa1719bb45ee27aefb265232d7ec95e92906 /vcl
parentac0e74209c4f7a7eb7702468cecd3b996227c278 (diff)
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/gdi/impglyphitem.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/vcl/source/gdi/impglyphitem.cxx b/vcl/source/gdi/impglyphitem.cxx
index 016e7c9b9b39..526df693bf3c 100644
--- a/vcl/source/gdi/impglyphitem.cxx
+++ b/vcl/source/gdi/impglyphitem.cxx
@@ -452,7 +452,7 @@ SalLayoutGlyphsCache::GetLayoutGlyphs(VclPtr<const OutputDevice> outputDevice, c
{
// TODO: Fallbacks do not work reliably (fallback font not included in the key),
// so do not cache (but still return once, using the temporary without a key set).
- if (glyphs.Impl(1) != nullptr)
+ if (!mbCacheGlyphsWhenDoingFallbackFonts && glyphs.Impl(1) != nullptr)
{
mLastTemporaryGlyphs = std::move(glyphs);
mLastTemporaryKey.reset();
@@ -469,6 +469,13 @@ SalLayoutGlyphsCache::GetLayoutGlyphs(VclPtr<const OutputDevice> outputDevice, c
return nullptr;
}
+void SalLayoutGlyphsCache::SetCacheGlyphsWhenDoingFallbackFonts(bool bOK)
+{
+ mbCacheGlyphsWhenDoingFallbackFonts = bOK;
+ if (!bOK)
+ clear();
+}
+
SalLayoutGlyphsCache::CachedGlyphsKey::CachedGlyphsKey(
const VclPtr<const OutputDevice>& outputDevice, OUString t, sal_Int32 i, sal_Int32 l,
tools::Long w)