Revert "Revert "Shuffle SkSL sources around so compiler and bytecode can be used w/o GPU""
This reverts commit 37a59ef1af685fea0942f0dbc27f20a722ed18e1.
Change-Id: If38da265ebbb196e72c7d035ba51028438787e2e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221541
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
diff --git a/src/sksl/SkSLCompiler.cpp b/src/sksl/SkSLCompiler.cpp
index 5111bf4..28190dc 100644
--- a/src/sksl/SkSLCompiler.cpp
+++ b/src/sksl/SkSLCompiler.cpp
@@ -1379,6 +1379,8 @@
return result;
}
+#if defined(SKSL_STANDALONE) || SK_SUPPORT_GPU
+
bool Compiler::toSPIRV(Program& program, OutputStream& out) {
if (!this->optimize(program)) {
return false;
@@ -1497,6 +1499,8 @@
return result;
}
+#endif
+
std::unique_ptr<ByteCode> Compiler::toByteCode(Program& program) {
if (!this->optimize(program)) {
return nullptr;