diff options
author | Ethan Nicholas <ethannicholas@google.com> | 2016-11-17 16:13:37 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-11-18 14:34:08 +0000 |
commit | d8df21a1e08b5b3380261f4b90acfbdc538ef93c (patch) | |
tree | d0d9454eec7c469335c40938aa497c055f89297b /tests/SkSLGLSLTest.cpp | |
parent | 833dcf48844dd053ddf7ecea20e3e1c2b6b47e01 (diff) |
switched skslc from std::string to SkString
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4977
Change-Id: I15e24963b09b719a2c07da67745114f5ac66cee8
Reviewed-on: https://skia-review.googlesource.com/4977
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Diffstat (limited to 'tests/SkSLGLSLTest.cpp')
-rw-r--r-- | tests/SkSLGLSLTest.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/SkSLGLSLTest.cpp b/tests/SkSLGLSLTest.cpp index b01aad83d6..7af32bef6f 100644 --- a/tests/SkSLGLSLTest.cpp +++ b/tests/SkSLGLSLTest.cpp @@ -9,23 +9,24 @@ #include "Test.h" -#if SKIA_SUPPORT_GPU +#if SK_SUPPORT_GPU static void test(skiatest::Reporter* r, const char* src, const GrGLSLCaps& caps, const char* expected) { SkSL::Compiler compiler; - std::string output; - bool result = compiler.toGLSL(SkSL::Program::kFragment_Kind, src, caps, &output); + SkString output; + bool result = compiler.toGLSL(SkSL::Program::kFragment_Kind, SkString(src), caps, &output); if (!result) { SkDebugf("Unexpected error compiling %s\n%s", src, compiler.errorText().c_str()); } REPORTER_ASSERT(r, result); if (result) { - if (output != expected) { + SkString skExpected(expected); + if (output != skExpected) { SkDebugf("GLSL MISMATCH:\nsource:\n%s\n\nexpected:\n'%s'\n\nreceived:\n'%s'", src, expected, output.c_str()); } - REPORTER_ASSERT(r, output == expected); + REPORTER_ASSERT(r, output == skExpected); } } @@ -46,7 +47,7 @@ DEF_TEST(SkSLControl, r) { "if (sqrt(2) > 5) { sk_FragColor = vec4(0.75); } else { discard; }" "int i = 0;" "while (i < 10) sk_FragColor *= 0.5;" - "do { sk_FragColor += 0.01; } while (sk_FragColor.x < 0.7);" + "do { sk_FragColor += 0.01; } while (sk_FragColor.x < 0.75);" "for (int i = 0; i < 10; i++) {" "if (i % 0 == 1) break; else continue;" "}" @@ -65,7 +66,7 @@ DEF_TEST(SkSLControl, r) { " while (i < 10) sk_FragColor *= 0.5;\n" " do {\n" " sk_FragColor += 0.01;\n" - " } while (sk_FragColor.x < 0.7);\n" + " } while (sk_FragColor.x < 0.75);\n" " for (int i = 0;i < 10; i++) {\n" " if (i % 0 == 1) break; else continue;\n" " }\n" |