summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>2015-10-26 15:20:41 +0100
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>2015-10-27 09:01:47 +0000
commit39e023b805cf2be207ef7086f6951e789e020bda (patch)
tree851ad290542b020a5374fd1ce659fdba9814aa95
parente0d0e4a9a28dfede54c4c0ec4c42be05bc955d95 (diff)
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 <gunnar@sletta.org> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
-rw-r--r--src/gui/text/qfontengine.cpp2
1 files changed, 1 insertions, 1 deletions
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);