diff options
author | Alessandro Portale <alessandro.portale@nokia.com> | 2010-10-12 14:27:31 (GMT) |
---|---|---|
committer | Alessandro Portale <alessandro.portale@nokia.com> | 2010-10-12 14:28:33 (GMT) |
commit | 92fb7e405a93785af162e5dff0a6b2a2d40060bc (patch) | |
tree | 822650654f6c0adaedc8ee5f46ff4bd9fdba6cd2 /src | |
parent | e39f273b921a36b307b2b2adddd7135f0c5a8858 (diff) | |
download | Qt-92fb7e405a93785af162e5dff0a6b2a2d40060bc.zip Qt-92fb7e405a93785af162e5dff0a6b2a2d40060bc.tar.gz Qt-92fb7e405a93785af162e5dff0a6b2a2d40060bc.tar.bz2 |
Optimize QFontEngineS60::recalcAdvances()
(Addition to ab057be7228d20d909246183505b72e821cc440f)
Instead of using a glyph_metrics_t (which gets filled with
data from a TOpenFontCharMetrics), we use a
TOpenFontCharMetrics, directly.
Also, the advances_y gets set to 0. Like on the other
platforms.
These change increases the Fps in
qt\tests\manual\textrendering\textperformance "Latin" from 16.5 to
16.6 Fps on an XM5800. I am sure that I can construct a benchmark
where the speed gain is bigger.
Task-number: QTBUG-14378
Reviewed-by: TrustMe
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/text/qfontengine_s60.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gui/text/qfontengine_s60.cpp b/src/gui/text/qfontengine_s60.cpp index 824a8e2..3705136 100644 --- a/src/gui/text/qfontengine_s60.cpp +++ b/src/gui/text/qfontengine_s60.cpp @@ -303,10 +303,13 @@ bool QFontEngineS60::stringToCMap(const QChar *characters, int len, QGlyphLayout void QFontEngineS60::recalcAdvances(QGlyphLayout *glyphs, QTextEngine::ShaperFlags flags) const { Q_UNUSED(flags); + TOpenFontCharMetrics metrics; + const TUint8 *glyphBitmapBytes; + TSize glyphBitmapSize; for (int i = 0; i < glyphs->numGlyphs; i++) { - const glyph_metrics_t bbox = boundingBox_const(glyphs->glyphs[i]); - glyphs->advances_x[i] = bbox.xoff; - glyphs->advances_y[i] = bbox.yoff; + getCharacterData(glyphs->glyphs[i], metrics, glyphBitmapBytes, glyphBitmapSize); + glyphs->advances_x[i] = metrics.HorizAdvance(); + glyphs->advances_y[i] = 0; } } |