diff options
Diffstat (limited to 'src/gui/painting/qpainter.cpp')
-rw-r--r-- | src/gui/painting/qpainter.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 0811b5282f..b59a0850e8 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -1155,9 +1155,6 @@ void QPainterPrivate::updateState(QPainterState *newState) should antialias text if possible, and the \l {RenderHint}{QPainter::SmoothPixmapTransform} indicates that the engine should use a smooth pixmap transformation algorithm. - \l {RenderHint}{HighQualityAntialiasing} is an OpenGL-specific rendering hint - indicating that the engine should use fragment programs and offscreen - rendering for antialiasing. The renderHints() function returns a flag that specifies the rendering hints that are set for this painter. Use the @@ -1409,9 +1406,8 @@ void QPainterPrivate::updateState(QPainterState *newState) a smooth pixmap transformation algorithm (such as bilinear) rather than nearest neighbor. - \value HighQualityAntialiasing An OpenGL-specific rendering hint - indicating that the engine should use fragment programs and offscreen - rendering for antialiasing. + \value HighQualityAntialiasing This value is obsolete and will be ignored, + use the Antialiasing render hint instead. \value NonCosmeticDefaultPen This value is obsolete, the default for QPen is now non-cosmetic. @@ -5552,13 +5548,13 @@ void QPainter::drawGlyphRun(const QPointF &position, const QGlyphRun &glyphRun) QVarLengthArray<QFixedPoint, 128> fixedPointPositions(count); QRawFontPrivate *fontD = QRawFontPrivate::get(font); - bool supportsTransformations = d->extended - ? d->extended->supportsTransformations(fontD->fontEngine, d->state->matrix) - : d->engine->type() == QPaintEngine::CoreGraphics || d->state->matrix.isAffine(); + bool engineRequiresPretransformedGlyphPositions = d->extended + ? d->extended->requiresPretransformedGlyphPositions(fontD->fontEngine, d->state->matrix) + : d->engine->type() != QPaintEngine::CoreGraphics && !d->state->matrix.isAffine(); for (int i=0; i<count; ++i) { QPointF processedPosition = position + glyphPositions[i]; - if (!supportsTransformations) + if (engineRequiresPretransformedGlyphPositions) processedPosition = d->state->transform().map(processedPosition); fixedPointPositions[i] = QFixedPoint::fromPointF(processedPosition); } @@ -5738,17 +5734,21 @@ void QPainter::drawStaticText(const QPointF &topLeftPosition, const QStaticText return; } - QFontEngine *fe = staticText_d->font.d->engineForScript(QUnicodeTables::Common); + QFontEngine *fe = staticText_d->font.d->engineForScript(QChar::Script_Common); if (fe->type() == QFontEngine::Multi) fe = static_cast<QFontEngineMulti *>(fe)->engine(0); - bool supportsTransformations = d->extended->supportsTransformations(fe, - d->state->matrix); - if (supportsTransformations && !staticText_d->untransformedCoordinates) { - staticText_d->untransformedCoordinates = true; - staticText_d->needsRelayout = true; - } else if (!supportsTransformations && staticText_d->untransformedCoordinates) { + + bool engineRequiresPretransform = d->extended->requiresPretransformedGlyphPositions(fe, d->state->matrix); + if (staticText_d->untransformedCoordinates && engineRequiresPretransform) { + // The coordinates are untransformed, and the engine can't deal with that + // nativly, so we have to pre-transform the static text. staticText_d->untransformedCoordinates = false; staticText_d->needsRelayout = true; + } else if (!staticText_d->untransformedCoordinates && !engineRequiresPretransform) { + // The coordinates are already transformed, but the engine can handle that + // nativly, so undo the transform of the static text. + staticText_d->untransformedCoordinates = true; + staticText_d->needsRelayout = true; } // Don't recalculate entire layout because of translation, rather add the dx and dy @@ -5845,7 +5845,7 @@ void QPainter::drawText(const QPointF &p, const QString &str, int tf, int justif int len = str.length(); int numGlyphs = len; QVarLengthGlyphLayoutArray glyphs(len); - QFontEngine *fontEngine = d->state->font.d->engineForScript(QUnicodeTables::Common); + QFontEngine *fontEngine = d->state->font.d->engineForScript(QChar::Script_Common); if (!fontEngine->stringToCMap(str.data(), len, &glyphs, &numGlyphs, 0)) { glyphs.resize(numGlyphs); if (!fontEngine->stringToCMap(str.data(), len, &glyphs, &numGlyphs, 0)) |