Index: tests/SkSLGLSLTest.cpp |
diff --git a/tests/SkSLGLSLTest.cpp b/tests/SkSLGLSLTest.cpp |
index dedddad1f8a6a9ce07daebcf15e33d4f61227256..b615f678140ecca0de5a7b38a1273a4cb1a5ba99 100644 |
--- a/tests/SkSLGLSLTest.cpp |
+++ b/tests/SkSLGLSLTest.cpp |
@@ -33,7 +33,8 @@ static SkSL::GLCaps default_caps() { |
false, // isCoreProfile |
false, // usesPrecisionModifiers; |
false, // mustDeclareFragmentShaderOutput |
- true // canUseMinAndAbsTogether |
+ true, // canUseMinAndAbsTogether |
+ false // mustForceNegatedAtanParamToFloat |
}; |
} |
@@ -315,6 +316,27 @@ DEF_TEST(SkSLMinAbs, r) { |
"}\n"); |
} |
+DEF_TEST(SkSLNegatedAtan, r) { |
+ test(r, |
+ "void main() { vec2 x = vec2(1, 2); float y = atan(x.x, -(2 * x.y)); }", |
+ default_caps(), |
+ "#version 400\n" |
+ "void main() {\n" |
+ " vec2 x = vec2(1.0, 2.0);\n" |
+ " float y = atan(x.x, -(2.0 * x.y));\n" |
+ "}\n"); |
+ SkSL::GLCaps caps = default_caps(); |
+ caps.fMustForceNegatedAtanParamToFloat = true; |
+ test(r, |
+ "void main() { vec2 x = vec2(1, 2); float y = atan(x.x, -(2 * x.y)); }", |
+ caps, |
+ "#version 400\n" |
+ "void main() {\n" |
+ " vec2 x = vec2(1.0, 2.0);\n" |
+ " float y = atan(x.x, -1.0 * (2.0 * x.y));\n" |
+ "}\n"); |
+} |
+ |
DEF_TEST(SkSLModifiersDeclaration, r) { |
test(r, |
"layout(blend_support_all_equations) out;" |