1/*#pragma settings SkVMDebugTrace NoES2Restrictions NoTraceVarInSkVMDebugTrace*/ 2// We use bitwise ops below, which SkVM supports but ES2 technically does not. 3 4uniform half4 colorGreen, colorRed; 5uniform int a, b; 6uniform float c, d; 7 8half4 main(float2 xy) { 9 bool ok = true; 10 11 int a_and_b = a & b; 12 int b_and_a = b & a; 13 ok = ok && (a_and_b == b_and_a); 14 15 int a_or_b = a | b; 16 int b_or_a = b | a; 17 ok = ok && (a_or_b == b_or_a); 18 19 int a_xor_b = a ^ b; 20 int b_xor_a = b ^ a; 21 ok = ok && (a_xor_b == b_xor_a); 22 23 bool a_eq_b = a == b; 24 bool b_eq_a = b == a; 25 ok = ok && (a_eq_b == b_eq_a); 26 27 bool a_neq_b = a != b; 28 bool b_neq_a = b != a; 29 ok = ok && (a_neq_b == b_neq_a); 30 31 int a_add_b = a + b; 32 int b_add_a = b + a; 33 ok = ok && (a_add_b == b_add_a); 34 35 float c_add_d = c + d; 36 float d_add_c = d + c; 37 ok = ok && (c_add_d == d_add_c); 38 39 int a_mul_b = a * b; 40 int b_mul_a = b * a; 41 ok = ok && (a_mul_b == b_mul_a); 42 43 float c_mul_d = c * d; 44 float d_mul_c = d * c; 45 ok = ok && (c_mul_d == d_mul_c); 46 47 return ok ? colorGreen : colorRed; 48} 49