94e72b90b8
SkVMCodeGenerator was lacking support for the comma operator entirely; this has now been implemented. Change-Id: I9350f54e6ee52764c620116e6dbfe4ca3e9cd47e Reviewed-on: https://skia-review.googlesource.com/c/skia/+/363096 Auto-Submit: John Stiles <johnstiles@google.com> Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: John Stiles <johnstiles@google.com>
24 lines
483 B
GLSL
24 lines
483 B
GLSL
|
|
out vec4 sk_FragColor;
|
|
uniform vec4 colorRed;
|
|
uniform vec4 colorGreen;
|
|
uniform vec4 colorWhite;
|
|
uniform vec4 colorBlack;
|
|
void setToColorBlack(out vec4 x) {
|
|
x = colorBlack;
|
|
}
|
|
vec4 main() {
|
|
vec4 a;
|
|
vec4 b;
|
|
vec4 c;
|
|
vec4 d;
|
|
|
|
(b = colorRed , c = colorGreen);
|
|
a = (setToColorBlack(d) , colorWhite);
|
|
a *= a;
|
|
b *= b;
|
|
c *= c;
|
|
d *= d;
|
|
return ((a == colorWhite && b == colorRed) && c == colorGreen) && d == colorBlack ? colorGreen : colorRed;
|
|
}
|