summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfontengine_s60.cpp
diff options
context:
space:
mode:
authorAlessandro Portale <alessandro.portale@nokia.com>2010-10-12 14:00:38 +0200
committerAlessandro Portale <alessandro.portale@nokia.com>2010-10-12 14:01:45 +0200
commitab057be7228d20d909246183505b72e821cc440f (patch)
tree9f122c47e47c8ca0c74e4dd05ac4e780862054cd /src/gui/text/qfontengine_s60.cpp
parent61d23b1740780b3c7970c9dd5d089002a35f339e (diff)
Remove unnecessary calls to GetHorizBounds() + boundingBox()
QFontEngineS60::boundingBox_const(): The metrics that CFont::getCharacterData() returns is equivalent to what TOpenFontCharMetrics::GetHorizBounds() returns. So, remove the use of TRect glyphBounds, and TOpenFontCharMetrics::GetHorizBounds(). Implementation of TOpenFontCharMetrics::GetHorizBounds(): http://developer.symbian.org/oss/API_REF/Public_API/file/837f303aceeb/epoc32/include/openfont.h#l1352 QRasterPaintEngine::drawGlyphsS60(): The metrics that QFontEngineS60::getCharacterData() returns are equivalent to what QFontEngineS60::boundingBox() returns. So, remove the use of glyph_metrics_t metrics, and QFontEngineS60::boundingBox(). These changes increase the Fps in qt\tests\manual\textrendering\textperformance "Latin" from 16.2 to 16.5 Fps on an XM5800. And they do that by removing code :) Task-number: QTBUG-14378 Reviewed-by: Jason Barron
Diffstat (limited to 'src/gui/text/qfontengine_s60.cpp')
-rw-r--r--src/gui/text/qfontengine_s60.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/gui/text/qfontengine_s60.cpp b/src/gui/text/qfontengine_s60.cpp
index 653965e1f5..32fcb82a83 100644
--- a/src/gui/text/qfontengine_s60.cpp
+++ b/src/gui/text/qfontengine_s60.cpp
@@ -360,13 +360,11 @@ glyph_metrics_t QFontEngineS60::boundingBox_const(glyph_t glyph) const
const TUint8 *glyphBitmapBytes;
TSize glyphBitmapSize;
getCharacterData(glyph, metrics, glyphBitmapBytes, glyphBitmapSize);
- TRect glyphBounds;
- metrics.GetHorizBounds(glyphBounds);
const glyph_metrics_t result(
- glyphBounds.iTl.iX,
- glyphBounds.iTl.iY,
- glyphBounds.Width(),
- glyphBounds.Height(),
+ metrics.HorizBearingX(),
+ -metrics.HorizBearingY(),
+ metrics.Width(),
+ metrics.Height(),
metrics.HorizAdvance(),
0
);