diff options
author | Alessandro Portale <alessandro.portale@nokia.com> | 2010-10-12 12:00:38 (GMT) |
---|---|---|
committer | Alessandro Portale <alessandro.portale@nokia.com> | 2010-10-12 12:01:45 (GMT) |
commit | ab057be7228d20d909246183505b72e821cc440f (patch) | |
tree | 9f122c47e47c8ca0c74e4dd05ac4e780862054cd /src/gui/text | |
parent | 61d23b1740780b3c7970c9dd5d089002a35f339e (diff) | |
download | Qt-ab057be7228d20d909246183505b72e821cc440f.zip Qt-ab057be7228d20d909246183505b72e821cc440f.tar.gz Qt-ab057be7228d20d909246183505b72e821cc440f.tar.bz2 |
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')
-rw-r--r-- | src/gui/text/qfontengine_s60.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/gui/text/qfontengine_s60.cpp b/src/gui/text/qfontengine_s60.cpp index 653965e..32fcb82 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 ); |