Chromium Code Reviews| 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 "SkCommonFlags.h" | 5 #include "SkCommonFlags.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" |
| 11 #include "gm.h" | 11 #include "gm.h" |
| 12 #include "sk_tool_utils.h" | |
| 13 #include "sk_tool_utils_flags.h" | |
| 12 | 14 |
| 13 #include "DMCpuGMTask.h" | 15 #include "DMCpuGMTask.h" |
| 14 #include "DMGpuGMTask.h" | 16 #include "DMGpuGMTask.h" |
| 15 #include "DMGpuSupport.h" | 17 #include "DMGpuSupport.h" |
| 16 #include "DMPDFTask.h" | 18 #include "DMPDFTask.h" |
| 17 #include "DMReporter.h" | 19 #include "DMReporter.h" |
| 18 #include "DMSKPTask.h" | 20 #include "DMSKPTask.h" |
| 19 #include "DMTask.h" | 21 #include "DMTask.h" |
| 20 #include "DMTaskRunner.h" | 22 #include "DMTaskRunner.h" |
| 21 #include "DMTestTask.h" | 23 #include "DMTestTask.h" |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 41 DEFINE_int32(gpuThreads, 1, "Threads for GPU work."); | 43 DEFINE_int32(gpuThreads, 1, "Threads for GPU work."); |
| 42 DEFINE_string2(expectations, r, "", | 44 DEFINE_string2(expectations, r, "", |
| 43 "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. " |
| 44 "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." |
| 45 ); | 47 ); |
| 46 | 48 |
| 47 DEFINE_string(skps, "", "Directory to read skps from."); | 49 DEFINE_string(skps, "", "Directory to read skps from."); |
| 48 | 50 |
| 49 DEFINE_bool(gms, true, "Run GMs?"); | 51 DEFINE_bool(gms, true, "Run GMs?"); |
| 50 DEFINE_bool(tests, true, "Run tests?"); | 52 DEFINE_bool(tests, true, "Run tests?"); |
| 53 DEFINE_bool(reportUsedChars, false, "Output test font construction data to be pa sted into" | |
|
mtklein
2014/07/30 15:03:57
Is it silly to just preemptively create paths for
caryclark
2014/07/30 15:45:32
My first pass was to do just that, and that may ma
| |
| 54 " create_test_font.cpp."); | |
| 51 | 55 |
| 52 __SK_FORCE_IMAGE_DECODER_LINKING; | 56 __SK_FORCE_IMAGE_DECODER_LINKING; |
| 53 | 57 |
| 54 // "FooBar" -> "foobar". Obviously, ASCII only. | 58 // "FooBar" -> "foobar". Obviously, ASCII only. |
| 55 static SkString lowercase(SkString s) { | 59 static SkString lowercase(SkString s) { |
| 56 for (size_t i = 0; i < s.size(); i++) { | 60 for (size_t i = 0; i < s.size(); i++) { |
| 57 s[i] = tolower(s[i]); | 61 s[i] = tolower(s[i]); |
| 58 } | 62 } |
| 59 return s; | 63 return s; |
| 60 } | 64 } |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 224 SkDebugf("%d GMs x %d configs, %d tests\n", | 228 SkDebugf("%d GMs x %d configs, %d tests\n", |
| 225 gms.count(), configs.count(), tests.count()); | 229 gms.count(), configs.count(), tests.count()); |
| 226 DM::Reporter reporter; | 230 DM::Reporter reporter; |
| 227 DM::TaskRunner tasks(FLAGS_threads, FLAGS_gpuThreads); | 231 DM::TaskRunner tasks(FLAGS_threads, FLAGS_gpuThreads); |
| 228 kick_off_gms(gms, configs, gpuAPI, *expectations, &reporter, &tasks); | 232 kick_off_gms(gms, configs, gpuAPI, *expectations, &reporter, &tasks); |
| 229 kick_off_tests(tests, &reporter, &tasks); | 233 kick_off_tests(tests, &reporter, &tasks); |
| 230 kick_off_skps(&reporter, &tasks); | 234 kick_off_skps(&reporter, &tasks); |
| 231 tasks.wait(); | 235 tasks.wait(); |
| 232 | 236 |
| 233 SkDebugf("\n"); | 237 SkDebugf("\n"); |
| 234 | 238 #ifdef SK_DEBUG |
|
mtklein
2014/07/30 15:03:57
Seems like you can drop the #ifdef/#endif wrapping
caryclark
2014/07/30 15:45:32
The report_used_chars relies on data gathered only
| |
| 239 if (FLAGS_portableFonts && FLAGS_reportUsedChars) { | |
| 240 sk_tool_utils::report_used_chars(); | |
| 241 } | |
| 242 #endif | |
| 243 sk_tool_utils::release_portable_typeface(); | |
|
mtklein
2014/07/30 15:03:57
Is there a corresponding ref/acquire? How do we k
caryclark
2014/07/30 15:45:32
I don't doubt this could be better. Would this be
mtklein
2014/07/30 17:19:05
Think we could have the portable font code registe
caryclark
2014/07/30 19:00:16
Done.
caryclark
2014/07/30 19:00:16
Done.
| |
| 244 | |
| 235 SkTArray<SkString> failures; | 245 SkTArray<SkString> failures; |
| 236 reporter.getFailures(&failures); | 246 reporter.getFailures(&failures); |
| 237 report_failures(failures); | 247 report_failures(failures); |
| 238 return failures.count() > 0; | 248 return failures.count() > 0; |
| 239 } | 249 } |
| 240 | 250 |
| 241 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 251 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
| 242 int main(int argc, char** argv) { | 252 int main(int argc, char** argv) { |
| 243 SkCommandLineFlags::Parse(argc, argv); | 253 SkCommandLineFlags::Parse(argc, argv); |
| 244 return dm_main(); | 254 return dm_main(); |
| 245 } | 255 } |
| 246 #endif | 256 #endif |
| OLD | NEW |