diff options
Diffstat (limited to 'src/gui/painting')
-rw-r--r-- | src/gui/painting/qpainter.cpp | 15 | ||||
-rw-r--r-- | src/gui/painting/qpainter_p.h | 2 |
2 files changed, 10 insertions, 7 deletions
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index d2b35c8..1bd9303 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -5801,10 +5801,12 @@ void QPainter::drawGlyphRun(const QPointF &position, const QGlyphRun &glyphRun) if (!font.isValid()) return; - QVector<quint32> glyphIndexes = glyphRun.glyphIndexes(); - QVector<QPointF> glyphPositions = glyphRun.positions(); + QGlyphRunPrivate *glyphRun_d = QGlyphRunPrivate::get(glyphRun); - int count = qMin(glyphIndexes.size(), glyphPositions.size()); + const quint32 *glyphIndexes = glyphRun_d->glyphIndexData; + const QPointF *glyphPositions = glyphRun_d->glyphPositionData; + + int count = qMin(glyphRun_d->glyphIndexDataSize, glyphRun_d->glyphPositionDataSize); QVarLengthArray<QFixedPoint, 128> fixedPointPositions(count); QRawFontPrivate *fontD = QRawFontPrivate::get(font); @@ -5818,17 +5820,18 @@ void QPainter::drawGlyphRun(const QPointF &position, const QGlyphRun &glyphRun) } for (int i=0; i<count; ++i) { - QPointF processedPosition = position + glyphPositions.at(i); + QPointF processedPosition = position + glyphPositions[i]; if (!supportsTransformations) processedPosition = d->state->transform().map(processedPosition); fixedPointPositions[i] = QFixedPoint::fromPointF(processedPosition); } - d->drawGlyphs(glyphIndexes.data(), fixedPointPositions.data(), count, font, glyphRun.overline(), + d->drawGlyphs(glyphIndexes, fixedPointPositions.data(), count, font, glyphRun.overline(), glyphRun.underline(), glyphRun.strikeOut()); } -void QPainterPrivate::drawGlyphs(quint32 *glyphArray, QFixedPoint *positions, int glyphCount, +void QPainterPrivate::drawGlyphs(const quint32 *glyphArray, QFixedPoint *positions, + int glyphCount, const QRawFont &font, bool overline, bool underline, bool strikeOut) { diff --git a/src/gui/painting/qpainter_p.h b/src/gui/painting/qpainter_p.h index 35cdf86..79d4b4b 100644 --- a/src/gui/painting/qpainter_p.h +++ b/src/gui/painting/qpainter_p.h @@ -232,7 +232,7 @@ public: void drawOpaqueBackground(const QPainterPath &path, DrawOperation operation); #if !defined(QT_NO_RAWFONT) - void drawGlyphs(quint32 *glyphArray, QFixedPoint *positionArray, int glyphCount, + void drawGlyphs(const quint32 *glyphArray, QFixedPoint *positionArray, int glyphCount, const QRawFont &font, bool overline = false, bool underline = false, bool strikeOut = false); #endif |