Return early in QRawFont::setPixelSize.

We would otherwise end up cloning the font engine for absolutely no
reason when the pixel size is already right.

Change-Id: I8c34d2b53b596ad49d00031a3fb8e79f3b30d591
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
This commit is contained in:
Pierre Rossi 2012-03-30 22:33:05 +02:00 committed by Qt by Nokia
parent f913859f88
commit db347ec2f8

View File

@ -672,7 +672,7 @@ QRawFont QRawFont::fromFont(const QFont &font, QFontDatabase::WritingSystem writ
*/
void QRawFont::setPixelSize(qreal pixelSize)
{
if (d->fontEngine == 0)
if (d->fontEngine == 0 || qFuzzyCompare(d->fontEngine->fontDef.pixelSize, pixelSize))
return;
d.detach();