diff options
author | 2016-10-14 06:40:02 -0700 | |
---|---|---|
committer | 2016-10-14 06:40:02 -0700 | |
commit | ad146f6ef5d2de94bd2d8c678757a6274844d20e (patch) | |
tree | f6708dc5a0bf16556a8d6b861a44de482708e400 /tests | |
parent | 2dbbfa5d376d7356df5e18bd41d7138aa6345512 (diff) |
added SkSL support for mustForceNegatedAtanParamToFloat cap
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2413363002
Review-Url: https://codereview.chromium.org/2413363002
Diffstat (limited to 'tests')
-rw-r--r-- | tests/SkSLGLSLTest.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/tests/SkSLGLSLTest.cpp b/tests/SkSLGLSLTest.cpp index dedddad1f8..b615f67814 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;" |