diff options
author | Konstantin Ritt <ritt.ks@gmail.com> | 2014-11-24 10:03:54 +0400 |
---|---|---|
committer | Konstantin Ritt <ritt.ks@gmail.com> | 2015-02-04 15:24:34 +0000 |
commit | 40ebda3efbcf00c3393cb70c9eee203c68a57311 (patch) | |
tree | 37874787583a9db7ef81522a6d3d78ed0f2aa55f | |
parent | bfc3d41894b054afef32b78e2d9c2c3ffe6aa5ce (diff) |
[QFontDatabase] Speed-up is(Bitmap|Smoothly)Scalable
...with hints provided by platform font database.
Namely, if database reports fontsAlwaysScalable(), then we could
simply return true in QFontDatabase::is(Bitmap|Smoothly)Scalable.
Change-Id: I7af082718e007dfdaf430d3c4852005f62efa41a
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
-rw-r--r-- | src/gui/text/qfontdatabase.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index 5a4fe2a61b..3fc23513d7 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -1552,6 +1552,9 @@ bool QFontDatabase::isFixedPitch(const QString &family, bool QFontDatabase::isBitmapScalable(const QString &family, const QString &style) const { + if (QGuiApplicationPrivate::platformIntegration()->fontDatabase()->fontsAlwaysScalable()) + return true; + bool bitmapScalable = false; QString familyName, foundryName; parseFontName(family, foundryName, familyName); @@ -1593,6 +1596,9 @@ bool QFontDatabase::isBitmapScalable(const QString &family, */ bool QFontDatabase::isSmoothlyScalable(const QString &family, const QString &style) const { + if (QGuiApplicationPrivate::platformIntegration()->fontDatabase()->fontsAlwaysScalable()) + return true; + bool smoothScalable = false; QString familyName, foundryName; parseFontName(family, foundryName, familyName); |