diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index fec01afdee..2841a583d5 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -2992,7 +2992,7 @@ void QRasterPaintEngine::drawStaticTextItem(QStaticTextItem *textItem) ensureRasterState(); QFontEngine *fontEngine = textItem->fontEngine(); - if (shouldDrawCachedGlyphs(fontEngine, state()->matrix)) { + if (!supportsTransformations(fontEngine)) { drawCachedGlyphs(textItem->numGlyphs, textItem->glyphs, textItem->glyphPositions, fontEngine); } else if (state()->matrix.type() < QTransform::TxProject) { @@ -3291,7 +3291,7 @@ bool QRasterPaintEngine::supportsTransformations(QFontEngine *fontEngine) const */ bool QRasterPaintEngine::supportsTransformations(QFontEngine *fontEngine, const QTransform &m) const { - if (m.type() >= QTransform::TxProject) + if (fontEngine->supportsTransformations(m)) return true; return !shouldDrawCachedGlyphs(fontEngine, m); diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp index fa4e7a75bc..400ce8366f 100644 --- a/src/gui/text/qfontengine.cpp +++ b/src/gui/text/qfontengine.cpp @@ -268,6 +268,10 @@ QFixed QFontEngine::averageCharWidth() const return bb.xoff; } +bool QFontEngine::supportsTransformations(const QTransform &transform) const +{ + return (transform.type() >= QTransform::TxProject); +} void QFontEngine::getGlyphPositions(const QGlyphLayout &glyphs, const QTransform &matrix, QTextItem::RenderFlags flags, QVarLengthArray &glyphs_out, QVarLengthArray &positions) diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h index 745e39ecf5..3321ca3b93 100644 --- a/src/gui/text/qfontengine_p.h +++ b/src/gui/text/qfontengine_p.h @@ -241,6 +241,8 @@ public: return canRender(utf16, utf16len); } + virtual bool supportsTransformations(const QTransform &transform) const; + virtual Type type() const = 0; virtual int glyphCount() const; diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm index d413711828..1087d18891 100644 --- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm +++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm @@ -600,6 +600,11 @@ QFontEngine *QCoreTextFontEngine::cloneWithSize(qreal pixelSize) const return new QCoreTextFontEngine(cgFont, newFontDef); } +bool QCoreTextFontEngine::supportsTransformations(const QTransform &transform) const +{ + return transform.type() > QTransform::TxTranslate; +} + QT_END_NAMESPACE #endif// !defined(Q_WS_MAC) || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h b/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h index db1ebbaca1..6c5c557b13 100644 --- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h +++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h @@ -103,6 +103,8 @@ public: virtual qreal minLeftBearing() const; virtual QFixed emSquareSize() const; + bool supportsTransformations(const QTransform &transform) const; + virtual QFontEngine *cloneWithSize(qreal pixelSize) const; virtual int glyphMargin(QFontEngineGlyphCache::Type type) { Q_UNUSED(type); return 0; }