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/painting/qpaintengine_raster.cpp | |
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/painting/qpaintengine_raster.cpp')
-rw-r--r-- | src/gui/painting/qpaintengine_raster.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 9749244..c92d291 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -3164,10 +3164,8 @@ void QRasterPaintEngine::drawGlyphsS60(const QPointF &p, const QTextItemInt &ti) const TUint8 *glyphBitmapBytes; TSize glyphBitmapSize; fe->getCharacterData(glyphs[i], tmetrics, glyphBitmapBytes, glyphBitmapSize); - const glyph_metrics_t metrics = ti.fontEngine->boundingBox(glyphs[i]); - const int x = qFloor(positions[i].x + metrics.x + aliasDelta); - const int y = qFloor(positions[i].y + metrics.y + aliasDelta); - + const int x = qFloor(positions[i].x + tmetrics.HorizBearingX() + aliasDelta); + const int y = qFloor(positions[i].y - tmetrics.HorizBearingY() + aliasDelta); alphaPenBlt(glyphBitmapBytes, glyphBitmapSize.iWidth, 8, x, y, glyphBitmapSize.iWidth, glyphBitmapSize.iHeight); } |