ok, plumb in GrContextFactory

Didn't know what options would be useful here (path renderers?), so I've
left them default.  Obviously we can thread them through TestSrc options.

I now have "841 ok" and no failures on my Linux laptop, though I imagine
the GPU tests are all just no-op'd by the TODO at the bottom of the file.

Change-Id: Id934c0bdb5de96d96f2a391106b5d20116f41979
Reviewed-on: https://skia-review.googlesource.com/10213
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
diff --git a/tools/ok_test.cpp b/tools/ok_test.cpp
index dcb18a1..3fa943f 100644
--- a/tools/ok_test.cpp
+++ b/tools/ok_test.cpp
@@ -8,6 +8,10 @@
 #include "ok.h"
 #include "Test.h"
 
+#if SK_SUPPORT_GPU
+    #include "GrContextFactory.h"
+#endif
+
 struct TestStream : Stream {
     const skiatest::TestRegistry* registry = skiatest::TestRegistry::Head();
     bool extended = false, verbose = false;
@@ -28,7 +32,6 @@
         SkISize     size() override { return {0,0}; }
 
         bool draw(SkCanvas*) override {
-            // TODO(mtklein): GrContext
 
             struct : public skiatest::Reporter {
                 bool ok = true;
@@ -46,7 +49,14 @@
             reporter.extended = extended;
             reporter.verbose_ = verbose;
 
-            test.proc(&reporter, nullptr);
+            sk_gpu_test::GrContextFactory* factory = nullptr;
+        #if SK_SUPPORT_GPU
+            GrContextOptions options;
+            sk_gpu_test::GrContextFactory a_real_factory(options);
+            factory = &a_real_factory;
+        #endif
+
+            test.proc(&reporter, factory);
             return reporter.ok;
         }
     };