From 92fb7e405a93785af162e5dff0a6b2a2d40060bc Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 12 Oct 2010 16:27:31 +0200 Subject: 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 --- src/gui/text/qfontengine_s60.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/gui/text/qfontengine_s60.cpp') diff --git a/src/gui/text/qfontengine_s60.cpp b/src/gui/text/qfontengine_s60.cpp index 824a8e233e..3705136147 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; } } -- cgit v1.2.3