OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 <ctype.h> | 8 #include <ctype.h> |
9 | 9 |
10 #include "Benchmark.h" | 10 #include "Benchmark.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 | 67 |
68 DEFINE_string(outResultsFile, "", "If given, write results here as JSON."); | 68 DEFINE_string(outResultsFile, "", "If given, write results here as JSON."); |
69 DEFINE_int32(maxCalibrationAttempts, 3, | 69 DEFINE_int32(maxCalibrationAttempts, 3, |
70 "Try up to this many times to guess loops for a bench, or skip the
bench."); | 70 "Try up to this many times to guess loops for a bench, or skip the
bench."); |
71 DEFINE_int32(maxLoops, 1000000, "Never run a bench more times than this."); | 71 DEFINE_int32(maxLoops, 1000000, "Never run a bench more times than this."); |
72 DEFINE_string(clip, "0,0,1000,1000", "Clip for SKPs."); | 72 DEFINE_string(clip, "0,0,1000,1000", "Clip for SKPs."); |
73 DEFINE_string(scales, "1.0", "Space-separated scales for SKPs."); | 73 DEFINE_string(scales, "1.0", "Space-separated scales for SKPs."); |
74 DEFINE_bool(bbh, true, "Build a BBH for SKPs?"); | 74 DEFINE_bool(bbh, true, "Build a BBH for SKPs?"); |
75 DEFINE_bool(mpd, true, "Use MultiPictureDraw for the SKPs?"); | 75 DEFINE_bool(mpd, true, "Use MultiPictureDraw for the SKPs?"); |
76 DEFINE_int32(flushEvery, 10, "Flush --outResultsFile every Nth run."); | 76 DEFINE_int32(flushEvery, 10, "Flush --outResultsFile every Nth run."); |
| 77 DEFINE_bool(resetGpuContext, true, "Reset the GrContext before running each test
."); |
77 | 78 |
78 static SkString humanize(double ms) { | 79 static SkString humanize(double ms) { |
79 if (FLAGS_verbose) return SkStringPrintf("%llu", (uint64_t)(ms*1e6)); | 80 if (FLAGS_verbose) return SkStringPrintf("%llu", (uint64_t)(ms*1e6)); |
80 return HumanizeMs(ms); | 81 return HumanizeMs(ms); |
81 } | 82 } |
82 #define HUMANIZE(ms) humanize(ms).c_str() | 83 #define HUMANIZE(ms) humanize(ms).c_str() |
83 | 84 |
84 static double time(int loops, Benchmark* bench, SkCanvas* canvas, SkGLContext* g
l) { | 85 static double time(int loops, Benchmark* bench, SkCanvas* canvas, SkGLContext* g
l) { |
85 if (canvas) { | 86 if (canvas) { |
86 canvas->clear(SK_ColorWHITE); | 87 canvas->clear(SK_ColorWHITE); |
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 | 791 |
791 return 0; | 792 return 0; |
792 } | 793 } |
793 | 794 |
794 #if !defined SK_BUILD_FOR_IOS | 795 #if !defined SK_BUILD_FOR_IOS |
795 int main(int argc, char** argv) { | 796 int main(int argc, char** argv) { |
796 SkCommandLineFlags::Parse(argc, argv); | 797 SkCommandLineFlags::Parse(argc, argv); |
797 return nanobench_main(); | 798 return nanobench_main(); |
798 } | 799 } |
799 #endif | 800 #endif |
OLD | NEW |