aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/effects/GrArithmeticFP.fp
blob: 546fa79843c8fa6bbf0ac5752b2a85cca8402e78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
in float k1;
in float k2;
in float k3;
in float k4;
layout(key) in bool enforcePMColor;
in fragmentProcessor child;

uniform float4 k;

void main() {
    half4 dst = process(child);
    sk_OutColor = clamp(k.x * sk_InColor * dst + k.y * sk_InColor + k.z * dst + k.w, 0, 1);
    if (enforcePMColor) {
        sk_OutColor.rgb = min(sk_OutColor.rgb, sk_OutColor.a);
    }
}

@setData(pdman) {
    pdman.set4f(k, k1, k2, k3, k4);
}