summaryrefslogtreecommitdiff
path: root/shaders/skia/1-681.shader_test
blob: 740d5ac4992aaceda425dfe1e7a2e7e2d4787040 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
[require]
GLSL >= 1.40

[fragment shader]
#version 140

#extension GL_ARB_fragment_coord_conventions : require
layout(origin_upper_left) in vec4 gl_FragCoord;
out vec4 sk_FragColor;
uniform vec4 urectH_Stage1;
uniform float uinvSixSigma_Stage1;
uniform sampler2D uTextureSampler_0_Stage1;
flat in vec4 vcolor_Stage0;
void main() {
    vec4 outputColor_Stage0;
    {
        outputColor_Stage0 = vcolor_Stage0;
    }
    vec4 output_Stage1;
    {
        float xCoverage, yCoverage;
        {
            float l, r, t, b;
            {
                l = gl_FragCoord.x - urectH_Stage1.x;
                r = urectH_Stage1.z - gl_FragCoord.x;
                t = gl_FragCoord.y - urectH_Stage1.y;
                b = urectH_Stage1.w - gl_FragCoord.y;
            }
            float il = 1.0 + l * uinvSixSigma_Stage1;
            float ir = 1.0 + r * uinvSixSigma_Stage1;
            float it = 1.0 + t * uinvSixSigma_Stage1;
            float ib = 1.0 + b * uinvSixSigma_Stage1;
            xCoverage = (1.0 - texture(uTextureSampler_0_Stage1, vec2(il, 0.5)).w) - texture(uTextureSampler_0_Stage1, vec2(ir, 0.5)).w;
            yCoverage = (1.0 - texture(uTextureSampler_0_Stage1, vec2(it, 0.5)).w) - texture(uTextureSampler_0_Stage1, vec2(ib, 0.5)).w;
        }
        output_Stage1 = vec4(xCoverage) * yCoverage;
    }
    {
        sk_FragColor = outputColor_Stage0 * output_Stage1;
        sk_FragColor = sk_FragColor.wwww;
    }
}

[vertex shader]
#version 140

uniform vec4 sk_RTAdjust;
in vec2 position;
in vec4 color;
flat out vec4 vcolor_Stage0;
void main() {
    vcolor_Stage0 = color;
    gl_Position = vec4(position.x, position.y, 0.0, 1.0);
    gl_Position = vec4(gl_Position.xy * sk_RTAdjust.xz + gl_Position.ww * sk_RTAdjust.yw, 0.0, gl_Position.w);
}