OLD | NEW |
1 // Main binary for DM. | 1 // Main binary for DM. |
2 // For a high-level overview, please see dm/README. | 2 // For a high-level overview, please see dm/README. |
3 | 3 |
4 #include "SkBenchmark.h" | 4 #include "SkBenchmark.h" |
5 #include "SkCommandLineFlags.h" | 5 #include "SkCommandLineFlags.h" |
6 #include "SkForceLinking.h" | 6 #include "SkForceLinking.h" |
7 #include "SkGraphics.h" | 7 #include "SkGraphics.h" |
8 #include "SkPicture.h" | 8 #include "SkPicture.h" |
9 #include "SkString.h" | 9 #include "SkString.h" |
10 #include "Test.h" | 10 #include "Test.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 | 31 |
32 #include <ctype.h> | 32 #include <ctype.h> |
33 | 33 |
34 using skiagm::GM; | 34 using skiagm::GM; |
35 using skiagm::GMRegistry; | 35 using skiagm::GMRegistry; |
36 using skiatest::Test; | 36 using skiatest::Test; |
37 using skiatest::TestRegistry; | 37 using skiatest::TestRegistry; |
38 | 38 |
39 DEFINE_int32(threads, -1, "Threads for CPU work. Default NUM_CPUS."); | 39 DEFINE_int32(threads, -1, "Threads for CPU work. Default NUM_CPUS."); |
40 DEFINE_int32(gpuThreads, 1, "Threads for GPU work."); | 40 DEFINE_int32(gpuThreads, 1, "Threads for GPU work."); |
41 #ifdef SK_BUILD_JSON_WRITER | |
42 DEFINE_string2(expectations, r, "", | 41 DEFINE_string2(expectations, r, "", |
43 "If a directory, compare generated images against images under th
is path. " | 42 "If a directory, compare generated images against images under th
is path. " |
44 "If a file, compare generated images against JSON expectations at
this path." | 43 "If a file, compare generated images against JSON expectations at
this path." |
45 ); | 44 ); |
46 #else | |
47 DEFINE_string2(expectations, r, "", | |
48 "If a directory, compare generated images against images under th
is path. " | |
49 ); | |
50 #endif | |
51 DEFINE_string2(resources, i, "resources", "Path to resources directory."); | 45 DEFINE_string2(resources, i, "resources", "Path to resources directory."); |
52 DEFINE_string(match, "", "[~][^]substring[$] [...] of GM name to run.\n" | 46 DEFINE_string(match, "", "[~][^]substring[$] [...] of GM name to run.\n" |
53 "Multiple matches may be separated by spaces.\n" | 47 "Multiple matches may be separated by spaces.\n" |
54 "~ causes a matching GM to always be skipped\n" | 48 "~ causes a matching GM to always be skipped\n" |
55 "^ requires the start of the GM to match\n" | 49 "^ requires the start of the GM to match\n" |
56 "$ requires the end of the GM to match\n" | 50 "$ requires the end of the GM to match\n" |
57 "^ and $ requires an exact match\n" | 51 "^ and $ requires an exact match\n" |
58 "If a GM does not match any list entry,\n" | 52 "If a GM does not match any list entry,\n" |
59 "it is skipped unless some list entry starts with ~"); | 53 "it is skipped unless some list entry starts with ~"); |
60 DEFINE_string(config, "565 8888 pdf gpu nonrendering", | 54 DEFINE_string(config, "565 8888 pdf gpu nonrendering", |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 SkTDArray<GMRegistry::Factory> gms; | 236 SkTDArray<GMRegistry::Factory> gms; |
243 SkAutoTDelete<DM::Expectations> expectations(SkNEW(DM::NoExpectations)); | 237 SkAutoTDelete<DM::Expectations> expectations(SkNEW(DM::NoExpectations)); |
244 if (FLAGS_gms) { | 238 if (FLAGS_gms) { |
245 append_matching_factories<GM>(GMRegistry::Head(), &gms); | 239 append_matching_factories<GM>(GMRegistry::Head(), &gms); |
246 | 240 |
247 if (FLAGS_expectations.count() > 0) { | 241 if (FLAGS_expectations.count() > 0) { |
248 const char* path = FLAGS_expectations[0]; | 242 const char* path = FLAGS_expectations[0]; |
249 if (sk_isdir(path)) { | 243 if (sk_isdir(path)) { |
250 expectations.reset(SkNEW_ARGS(DM::WriteTask::Expectations, (path
))); | 244 expectations.reset(SkNEW_ARGS(DM::WriteTask::Expectations, (path
))); |
251 } else { | 245 } else { |
252 #ifdef SK_BUILD_JSON_WRITER | |
253 expectations.reset(SkNEW_ARGS(DM::JsonExpectations, (path))); | 246 expectations.reset(SkNEW_ARGS(DM::JsonExpectations, (path))); |
254 #endif | |
255 } | 247 } |
256 } | 248 } |
257 } | 249 } |
258 | 250 |
259 SkTDArray<BenchRegistry::Factory> benches; | 251 SkTDArray<BenchRegistry::Factory> benches; |
260 if (FLAGS_benches) { | 252 if (FLAGS_benches) { |
261 append_matching_factories<SkBenchmark>(BenchRegistry::Head(), &benches); | 253 append_matching_factories<SkBenchmark>(BenchRegistry::Head(), &benches); |
262 } | 254 } |
263 | 255 |
264 SkTDArray<TestRegistry::Factory> tests; | 256 SkTDArray<TestRegistry::Factory> tests; |
(...skipping 17 matching lines...) Expand all Loading... |
282 reporter.getFailures(&failures); | 274 reporter.getFailures(&failures); |
283 report_failures(failures); | 275 report_failures(failures); |
284 return failures.count() > 0; | 276 return failures.count() > 0; |
285 } | 277 } |
286 | 278 |
287 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 279 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
288 int main(int argc, char** argv) { | 280 int main(int argc, char** argv) { |
289 return tool_main(argc, argv); | 281 return tool_main(argc, argv); |
290 } | 282 } |
291 #endif | 283 #endif |
OLD | NEW |