aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/SkSLErrorTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/SkSLErrorTest.cpp')
-rw-r--r--tests/SkSLErrorTest.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/SkSLErrorTest.cpp b/tests/SkSLErrorTest.cpp
index 432f35bff5..b84b1f3d8c 100644
--- a/tests/SkSLErrorTest.cpp
+++ b/tests/SkSLErrorTest.cpp
@@ -14,7 +14,11 @@ static void test_failure(skiatest::Reporter* r, const char* src, const char* err
SkSL::Program::Settings settings;
sk_sp<GrShaderCaps> caps = SkSL::ShaderCapsFactory::Default();
settings.fCaps = caps.get();
- compiler.convertProgram(SkSL::Program::kFragment_Kind, SkSL::String(src), settings);
+ std::unique_ptr<SkSL::Program> program = compiler.convertProgram(SkSL::Program::kFragment_Kind,
+ SkSL::String(src), settings);
+ if (!compiler.errorCount()) {
+ compiler.optimize(*program);
+ }
SkSL::String skError(error);
if (compiler.errorText() != skError) {
SkDebugf("SKSL ERROR:\n source: %s\n expected: %s received: %s", src, error,