diff options
author | Jiang Jiang <jiang.jiang@nokia.com> | 2011-04-01 15:07:18 (GMT) |
---|---|---|
committer | Jiang Jiang <jiang.jiang@nokia.com> | 2011-04-04 10:49:07 (GMT) |
commit | 3cdbe0c7bc42f5f3bcb8c2f6d93cbb4d20c720e2 (patch) | |
tree | a9a2940e00c9bccbf01d62e0e728336fe6e2faba /src/gui/text/qfontengine_ft_p.h | |
parent | cb705c2e3c35fa7c6d70a9348477450cddf50633 (diff) | |
download | Qt-3cdbe0c7bc42f5f3bcb8c2f6d93cbb4d20c720e2.zip Qt-3cdbe0c7bc42f5f3bcb8c2f6d93cbb4d20c720e2.tar.gz Qt-3cdbe0c7bc42f5f3bcb8c2f6d93cbb4d20c720e2.tar.bz2 |
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
Diffstat (limited to 'src/gui/text/qfontengine_ft_p.h')
-rw-r--r-- | src/gui/text/qfontengine_ft_p.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/text/qfontengine_ft_p.h b/src/gui/text/qfontengine_ft_p.h index fc3ac82..451d26e 100644 --- a/src/gui/text/qfontengine_ft_p.h +++ b/src/gui/text/qfontengine_ft_p.h @@ -257,7 +257,9 @@ private: virtual QImage alphaMapForGlyph(glyph_t g) { return alphaMapForGlyph(g, 0); } virtual QImage alphaMapForGlyph(glyph_t, QFixed); virtual QImage alphaRGBMapForGlyph(glyph_t, QFixed subPixelPosition, int margin, const QTransform &t); - virtual glyph_metrics_t alphaMapBoundingBox(glyph_t glyph, const QTransform &matrix, + virtual glyph_metrics_t alphaMapBoundingBox(glyph_t glyph, + QFixed subPixelPosition, + const QTransform &matrix, QFontEngine::GlyphFormat format); virtual void removeGlyphFromCache(glyph_t glyph); @@ -333,7 +335,6 @@ protected: bool embeddedbitmap; private: - QFontEngineFT::Glyph *loadGlyphMetrics(QGlyphSet *set, uint glyph, GlyphFormat format) const; int loadFlags(QGlyphSet *set, GlyphFormat format, int flags, bool &hsubpixel, int &vfactor) const; GlyphFormat defaultFormat; |