From 39e023b805cf2be207ef7086f6951e789e020bda Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Mon, 26 Oct 2015 15:20:41 +0100 Subject: Remove historical +4 padding in QFontEngine::alphaMapForGlyph() Back in the old days, we would pad the output from the font engines to work around problems with the GL1 paint engine such as issues with linear sampling, etc. This is no longer needed. Padding is moved into the glyph cache, and in addition to reducing performance, the extra padding is also making alphaMapForGlyph() and alphaMapBoundingBox() fall out of sync when you fall back to QPainterPath drawing the glyph. The result of this was that, when prepared, the glyph cache was sometimes not made large enough to hold what alphaMapForGlyph() actually produced, depending on the size and order of glyphs, and glyphs ending up at the end of rows would sometimes be missing from the output. [ChangeLog][Text] Fixed some instances of missing glyphs when drawing large fonts. Change-Id: Ia5982392fe1637f6ebc740db9f226fbb91f75166 Task-number: QTBUG-47547 Reviewed-by: Gunnar Sletta Reviewed-by: Konstantin Ritt --- src/gui/text/qfontengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui/text/qfontengine.cpp') diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp index 6567859a5b..a0eedee6b9 100644 --- a/src/gui/text/qfontengine.cpp +++ b/src/gui/text/qfontengine.cpp @@ -961,7 +961,7 @@ QImage QFontEngine::alphaMapForGlyph(glyph_t glyph) pt.y = -glyph_y; // the baseline QPainterPath path; path.setFillRule(Qt::WindingFill); - QImage im(glyph_width + 4, glyph_height, QImage::Format_ARGB32_Premultiplied); + QImage im(glyph_width, glyph_height, QImage::Format_ARGB32_Premultiplied); im.fill(Qt::transparent); QPainter p(&im); p.setRenderHint(QPainter::Antialiasing); -- cgit v1.2.3