From 6d4ef0ff8fd30e5f50f6f770d651a51584e5cfdc Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 15 Mar 2011 09:39:13 +0100 Subject: Fix grayscale antialiasing with DirectWrite engine The code that converted DirectWrite's output to grayscale in alphaMapForGlyph() had a bunch of copy-paste errors and had obviously not been tested properly. We invert the input to the gamma function to get the right curve and then invert the output back. See windows font engine for comparison. Reviewed-by: Jiang Jiang --- src/gui/text/qfontenginedirectwrite.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/gui/text/qfontenginedirectwrite.cpp b/src/gui/text/qfontenginedirectwrite.cpp index 23fff0d..af5bab2 100644 --- a/src/gui/text/qfontenginedirectwrite.cpp +++ b/src/gui/text/qfontenginedirectwrite.cpp @@ -485,12 +485,7 @@ QImage QFontEngineDirectWrite::alphaMapForGlyph(glyph_t glyph, QFixed subPixelPo uint *src = (uint*) im.scanLine(y); uchar *dst = indexed.scanLine(y); for (int x=0; x