summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qpaintengine_raster.cpp
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2011-09-16 14:16:44 +0200
committerQt by Nokia <qt-info@nokia.com>2011-09-19 10:24:25 +0200
commit76e56fc449749909ead292f632fb7965cfa9ae78 (patch)
tree2caa3982db8a9dfe2239015fa08da98fac7f7a68 /src/gui/painting/qpaintengine_raster.cpp
parentd00017b8421fe5e16a41842a7aef4deca362fb90 (diff)
Enable glyph caching on QPA
The glyph caching was disabled on QPA, possibly due to some bugs which have gone away now. To avoid the performance hit of this, we need to enable it. Simple tests of QTextEdit indicate that this works fine. Change-Id: I40845b327331b366161f1ca55bf00853bca87358 Reviewed-on: http://codereview.qt-project.org/5096 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/gui/painting/qpaintengine_raster.cpp')
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp34
1 files changed, 3 insertions, 31 deletions
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 4d4b88b229..62701eb569 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -3031,7 +3031,7 @@ void QRasterPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textIte
ensurePen();
ensureState();
-#if defined (Q_WS_WIN) || defined(Q_WS_MAC)
+#if defined (Q_WS_WIN) || defined(Q_WS_MAC) || defined(Q_WS_QPA)
if (!supportsTransformations(ti.fontEngine)) {
QVarLengthArray<QFixedPoint> positions;
@@ -3046,45 +3046,17 @@ void QRasterPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textIte
return;
}
-#elif defined (Q_OS_SYMBIAN) && defined(QT_NO_FREETYPE) // Q_OS_WIN || Q_WS_MAC
+#elif defined (Q_OS_SYMBIAN) && defined(QT_NO_FREETYPE) // Q_OS_WIN || Q_WS_MAC || Q_WS_QPA
if (s->matrix.type() <= QTransform::TxTranslate
|| (s->matrix.type() == QTransform::TxScale
&& (qFuzzyCompare(s->matrix.m11(), s->matrix.m22())))) {
drawGlyphsS60(p, ti);
return;
}
-#else // Q_OS_WIN || Q_WS_MAC
+#else // Q_OS_WIN || Q_WS_MAC || Q_WS_QPA
QFontEngine *fontEngine = ti.fontEngine;
-#ifdef Q_WS_QPA
- if (s->matrix.type() < QTransform::TxScale) {
-
- QVarLengthArray<QFixedPoint> positions;
- QVarLengthArray<glyph_t> glyphs;
- QTransform matrix = state()->transform();
-
- qreal _x = qFloor(p.x());
- qreal _y = qFloor(p.y());
- matrix.translate(_x, _y);
-
- fontEngine->getGlyphPositions(ti.glyphs, matrix, ti.flags, glyphs, positions);
- if (glyphs.size() == 0)
- return;
-
- for(int i = 0; i < glyphs.size(); i++) {
- QImage img = fontEngine->alphaMapForGlyph(glyphs[i]);
- glyph_metrics_t metrics = fontEngine->boundingBox(glyphs[i]);
- // ### hm, perhaps an QFixed offs = QFixed::fromReal(aliasedCoordinateDelta) is needed here?
- alphaPenBlt(img.bits(), img.bytesPerLine(), img.depth(),
- qRound(positions[i].x + metrics.x),
- qRound(positions[i].y + metrics.y),
- img.width(), img.height());
- }
- return;
- }
-#endif //Q_WS_QPA
-
#if (defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)) && !defined(QT_NO_FREETYPE)
if (fontEngine->type() != QFontEngine::Freetype) {