From 63eae1bd15ea8aa1e4fc460194e34ecb5fc55b3a Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Fri, 4 Nov 2011 14:47:31 +0100 Subject: Fix subpixel positioning support Move subpixelPositionForX from QTextureGlyphCache to QFontEngine, since some font engines like QFontEngineFT may need a custom implementation or tweak it a little bit. In QRasterPaintEngine::drawCachedGlyphs, do not add aliasedCoodinate to x offset as that will break subpixel positioning. Change-Id: Idbcec617509459b80965220ceb07b17737649bbf Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/painting/qtextureglyphcache_p.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/gui/painting/qtextureglyphcache_p.h') diff --git a/src/gui/painting/qtextureglyphcache_p.h b/src/gui/painting/qtextureglyphcache_p.h index bc5eebbecb..d9d57f41ab 100644 --- a/src/gui/painting/qtextureglyphcache_p.h +++ b/src/gui/painting/qtextureglyphcache_p.h @@ -81,7 +81,7 @@ class Q_GUI_EXPORT QTextureGlyphCache : public QFontEngineGlyphCache public: QTextureGlyphCache(QFontEngineGlyphCache::Type type, const QTransform &matrix) : QFontEngineGlyphCache(matrix, type), m_current_fontengine(0), - m_w(0), m_h(0), m_cx(0), m_cy(0), m_currentRowHeight(0), m_subPixelPositionCount(0) + m_w(0), m_h(0), m_cx(0), m_cy(0), m_currentRowHeight(0) { } virtual ~QTextureGlyphCache() { } @@ -146,8 +146,6 @@ public: QImage textureMapForGlyph(glyph_t g, QFixed subPixelPosition) const; - QFixed subPixelPositionForX(QFixed x) const; - protected: int calculateSubPixelPositionCount(glyph_t) const; @@ -159,7 +157,6 @@ protected: int m_cx; // current x int m_cy; // current y int m_currentRowHeight; // Height of last row - int m_subPixelPositionCount; // Number of positions within a single pixel for this cache }; inline uint qHash(const QTextureGlyphCache::GlyphAndSubPixelPosition &g) -- cgit v1.2.3