Reland "Rearrange SkSL pre-include modules to hide things"

This reverts commit 4cb5c5e1728933637ca9b8653ff95f876871dc9b, and fixes
the Chromium issue by declaring sign(x) in sksl_public.sksl.

Original description:

This makes numerous internal and GLSL types or intrinsics hidden from
public (runtime effect) SkSL. In particular:

- Only core numeric types are visible to all program types. GLSL types
  involving images, textures, and sampling are restricted to internal use.
- sk_Caps is no longer visible to runtime effects.
- The set of intrinsics available to runtime effects is now a separate,
  curated list in sksl_public.sksl. It exactly matches the GLSL ES 1.00
  spec order.
- The blend intrinsics are no longer visible, which also fixes a bug.
  These are nice, but we're not going to offer them yet - they involve
  enums, which creates complications.

Bug: skia:10680
Bug: skia:10709
Bug: skia:10913

Cq-Include-Trybots: luci.chromium.try:linux-chromeos-rel,linux-rel
Change-Id: I42deeeccd725a9fe18314d091ce253404e3572e2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/332750
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
diff --git a/tests/SkRuntimeEffectTest.cpp b/tests/SkRuntimeEffectTest.cpp
index 21185eb..ab24457 100644
--- a/tests/SkRuntimeEffectTest.cpp
+++ b/tests/SkRuntimeEffectTest.cpp
@@ -39,8 +39,11 @@
     test("in bool Flag; layout(when=Flag) uniform float Input;", "", "when");
     test("layout(tracked) uniform float Input;", "", "tracked");
 
-    // Runtime SkSL supports a limited set of uniform types. No samplers, bool, or int, for example:
-    test("uniform sampler2D s;", "", "uniform");
+    // GLSL types like sampler2D and texture2D are not allowed anywhere:
+    test("uniform sampler2D s;", "", "no type named 'sampler2D'");
+    test("uniform texture2D s;", "", "no type named 'texture2D'");
+
+    // Runtime SkSL supports a limited set of uniform types. No bool, or int, for example:
     test("uniform bool b;", "", "uniform");
     test("uniform int i;", "", "uniform");
 
@@ -75,6 +78,9 @@
          "half4 color = sample(p.x > 10 ? child1 : child2);",
          "expression");
 
+    // sk_Caps is an internal system. It should not be visible to runtime effects
+    test("", "if (sk_Caps.integerSupport) { p = p.yx; }", "unknown identifier 'sk_Caps'");
+
     // Errors that aren't caught until later in the compilation process (during optimize())
     test("", "return half4(1);", "unreachable");
     test("half badFunc() { }", "", "without returning");