Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(180)

Unified Diff: tests/SkSLGLSLTest.cpp

Issue 2413363002: added SkSL support for mustForceNegatedAtanParamToFloat cap (Closed)
Patch Set: updated comment again Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/sksl/SkSLMain.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;"
« no previous file with comments | « src/sksl/SkSLMain.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698