From ba9d9ff501cc6f0c92ffacc64b57896c25a8b301 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 25 Jul 2023 09:18:50 +0300 Subject: [PATCH] Improve performance when draw with SVG fonts. --- src/libs/vmisc/svgfont/vsvgfontdatabase.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/vmisc/svgfont/vsvgfontdatabase.cpp b/src/libs/vmisc/svgfont/vsvgfontdatabase.cpp index 8409be783..3837bf0ba 100644 --- a/src/libs/vmisc/svgfont/vsvgfontdatabase.cpp +++ b/src/libs/vmisc/svgfont/vsvgfontdatabase.cpp @@ -366,13 +366,13 @@ auto VSvgFontDatabase::QueryFont(const QString &family, SVGFontStyle style, SVGF auto VSvgFontDatabase::QueryFontEngine(const QString &family, SVGFontStyle style, SVGFontWeight weight, int pointSize) const -> VSvgFontEngine { - QByteArray hash = VSvgFont::Hash(family, style, weight); + VSvgFont font = QueryFont(family, style, weight); + QByteArray hash = font.Hash(); if (m_fontEngineCache.contains(hash)) { return {*m_fontEngineCache.object(hash)}; } - VSvgFont font = QueryFont(family, style, weight); if (font.IsValid()) { VSvgFontReader reader;