summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qpaintengine_raster.cpp
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2011-05-18 13:10:40 (GMT)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2011-05-18 13:52:09 (GMT)
commit0aa9b30432cec3b7f366983f451fc9a7f8f83243 (patch)
tree8e5ff8220f5f68e3e719276dcb727750136b539d /src/gui/painting/qpaintengine_raster.cpp
parent67d275542464c794ec4b650f10cca9a17e10c977 (diff)
downloadQt-0aa9b30432cec3b7f366983f451fc9a7f8f83243.zip
Qt-0aa9b30432cec3b7f366983f451fc9a7f8f83243.tar.gz
Qt-0aa9b30432cec3b7f366983f451fc9a7f8f83243.tar.bz2
Fall back to using paths for large fonts in drawStaticText()
QStaticText had an implicit risk which meant you had to make sure the text size did not grow unreasonably large. This was intended to avoid hiding the performance impact of using QStaticText for such a purpose, but it's too inconvenient. Thus, the same fall back as in drawTextItem() has been introduced. This will also fix a bug recently introduced when we started using the FT cache to draw static text in the raster engine, since this will fail for large fonts. Task-number: QTBUG-19084, QTBUG-19370 Reviewed-by: Jiang Jiang
Diffstat (limited to 'src/gui/painting/qpaintengine_raster.cpp')
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index f0bc0d6..4f8af48 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -3029,8 +3029,16 @@ void QRasterPaintEngine::drawStaticTextItem(QStaticTextItem *textItem)
ensurePen();
ensureState();
- drawCachedGlyphs(textItem->numGlyphs, textItem->glyphs, textItem->glyphPositions,
- textItem->fontEngine());
+ QRasterPaintEngineState *s = state();
+
+ QFontEngine *fontEngine = textItem->fontEngine();
+ const qreal pixelSize = fontEngine->fontDef.pixelSize;
+ if (pixelSize * pixelSize * qAbs(s->matrix.determinant()) < 64 * 64) {
+ drawCachedGlyphs(textItem->numGlyphs, textItem->glyphs, textItem->glyphPositions,
+ fontEngine);
+ } else {
+ QPaintEngineEx::drawStaticTextItem(textItem);
+ }
}
/*!