Micro optimization to QPainterPrivate::drawGlyphs

Re-use font engine obtained in the first place

Change-Id: Icdc2ad404ba9b2aadf2732e95c43a47aa957a6fb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
bb10
Konstantin Ritt 2015-02-14 20:51:28 +04:00
parent 85620bd788
commit cc9ca2bece
2 changed files with 4 additions and 7 deletions

View File

@ -5565,22 +5565,19 @@ void QPainter::drawGlyphRun(const QPointF &position, const QGlyphRun &glyphRun)
fixedPointPositions[i] = QFixedPoint::fromPointF(processedPosition);
}
d->drawGlyphs(glyphIndexes, fixedPointPositions.data(), count, font, glyphRun.overline(),
glyphRun.underline(), glyphRun.strikeOut());
d->drawGlyphs(glyphIndexes, fixedPointPositions.data(), count, fontD->fontEngine,
glyphRun.overline(), glyphRun.underline(), glyphRun.strikeOut());
}
void QPainterPrivate::drawGlyphs(const quint32 *glyphArray, QFixedPoint *positions,
int glyphCount,
const QRawFont &font, bool overline, bool underline,
QFontEngine *fontEngine, bool overline, bool underline,
bool strikeOut)
{
Q_Q(QPainter);
updateState(state);
QRawFontPrivate *fontD = QRawFontPrivate::get(font);
QFontEngine *fontEngine = fontD->fontEngine;
QFixed leftMost;
QFixed rightMost;
QFixed baseLine;

View File

@ -226,7 +226,7 @@ public:
#if !defined(QT_NO_RAWFONT)
void drawGlyphs(const quint32 *glyphArray, QFixedPoint *positionArray, int glyphCount,
const QRawFont &font, bool overline = false, bool underline = false,
QFontEngine *fontEngine, bool overline = false, bool underline = false,
bool strikeOut = false);
#endif