From 2c3eaa7b87219d24facfe81a5b22cb218324f1ae Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 27 Dec 2019 18:01:49 +0100 Subject: Fix semi-transparent text on Linux with subpixel anti-aliasing The newly optimized rgbBlend function wasn't updated to handle SourceOver compositing when dealing with semi-transparent text color. The extra composition isn't SIMD optimized but short-cut for all opaque colors. Fixes: QTBUG-80982 Change-Id: I88c1e60fd5e80a8c7f9e6b0e7de8248c7c00ebc2 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/painting/qdrawhelper.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index e8d129d047..f8d5914f37 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -6048,7 +6048,11 @@ static inline void alphargbblend_argb32(quint32 *dst, uint coverage, const QRgba // Give up and do a naive gray alphablend. Needed to deal with ARGB32 and invalid ARGB32_premultiplied, see QTBUG-60571 blend_pixel(*dst, src, qRgbAvg(coverage)); } else if (!colorProfile) { - *dst = rgbBlend(*dst, src, coverage); + // First do naive blend with text-color + QRgb s = *dst; + blend_pixel(s, src); + // Then a naive blend with glyph shape + *dst = rgbBlend(*dst, s, coverage); } else if (srcLinear.isOpaque()) { rgbBlendPixel(dst, coverage, srcLinear, colorProfile); } else { -- cgit v1.2.3