summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>2015-12-14 18:06:54 +0100
committerKonstantin Ritt <ritt.ks@gmail.com>2015-12-16 04:54:35 +0000
commita6ef446d4c57b8f3d8a4f4dd85e98baba1583b2d (patch)
tree80eea2e90a02b2f48ac8682df0f772ef6c28f765 /src/plugins/platforms
parent44c6c3ae27183daea033bf8ef108606e24a8b9ee (diff)
DirectWrite: Fix clipping bug with grayscale AA rendering
The code is using the same rasterizer for A8 and A32 glyphs, in the former case it's just converting to grayscale afterwards. Therefore, we need to pad the glyph cache with the same number of pixels for both cases. [ChangeLog][Windows][DirectWrite] Fixed clipping bug when rendering unhinted text with grayscale antialiasing. Task-number: QTBUG-49562 Change-Id: If85ff768451116278f6d2ccd1e77b5ce0664087d Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp b/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp
index 593ac7d810..2cd00d7b81 100644
--- a/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp
+++ b/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp
@@ -487,7 +487,7 @@ qreal QWindowsFontEngineDirectWrite::maxCharWidth() const
QImage QWindowsFontEngineDirectWrite::alphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition)
{
- QImage im = imageForGlyph(glyph, subPixelPosition, 0, QTransform());
+ QImage im = alphaRGBMapForGlyph(glyph, subPixelPosition, QTransform());
QImage alphaMap(im.width(), im.height(), QImage::Format_Alpha8);
@@ -709,9 +709,9 @@ QString QWindowsFontEngineDirectWrite::fontNameSubstitute(const QString &familyN
glyph_metrics_t QWindowsFontEngineDirectWrite::alphaMapBoundingBox(glyph_t glyph, QFixed pos, const QTransform &matrix, GlyphFormat format)
{
Q_UNUSED(pos);
- int margin = 0;
- if (format == QFontEngine::Format_A32 || format == QFontEngine::Format_ARGB)
- margin = glyphMargin(QFontEngine::Format_A32);
+ Q_UNUSED(format);
+
+ int margin = glyphMargin(QFontEngine::Format_A32);
glyph_metrics_t gm = QFontEngine::boundingBox(glyph, matrix);
gm.width += margin * 2;
gm.height += margin * 2;