Commit 44ac154f authored by Brian Salomon's avatar Brian Salomon Committed by Commit Bot

Use SkRuntimeColorFilterFactory to test color transform shader compilation

Previously this was tested using SkSLCompiler. However, that type should
remain private to Skia. SkRuntimeColorFilterFactory is quasi-public.
("Public" to Chrome but eventually to all).

Change-Id: I9b523001c7bfce9660f86e0430e164b883e07b04
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1958785Reviewed-by: default avatarJonathan Backer <backer@chromium.org>
Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Sadrul Chowdhury <sadrul@chromium.org>
Cr-Commit-Position: refs/heads/master@{#723523}
parent be133005
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#include "base/logging.h" #include "base/logging.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/src/sksl/SkSLCompiler.h" #include "third_party/skia/src/core/SkColorFilterPriv.h"
#include "ui/gfx/color_space.h" #include "ui/gfx/color_space.h"
#include "ui/gfx/color_transform.h" #include "ui/gfx/color_transform.h"
#include "ui/gfx/icc_profile.h" #include "ui/gfx/icc_profile.h"
...@@ -518,13 +518,9 @@ TEST(SimpleColorSpace, CanParseSkShaderSource) { ...@@ -518,13 +518,9 @@ TEST(SimpleColorSpace, CanParseSkShaderSource) {
std::string source = "void main(inout half4 color) {" + std::string source = "void main(inout half4 color) {" +
transform->GetSkShaderSource() + "}"; transform->GetSkShaderSource() + "}";
SkSL::Program::Settings settings; SkRuntimeColorFilterFactory factory(
SkSL::Compiler compiler; SkString(source.c_str(), source.length()), nullptr);
auto program = compiler.convertProgram( EXPECT_TRUE(factory.testCompile());
SkSL::Program::kPipelineStage_Kind,
SkSL::String(source.c_str(), source.length()), settings);
EXPECT_NE(nullptr, program.get());
EXPECT_EQ(0, compiler.errorCount()) << compiler.errorText();
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment