xref: /aosp_15_r20/external/skia/resources/sksl/runtime/SharedFunctions.rts (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1*c8dee2aaSAndroid Build Coastguard Worker// Runtime Effects are allowed to call functions in sksl_shared.
2*c8dee2aaSAndroid Build Coastguard Worker// At present, the only public exposed functions are `unpremul(half4)` and `unpremul(float4)`.
3*c8dee2aaSAndroid Build Coastguard Worker
4*c8dee2aaSAndroid Build Coastguard Workeruniform half4 colorGreen, colorRed;
5*c8dee2aaSAndroid Build Coastguard Worker
6*c8dee2aaSAndroid Build Coastguard Workerhalf4 main(float2 coords) {
7*c8dee2aaSAndroid Build Coastguard Worker    float4 g = unpremul(float4(colorGreen));
8*c8dee2aaSAndroid Build Coastguard Worker    half4  r = unpremul(colorRed);
9*c8dee2aaSAndroid Build Coastguard Worker
10*c8dee2aaSAndroid Build Coastguard Worker    return half4(g.rgb, r.a);
11*c8dee2aaSAndroid Build Coastguard Worker}
12