blob: 235749db46dda71cfe7e0a95442971e17cbba040 [file] [log] [blame]
layout(key) in bool primaryColors;
layout(ctype=SkPMColor4f, when=primaryColors) in uniform half4 colorGreen, colorRed;
layout(ctype=SkPMColor4f, when=!primaryColors) in uniform half4 colorOrange, colorPurple;
half4 main() {
half4 green = primaryColors ? colorGreen : colorOrange;
half4 red = primaryColors ? colorRed : colorPurple;
bool t = true;
bool f = false;
return half4(t ? green.r : red.r, // true -> green.r
f ? red.g : green.g, // false -> green.g
(green.g == red.r) ? green.b : red.r, // true -> green.b
(green.a != red.a) ? red.g : green.a); // false -> green.a
}