summaryrefslogtreecommitdiffstats
path: root/src/testlib/qtestcase.qdoc
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2020-10-28 09:08:11 +0100
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2020-10-29 07:06:50 +0100
commita332f3fabc29f796526202648eddf35a24f1cb67 (patch)
tree42115c05a1339fceb8fa2fa210ddb7cbd3916eab /src/testlib/qtestcase.qdoc
parentb75d60abd2012d78387ec0751e205aef970a024b (diff)
Fix delay first time a font is used
Since 066daf750fcffff8eeae4d5749607501b9aa9a2f, we would mistakenly populate the fallback list for all ensureAt(index) calls, even when index == 0. This index indicates the main font, is always valid and does not require knowledge of any fallbacks. On Windows (and other platforms where QPlatformDatabase::fallbacksForFamily() is used) this would cause all fonts on the system to be loaded and should only be done when we actually need one of the fallbacks. With the GDI font database, in which font loading is slow because we have to manually read font data, this is especially bad. If we can later move to using DirectWrite for this, we should be able to improve on it, but in any case there is no need to pay the cost of the fallbacks when the application is just using the fonts it has selected (memory-wise this is also a bad idea). On my machine a simple text layout went from 370 ms to 37 ms. [ChangeLog][Text] Fixed an issue where on some platforms, there would be a delay the first time any font was used, sometimes causing a visible delay in the UI. Fixes: QTBUG-71737 Pick-to: 5.15 Change-Id: Ie8ce9b73f02a0e5cf39a2b280968b89f4caaf39e Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Diffstat (limited to 'src/testlib/qtestcase.qdoc')
0 files changed, 0 insertions, 0 deletions