Add Dockerfile for building and running local Skia checkout with SwiftShader
This also adds a little helper to fuzz that allows us to see what
GPU is being targeted.
This is the first step in getting a SwiftShader fuzz target.
To prove that this works, simply download this patch and run:
./docker/skia-with-swift-shader-base/build-with-swift-shader-and-run "out/with-swift-shader/fuzz --gpuInfo -t api -n NativeGLCanvas -b out/with-swift-shader/fiddle"
Running supplied command ['out/with-swift-shader/fuzz', '--gpuInfo', '-t', 'api', '-n', 'NativeGLCanvas', '-b', 'out/with-swift-shader/fiddle']
Fuzzing NativeGLCanvas...
GL_RENDERER Google SwiftShader
GL_VENDOR Google Inc.
GL_VERSION OpenGL ES 3.0 SwiftShader 4.0.0.6
Bug: skia:
Change-Id: I3cc11a6bcd14f70f6025011722f9a73c94cb1f65
Reviewed-on: https://skia-review.googlesource.com/132269
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
diff --git a/docker/skia-with-swift-shader-base/build.sh b/docker/skia-with-swift-shader-base/build.sh
new file mode 100755
index 0000000..cabd931
--- /dev/null
+++ b/docker/skia-with-swift-shader-base/build.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+# Copyright 2018 Google, LLC
+#
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+
+set +e
+
+mkdir -p /skia/out/with-swift-shader
+
+echo '
+cc = "clang"
+cxx = "clang++"
+skia_use_egl = true
+is_debug = false
+skia_use_system_freetype2 = false
+extra_cflags = [
+ "-I/tmp/swiftshader/include",
+ "-DGR_EGL_TRY_GLES3_THEN_GLES2",
+ "-g0",
+]
+extra_ldflags = [
+ "-L/usr/local/lib",
+ "-Wl,-rpath",
+ "-Wl,/usr/local/lib"
+] ' > /skia/out/with-swift-shader/args.gn
+
+# /skia is where the host Skia checkout is linked to in the container
+cd /skia
+if [ "sync-deps" = "$1" ]; then
+ python tools/git-sync-deps
+fi
+./bin/fetch-gn
+./bin/gn gen out/with-swift-shader
+/tmp/depot_tools/ninja -C out/with-swift-shader