Threaded generation of software paths

All information needed by the thread is captured by the prepare
callback object, the lambda captures a pointer to that, and does the
mask render. Once it's done, it signals the semaphore (also owned by the
callback). The callback defers the semaphore wait even longer (into the
ASAP upload), so the odds of waiting for the thread are REALLY low.

Also did a bunch of cleanup along the way, and put in some trace markers
so we can monitor how well this is working.

Traces of a GM that includes GPU and SW path rendering (path-reverse):

Original:
    https://screenshot.googleplex.com/f5BG3901tQg.png
Threaded, with wait in the callback (notice pre flush callback blocking):
    https://screenshot.googleplex.com/htOSZFE2s04.png
Current version, with wait deferred to ASAP upload function:
    https://screenshot.googleplex.com/GHjD0U3C34q.png

Bug: skia:
Change-Id: I3d5a230bbd68eb35e1f0574b308485c691435790
Reviewed-on: https://skia-review.googlesource.com/36560
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/tests/TestConfigParsing.cpp b/tests/TestConfigParsing.cpp
index e24c019..8e2276c 100644
--- a/tests/TestConfigParsing.cpp
+++ b/tests/TestConfigParsing.cpp
@@ -121,7 +121,8 @@
         "mock",
         "mtl",
         "gl4444",
-        "gl565"
+        "gl565",
+        "gltestthreading"
     });
 
     SkCommandLineConfigArray configs;
@@ -254,6 +255,8 @@
     REPORTER_ASSERT(reporter, configs[29]->asConfigGpu()->getColorSpace() == srgbColorSpace.get());
     REPORTER_ASSERT(reporter, configs[30]->asConfigGpu());
     REPORTER_ASSERT(reporter, configs[30]->asConfigGpu()->getSamples() == 4);
+    REPORTER_ASSERT(reporter, configs[47]->asConfigGpu());
+    REPORTER_ASSERT(reporter, configs[47]->asConfigGpu()->getTestThreading());
 #ifdef SK_VULKAN
     REPORTER_ASSERT(reporter, configs[31]->asConfigGpu());
 #endif