diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2020-08-04 10:59:27 +0200 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2020-08-05 07:45:36 +0200 |
commit | 4da53ed1d6433730d0604b948ba3b5abeabd1eb0 (patch) | |
tree | 57ff0dab9b5ae0e2451539dbd68090ab41676ddc /src/quick/scenegraph/shaders_ng/outlinedtext_a.frag | |
parent | 28005c0c037626d5601192e2a412633656d52b39 (diff) |
Fix regression in antialiasing on outlined text
After e8d9bc1bcada7d94af5a33d64a9afc860ede5b84, outline text would
blend with the background rather than the fill color on the inner
side of the outline. We should do the mix with the fill color like
before this change, but for performance, we should still discard
all pixels which are not part of the outline, which we do using
step() instead of multiplying by 1.0 - a.
Pick-to: 5.15
Task-number: QTBUG-85514
Change-Id: I4b252bdbd9dae5ee599ba7c5d1cc3609fef61622
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/quick/scenegraph/shaders_ng/outlinedtext_a.frag')
-rw-r--r-- | src/quick/scenegraph/shaders_ng/outlinedtext_a.frag | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quick/scenegraph/shaders_ng/outlinedtext_a.frag b/src/quick/scenegraph/shaders_ng/outlinedtext_a.frag index 481d8c94d0..5b7bd9ca82 100644 --- a/src/quick/scenegraph/shaders_ng/outlinedtext_a.frag +++ b/src/quick/scenegraph/shaders_ng/outlinedtext_a.frag @@ -29,5 +29,5 @@ void main() texture(_qt_texture, sCoordRight).a, 0.0, 1.0) - glyph, 0.0, 1.0); - fragColor = outline * ubuf.styleColor; + fragColor = outline * ubuf.styleColor + step(1.0 - glyph, 1.0) * glyph * ubuf.color; } |