From 3cdbe0c7bc42f5f3bcb8c2f6d93cbb4d20c720e2 Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Fri, 1 Apr 2011 17:07:18 +0200 Subject: Fix positioning in GL2 paint engine with subpixel antialiasing In this case we will use QTextureGlyphCache with FreeType renderer, which requires the subpixel positition to get correct left bearings, thus alphaMapBoundingBox is extended to support subPixelPosition. In QFontEngineFT we also simplify the code a bit by reusing loadGlyphs for metrics calculation instead of duplicate code. Since we need to use the glyphs after all, cache them here in alphaMapBoundingBox shouldn't be a problem. Reviewed-by: Eskil --- src/gui/painting/qtextureglyphcache.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui/painting') diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp index 727852d9b3..53f025f819 100644 --- a/src/gui/painting/qtextureglyphcache.cpp +++ b/src/gui/painting/qtextureglyphcache.cpp @@ -168,7 +168,7 @@ bool QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const continue; if (listItemCoordinates.contains(GlyphAndSubPixelPosition(glyph, subPixelPosition))) continue; - glyph_metrics_t metrics = fontEngine->alphaMapBoundingBox(glyph, m_transform, format); + glyph_metrics_t metrics = fontEngine->alphaMapBoundingBox(glyph, subPixelPosition, m_transform, format); #ifdef CACHE_DEBUG printf("(%4x): w=%.2f, h=%.2f, xoff=%.2f, yoff=%.2f, x=%.2f, y=%.2f\n", -- cgit v1.2.3