aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/shaders_ng/distancefieldoutlinetext.frag
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2020-06-16 08:23:28 +0200
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2020-06-18 07:13:40 +0200
commit286cb9d4021f46e51162b30c4336fe52555f1756 (patch)
tree6bd0458e3e6159d3915f6a4409fc95cd29354725 /src/quick/scenegraph/shaders_ng/distancefieldoutlinetext.frag
parent90ed1ba80a610713bd0eca8377a3f0f40293cf29 (diff)
Revert accidentally changed outline shaders
The standard outline shaders were accidentally changed to use fwidth() as part of 90bf30376c94b2fcf99e2d8382b40e8881be47be. The same change adds specialized outline shaders when fwidth is enabled, so the change to the default ones can simply be reverted. Task-number: QTBUG-84695 Change-Id: I45c3e234d1ddb39f968967cce28906f352b237ea Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/quick/scenegraph/shaders_ng/distancefieldoutlinetext.frag')
-rw-r--r--src/quick/scenegraph/shaders_ng/distancefieldoutlinetext.frag7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/quick/scenegraph/shaders_ng/distancefieldoutlinetext.frag b/src/quick/scenegraph/shaders_ng/distancefieldoutlinetext.frag
index 64bd21221e..c8c1ac89dc 100644
--- a/src/quick/scenegraph/shaders_ng/distancefieldoutlinetext.frag
+++ b/src/quick/scenegraph/shaders_ng/distancefieldoutlinetext.frag
@@ -19,8 +19,7 @@ layout(std140, binding = 0) uniform buf {
void main()
{
- float distance = texture(_qt_texture, sampleCoord).r;
- float f = fwidth(distance);
- fragColor = mix(ubuf.styleColor, ubuf.color, smoothstep(0.5 - f, 0.5 + f, distance))
- * smoothstep(ubuf.outlineAlphaMax0, ubuf.outlineAlphaMax1, distance);
+ float d = texture(_qt_texture, sampleCoord).r;
+ fragColor = mix(ubuf.styleColor, ubuf.color, smoothstep(ubuf.alphaMin, ubuf.alphaMax, d))
+ * smoothstep(ubuf.outlineAlphaMax0, ubuf.outlineAlphaMax1, d);
}