1layout(key) in bool primaryColors; 2layout(ctype=SkPMColor4f, when=primaryColors) in uniform half4 colorGreen, colorRed; 3layout(ctype=SkPMColor4f, when=!primaryColors) in uniform half4 colorOrange, colorPurple; 4 5half4 main() { 6 half4 green = primaryColors ? colorGreen : colorOrange; 7 half4 red = primaryColors ? colorRed : colorPurple; 8 bool t = true; 9 bool f = false; 10 11 return half4(t ? green.r : red.r, // true -> green.r 12 f ? red.g : green.g, // false -> green.g 13 (green.g == red.r) ? green.b : red.r, // true -> green.b 14 (green.a != red.a) ? red.g : green.a); // false -> green.a 15} 16