Pass GN header visibility check.

This fixes a few things:

* removes includes that weren't supposed to be present
* scopes some compiler code into white_box_perftests
* makes version.h/commit and angle_common id more visible
* roll zlib to a version that passes check

This should help prevent build problems from popping up in the
downstream Chromium build. We could also potentially look at
including gn check in our CQ recipe.

Bug: chromium:915429
Change-Id: I350f543e16de13c84eb2c43260f4966d47185114
Reviewed-on: https://chromium-review.googlesource.com/c/1380771
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
diff --git a/src/tests/perf_tests/CompilerPerf.cpp b/src/tests/perf_tests/CompilerPerf.cpp
index e3b7b66..77bc91a 100644
--- a/src/tests/perf_tests/CompilerPerf.cpp
+++ b/src/tests/perf_tests/CompilerPerf.cpp
@@ -164,16 +164,71 @@
 
 constexpr int kNumIterationsPerStep = 4;
 
-struct CompilerPerfParameters final : public angle::CompilerParameters
+struct CompilerParameters
+{
+    CompilerParameters() { output = SH_HLSL_4_1_OUTPUT; }
+
+    CompilerParameters(ShShaderOutput output) : output(output) {}
+
+    const char *str() const
+    {
+        switch (output)
+        {
+            case SH_HLSL_4_1_OUTPUT:
+                return "HLSL_4_1";
+            case SH_GLSL_450_CORE_OUTPUT:
+                return "GLSL_4_50";
+            case SH_ESSL_OUTPUT:
+                return "ESSL";
+            default:
+                UNREACHABLE();
+                return "unk";
+        }
+    }
+
+    ShShaderOutput output;
+};
+
+bool IsPlatformAvailable(const CompilerParameters &param)
+{
+    switch (param.output)
+    {
+        case SH_HLSL_4_1_OUTPUT:
+        case SH_HLSL_4_0_FL9_3_OUTPUT:
+        case SH_HLSL_3_0_OUTPUT:
+        {
+            TPoolAllocator allocator;
+            InitializePoolIndex();
+            allocator.push();
+            SetGlobalPoolAllocator(&allocator);
+            ShHandle translator =
+                sh::ConstructCompiler(GL_FRAGMENT_SHADER, SH_WEBGL2_SPEC, param.output);
+            bool success = translator != nullptr;
+            SetGlobalPoolAllocator(nullptr);
+            allocator.pop();
+            FreePoolIndex();
+            if (!success)
+            {
+                return false;
+            }
+            break;
+        }
+        default:
+            break;
+    }
+    return true;
+}
+
+struct CompilerPerfParameters final : public CompilerParameters
 {
     CompilerPerfParameters(ShShaderOutput output,
                            const char *shaderSource,
                            const char *shaderSourceId)
-        : angle::CompilerParameters(output), shaderSource(shaderSource)
+        : CompilerParameters(output), shaderSource(shaderSource)
     {
         testId = shaderSourceId;
         testId += "_";
-        testId += angle::CompilerParameters::str();
+        testId += CompilerParameters::str();
     }
 
     const char *shaderSource;