summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
authorBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-06-18 15:04:46 (GMT)
committerBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-06-18 15:07:04 (GMT)
commitf9f08de9d41fd55d9c7d01578191ef5d4099c9e6 (patch)
treee6167fa1475a201c887f46f3b0c411f3e92d645a /src/gui/text
parent396eeb3f71c1c7edd861da1c8a8ec3086348502e (diff)
downloadQt-f9f08de9d41fd55d9c7d01578191ef5d4099c9e6.zip
Qt-f9f08de9d41fd55d9c7d01578191ef5d4099c9e6.tar.gz
Qt-f9f08de9d41fd55d9c7d01578191ef5d4099c9e6.tar.bz2
Use QTransform more efficiently.
Reviewed-by: Samuel
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/qfontengine.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp
index 25bdfd2..05b3695 100644
--- a/src/gui/text/qfontengine.cpp
+++ b/src/gui/text/qfontengine.cpp
@@ -422,8 +422,7 @@ void QFontEngine::addOutlineToPath(qreal x, qreal y, const QGlyphLayout &glyphs,
QVarLengthArray<QFixedPoint> positions;
QVarLengthArray<glyph_t> positioned_glyphs;
- QTransform matrix;
- matrix.translate(x, y);
+ QTransform matrix = QTransform::fromTranslate(x, y);
getGlyphPositions(glyphs, matrix, flags, positioned_glyphs, positions);
addGlyphsToPath(positioned_glyphs.data(), positions.data(), positioned_glyphs.size(), path, flags);
}
@@ -1151,8 +1150,7 @@ void QFontEngineBox::addOutlineToPath(qreal x, qreal y, const QGlyphLayout &glyp
QVarLengthArray<QFixedPoint> positions;
QVarLengthArray<glyph_t> positioned_glyphs;
- QTransform matrix;
- matrix.translate(x, y - _size);
+ QTransform matrix = QTransform::fromTranslate(x, y - _size);
getGlyphPositions(glyphs, matrix, flags, positioned_glyphs, positions);
QSize s(_size - 3, _size - 3);
@@ -1180,8 +1178,7 @@ void QFontEngineBox::draw(QPaintEngine *p, qreal x, qreal y, const QTextItemInt
QVarLengthArray<QFixedPoint> positions;
QVarLengthArray<glyph_t> glyphs;
- QTransform matrix;
- matrix.translate(x, y - _size);
+ QTransform matrix = QTransform::fromTranslate(x, y - _size);
ti.fontEngine->getGlyphPositions(ti.glyphs, matrix, ti.flags, glyphs, positions);
if (glyphs.size() == 0)
return;