[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>
This commit is contained in:
Konstantin Ritt 2014-11-24 10:03:54 +04:00
parent bfc3d41894
commit 40ebda3efb

View File

@ -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);