| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "CrashHandler.h" | 8 #include "CrashHandler.h" |
| 9 #include "DMJsonWriter.h" | 9 #include "DMJsonWriter.h" |
| 10 #include "DMSrcSink.h" | 10 #include "DMSrcSink.h" |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 return kNone_GrGLStandard; | 208 return kNone_GrGLStandard; |
| 209 } | 209 } |
| 210 | 210 |
| 211 static void push_sink(const char* tag, Sink* s) { | 211 static void push_sink(const char* tag, Sink* s) { |
| 212 SkAutoTDelete<Sink> sink(s); | 212 SkAutoTDelete<Sink> sink(s); |
| 213 if (!FLAGS_config.contains(tag)) { | 213 if (!FLAGS_config.contains(tag)) { |
| 214 return; | 214 return; |
| 215 } | 215 } |
| 216 // Try a noop Src as a canary. If it fails, skip this sink. | 216 // Try a noop Src as a canary. If it fails, skip this sink. |
| 217 struct : public Src { | 217 struct : public Src { |
| 218 Error draw(SkCanvas*) const SK_OVERRIDE { return ""; } | 218 Error draw(SkCanvas*) const override { return ""; } |
| 219 SkISize size() const SK_OVERRIDE { return SkISize::Make(16, 16); } | 219 SkISize size() const override { return SkISize::Make(16, 16); } |
| 220 Name name() const SK_OVERRIDE { return "noop"; } | 220 Name name() const override { return "noop"; } |
| 221 } noop; | 221 } noop; |
| 222 | 222 |
| 223 SkBitmap bitmap; | 223 SkBitmap bitmap; |
| 224 SkDynamicMemoryWStream stream; | 224 SkDynamicMemoryWStream stream; |
| 225 SkString log; | 225 SkString log; |
| 226 Error err = sink->draw(noop, &bitmap, &stream, &log); | 226 Error err = sink->draw(noop, &bitmap, &stream, &log); |
| 227 if (err.isFatal()) { | 227 if (err.isFatal()) { |
| 228 SkDebugf("Skipping %s: %s\n", tag, err.c_str()); | 228 SkDebugf("Skipping %s: %s\n", tag, err.c_str()); |
| 229 return; | 229 return; |
| 230 } | 230 } |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 if (test.needsGpu && gpu_supported()) { | 519 if (test.needsGpu && gpu_supported()) { |
| 520 (FLAGS_gpu_threading ? gThreadedTests : gGPUTests).push(test); | 520 (FLAGS_gpu_threading ? gThreadedTests : gGPUTests).push(test); |
| 521 } else if (!test.needsGpu && FLAGS_cpu) { | 521 } else if (!test.needsGpu && FLAGS_cpu) { |
| 522 gThreadedTests.push(test); | 522 gThreadedTests.push(test); |
| 523 } | 523 } |
| 524 } | 524 } |
| 525 } | 525 } |
| 526 | 526 |
| 527 static void run_test(skiatest::Test* test) { | 527 static void run_test(skiatest::Test* test) { |
| 528 struct : public skiatest::Reporter { | 528 struct : public skiatest::Reporter { |
| 529 void reportFailed(const skiatest::Failure& failure) SK_OVERRIDE { | 529 void reportFailed(const skiatest::Failure& failure) override { |
| 530 fail(failure.toString()); | 530 fail(failure.toString()); |
| 531 JsonWriter::AddTestFailure(failure); | 531 JsonWriter::AddTestFailure(failure); |
| 532 } | 532 } |
| 533 bool allowExtendedTest() const SK_OVERRIDE { | 533 bool allowExtendedTest() const override { |
| 534 return FLAGS_pathOpsExtended; | 534 return FLAGS_pathOpsExtended; |
| 535 } | 535 } |
| 536 bool verbose() const SK_OVERRIDE { return FLAGS_veryVerbose; } | 536 bool verbose() const override { return FLAGS_veryVerbose; } |
| 537 } reporter; | 537 } reporter; |
| 538 WallTimer timer; | 538 WallTimer timer; |
| 539 timer.start(); | 539 timer.start(); |
| 540 if (!FLAGS_dryRun) { | 540 if (!FLAGS_dryRun) { |
| 541 start("unit", "test", test->name); | 541 start("unit", "test", test->name); |
| 542 GrContextFactory factory; | 542 GrContextFactory factory; |
| 543 test->proc(&reporter, &factory); | 543 test->proc(&reporter, &factory); |
| 544 } | 544 } |
| 545 timer.end(); | 545 timer.end(); |
| 546 done(timer.fWall, "unit", "test", test->name, "", ""); | 546 done(timer.fWall, "unit", "test", test->name, "", ""); |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 } | 648 } |
| 649 return 0; | 649 return 0; |
| 650 } | 650 } |
| 651 | 651 |
| 652 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 652 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
| 653 int main(int argc, char** argv) { | 653 int main(int argc, char** argv) { |
| 654 SkCommandLineFlags::Parse(argc, argv); | 654 SkCommandLineFlags::Parse(argc, argv); |
| 655 return dm_main(); | 655 return dm_main(); |
| 656 } | 656 } |
| 657 #endif | 657 #endif |
| OLD | NEW |