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 "CrashHandler.h" | 4 #include "CrashHandler.h" |
5 #include "LazyDecodeBitmap.h" | 5 #include "LazyDecodeBitmap.h" |
6 #include "SkCommonFlags.h" | 6 #include "SkCommonFlags.h" |
7 #include "SkForceLinking.h" | 7 #include "SkForceLinking.h" |
8 #include "SkGraphics.h" | 8 #include "SkGraphics.h" |
9 #include "SkPicture.h" | 9 #include "SkPicture.h" |
10 #include "SkString.h" | 10 #include "SkString.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 #include <ctype.h> | 34 #include <ctype.h> |
35 | 35 |
36 using skiagm::GM; | 36 using skiagm::GM; |
37 using skiagm::GMRegistry; | 37 using skiagm::GMRegistry; |
38 using skiatest::Test; | 38 using skiatest::Test; |
39 using skiatest::TestRegistry; | 39 using skiatest::TestRegistry; |
40 | 40 |
41 static const char kGpuAPINameGL[] = "gl"; | 41 static const char kGpuAPINameGL[] = "gl"; |
42 static const char kGpuAPINameGLES[] = "gles"; | 42 static const char kGpuAPINameGLES[] = "gles"; |
43 | 43 |
44 DEFINE_int32(gpuThreads, 1, "Threads for GPU work."); | |
45 DEFINE_string2(expectations, r, "", | 44 DEFINE_string2(expectations, r, "", |
46 "If a directory, compare generated images against images under th
is path. " | 45 "If a directory, compare generated images against images under th
is path. " |
47 "If a file, compare generated images against JSON expectations at
this path." | 46 "If a file, compare generated images against JSON expectations at
this path." |
48 ); | 47 ); |
49 | 48 |
50 DEFINE_bool(gms, true, "Run GMs?"); | 49 DEFINE_bool(gms, true, "Run GMs?"); |
51 DEFINE_bool(tests, true, "Run tests?"); | 50 DEFINE_bool(tests, true, "Run tests?"); |
52 DEFINE_bool(reportUsedChars, false, "Output test font construction data to be pa
sted into" | 51 DEFINE_bool(reportUsedChars, false, "Output test font construction data to be pa
sted into" |
53 " create_test_font.cpp."); | 52 " create_test_font.cpp."); |
54 | 53 |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 if (FLAGS_tests) { | 225 if (FLAGS_tests) { |
227 append_matching_factories<Test>(TestRegistry::Head(), &tests); | 226 append_matching_factories<Test>(TestRegistry::Head(), &tests); |
228 } | 227 } |
229 | 228 |
230 SkTArray<SkString> skps; | 229 SkTArray<SkString> skps; |
231 find_skps(&skps); | 230 find_skps(&skps); |
232 | 231 |
233 SkDebugf("%d GMs x %d configs, %d tests, %d pictures\n", | 232 SkDebugf("%d GMs x %d configs, %d tests, %d pictures\n", |
234 gms.count(), configs.count(), tests.count(), skps.count()); | 233 gms.count(), configs.count(), tests.count(), skps.count()); |
235 DM::Reporter reporter; | 234 DM::Reporter reporter; |
236 DM::TaskRunner tasks(FLAGS_threads, FLAGS_gpuThreads); | 235 DM::TaskRunner tasks(FLAGS_threads); |
237 kick_off_tests(tests, &reporter, &tasks); | 236 kick_off_tests(tests, &reporter, &tasks); |
238 kick_off_gms(gms, configs, gpuAPI, *expectations, &reporter, &tasks); | 237 kick_off_gms(gms, configs, gpuAPI, *expectations, &reporter, &tasks); |
239 kick_off_skps(skps, &reporter, &tasks); | 238 kick_off_skps(skps, &reporter, &tasks); |
240 tasks.wait(); | 239 tasks.wait(); |
241 | 240 |
242 SkDebugf("\n"); | 241 SkDebugf("\n"); |
243 #ifdef SK_DEBUG | 242 #ifdef SK_DEBUG |
244 if (FLAGS_portableFonts && FLAGS_reportUsedChars) { | 243 if (FLAGS_portableFonts && FLAGS_reportUsedChars) { |
245 sk_tool_utils::report_used_chars(); | 244 sk_tool_utils::report_used_chars(); |
246 } | 245 } |
247 #endif | 246 #endif |
248 | 247 |
249 SkTArray<SkString> failures; | 248 SkTArray<SkString> failures; |
250 reporter.getFailures(&failures); | 249 reporter.getFailures(&failures); |
251 report_failures(failures); | 250 report_failures(failures); |
252 return failures.count() > 0; | 251 return failures.count() > 0; |
253 } | 252 } |
254 | 253 |
255 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 254 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
256 int main(int argc, char** argv) { | 255 int main(int argc, char** argv) { |
257 SkCommandLineFlags::Parse(argc, argv); | 256 SkCommandLineFlags::Parse(argc, argv); |
258 return dm_main(); | 257 return dm_main(); |
259 } | 258 } |
260 #endif | 259 #endif |
OLD | NEW |