aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2017-03-27 22:51:23 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-28 12:40:44 +0000
commit4a77cf86963b882b9276ea74efbe0edd76c0afbe (patch)
tree7ac04ae18f99c77dd8f1b5532ab0fa92819ffe27
parent36e4f06368c02eefe163b86e52d96c24402d3c7f (diff)
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>
-rw-r--r--tools/ok_test.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/tools/ok_test.cpp b/tools/ok_test.cpp
index dcb18a1322..3fa943f726 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 @@ struct TestStream : Stream {
SkISize size() override { return {0,0}; }
bool draw(SkCanvas*) override {
- // TODO(mtklein): GrContext
struct : public skiatest::Reporter {
bool ok = true;
@@ -46,7 +49,14 @@ struct TestStream : Stream {
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;
}
};