aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/shaders/styledtext.frag
blob: 662dbef2fc18fbe45c1d3e987c57b08876256c65 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
varying highp vec2 sampleCoord;
varying highp vec2 shiftedSampleCoord;

uniform sampler2D _qt_texture;
uniform lowp vec4 color;
uniform lowp vec4 styleColor;

void main()
{
    lowp float glyph = texture2D(_qt_texture, sampleCoord).a;
    lowp float style = clamp(texture2D(_qt_texture, shiftedSampleCoord).a - glyph,
                             0.0, 1.0);
    gl_FragColor = style * styleColor + glyph * color;
}