Fixed an issue with DSL includes

It turned out that everywhere we were using or testing DSL code either
directly or indirectly imported big chunks of the SkSL library. These
imports turned out to be necessary; code written using just DSL.h would
fail with various template instantiation errors.

Change-Id: Iae72d15b0d6ef14614ac1a4ff08c36bc1876cd4d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/381638
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
diff --git a/tests/SkSLDSLOnlyTest.cpp b/tests/SkSLDSLOnlyTest.cpp
new file mode 100644
index 0000000..a7520b9
--- /dev/null
+++ b/tests/SkSLDSLOnlyTest.cpp
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2021 Google LLC.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "include/sksl/DSL.h"
+
+#include "tests/Test.h"
+
+// This file verifies that DSL code compiles with only a DSL.h import. We don't bother with any
+// 'real' tests here, as those are all in SkSLDSLTest.cpp.
+
+using namespace SkSL::dsl;
+
+// Defined in SkSLDSLTest.cpp (so that we don't have to put the required extra includes here)
+void StartDSL(const sk_gpu_test::ContextInfo ctxInfo);
+
+DEF_GPUTEST_FOR_MOCK_CONTEXT(DSLImportOnly, r, ctxInfo) {
+    StartDSL(ctxInfo);
+    Var x(kInt);
+    Function(kInt, "test", x).define(
+        If(x >= 0,
+            Block(Return(x)),
+            Block(Return(-x)))
+    );
+    End();
+}