169c8903be
This is a reland of 22dcb5fd7e
Original change's description:
> Add coords parameter to all .sksl test files used as runtime effects
>
> Convert to use the newer MakeForShader factory, which requires this.
>
> Change-Id: Ifaf6054054027c78f3f3fe15596e435e0f79b877
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/399336
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: John Stiles <johnstiles@google.com>
Bug: skia:11919
Change-Id: I5f745c54b2bc3712f2281db6e067345903e81931
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/401836
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
38 lines
648 B
Plaintext
38 lines
648 B
Plaintext
uniform half4 colorRed, colorGreen;
|
|
|
|
half4 main(float2 coords) {
|
|
bool ok = true;
|
|
|
|
int a = 1;
|
|
a = a + a; // 2
|
|
a += a; // 4
|
|
a = a + a; // 8
|
|
a += a; // 16
|
|
a = a + a; // 32
|
|
ok = ok && (a == 32);
|
|
|
|
int b = 10;
|
|
b = b - 2; // 8
|
|
b -= 2; // 6
|
|
b = b - 1; // 5
|
|
b -= 3; // 2
|
|
ok = ok && (b == 2);
|
|
|
|
int c = 2;
|
|
c = c * c; // 4
|
|
c *= c; // 16
|
|
c = c * 4; // 64
|
|
c *= 2; // 128
|
|
ok = ok && (c == 128);
|
|
|
|
int d = 256;
|
|
d = d / 2; // 128
|
|
d /= 2; // 64
|
|
d = d / 4; // 16
|
|
d /= 4; // 4
|
|
ok = ok && (d == 4);
|
|
|
|
return ok ? colorGreen : colorRed;
|
|
}
|
|
|