diff options
-rw-r--r-- | src/gui/painting/qtextureglyphcache.cpp | 10 | ||||
-rw-r--r-- | src/gui/painting/qtextureglyphcache_p.h | 3 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp index 215eb75e32..a67cbfacc1 100644 --- a/src/gui/painting/qtextureglyphcache.cpp +++ b/src/gui/painting/qtextureglyphcache.cpp @@ -60,7 +60,8 @@ bool QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const glyph_t *glyphs, const QFixedPoint *positions, - QPainter::RenderHints renderHints) + QPainter::RenderHints renderHints, + bool includeGlyphCacheScale) { #ifdef CACHE_DEBUG printf("Populating with %d glyphs\n", numGlyphs); @@ -89,6 +90,9 @@ bool QTextureGlyphCache::populate(QFontEngine *fontEngine, m_cy = padding; } + qreal glyphCacheScaleX = transform().m11(); + qreal glyphCacheScaleY = transform().m22(); + QHash<GlyphAndSubPixelPosition, Coord> listItemCoordinates; int rowHeight = 0; @@ -99,6 +103,10 @@ bool QTextureGlyphCache::populate(QFontEngine *fontEngine, QFixedPoint subPixelPosition; if (supportsSubPixelPositions) { QFixedPoint pos = positions != nullptr ? positions[i] : QFixedPoint(); + if (includeGlyphCacheScale) { + pos = QFixedPoint(QFixed::fromReal(pos.x.toReal() * glyphCacheScaleX), + QFixed::fromReal(pos.y.toReal() * glyphCacheScaleY)); + } subPixelPosition = fontEngine->subPixelPositionFor(pos); if (!verticalSubPixelPositions) subPixelPosition.y = 0; diff --git a/src/gui/painting/qtextureglyphcache_p.h b/src/gui/painting/qtextureglyphcache_p.h index bf6b07f36f..4c18b30285 100644 --- a/src/gui/painting/qtextureglyphcache_p.h +++ b/src/gui/painting/qtextureglyphcache_p.h @@ -78,7 +78,8 @@ public: int numGlyphs, const glyph_t *glyphs, const QFixedPoint *positions, - QPainter::RenderHints renderHints = QPainter::RenderHints()); + QPainter::RenderHints renderHints = QPainter::RenderHints(), + bool includeGlyphCacheScale = false); bool hasPendingGlyphs() const { return !m_pendingGlyphs.isEmpty(); } void fillInPendingGlyphs(); |