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 "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 "SkOSFile.h" | 9 #include "SkOSFile.h" |
| 10 #include "SkPicture.h" | 10 #include "SkPicture.h" |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 242 | 242 |
| 243 | 243 |
| 244 SkTArray<SkString> skps; | 244 SkTArray<SkString> skps; |
| 245 if (!FLAGS_skps.isEmpty()) { | 245 if (!FLAGS_skps.isEmpty()) { |
| 246 const char* suffixes[] = { "skp" }; | 246 const char* suffixes[] = { "skp" }; |
| 247 find_files(FLAGS_skps[0], suffixes, SK_ARRAY_COUNT(suffixes), &skps); | 247 find_files(FLAGS_skps[0], suffixes, SK_ARRAY_COUNT(suffixes), &skps); |
| 248 } | 248 } |
| 249 | 249 |
| 250 SkTArray<SkString> images; | 250 SkTArray<SkString> images; |
| 251 if (!FLAGS_images.isEmpty()) { | 251 if (!FLAGS_images.isEmpty()) { |
| 252 const char* suffixes[] = { "bmp", "gif", "jpg", "png", "webp", "ktx", "a stc" }; | 252 const char* suffixes[] = { "bmp", "gif", "jpg", "jpeg", "png", "webp", |
|
mtklein
2014/12/15 16:06:32
Why don't we just write
const char* suffixes[] =
scroggo
2014/12/15 16:16:00
We could do that. (We did it in skimage.) The adva
| |
| 253 find_files(FLAGS_images[0], suffixes, SK_ARRAY_COUNT(suffixes), &images) ; | 253 "ktx", "astc", "wbmp", "ico" }; |
| 254 const size_t count = SK_ARRAY_COUNT(suffixes); | |
| 255 find_files(FLAGS_images[0], suffixes, count, &images); | |
| 256 // Also check for the capitalized versions. | |
| 257 // Note: capSuffixes does not grow or shrink, so we can continue to use | |
| 258 // "count". | |
| 259 SkTArray<const char*> capSuffixes(suffixes, count); | |
| 260 for (size_t i = 0; i < count; ++i) { | |
| 261 char* cap = SkStrDup(capSuffixes[i]); | |
| 262 for (size_t j = 0; j < strlen(cap); ++j) { | |
| 263 cap[j] = toupper(cap[j]); | |
| 264 } | |
| 265 capSuffixes[i] = cap; | |
| 266 } | |
| 267 find_files(FLAGS_images[0], capSuffixes.begin(), count, &images); | |
| 268 for (size_t i = 0; i < count; ++i) { | |
| 269 sk_free(const_cast<char*>(capSuffixes[i])); | |
| 270 } | |
| 254 } | 271 } |
| 255 | 272 |
| 256 SkDebugf("%d GMs x %d configs, %d tests, %d pictures, %d images\n", | 273 SkDebugf("%d GMs x %d configs, %d tests, %d pictures, %d images\n", |
| 257 gms.count(), configs.count(), tests.count(), skps.count(), images.c ount()); | 274 gms.count(), configs.count(), tests.count(), skps.count(), images.c ount()); |
| 258 DM::Reporter reporter; | 275 DM::Reporter reporter; |
| 259 | 276 |
| 260 DM::TaskRunner tasks; | 277 DM::TaskRunner tasks; |
| 261 kick_off_tests(tests, &reporter, &tasks); | 278 kick_off_tests(tests, &reporter, &tasks); |
| 262 kick_off_gms(gms, configs, gpuAPI, &reporter, &tasks); | 279 kick_off_gms(gms, configs, gpuAPI, &reporter, &tasks); |
| 263 kick_off_skps(skps, &reporter, &tasks); | 280 kick_off_skps(skps, &reporter, &tasks); |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 278 report_failures(failures); | 295 report_failures(failures); |
| 279 return failures.count() > 0; | 296 return failures.count() > 0; |
| 280 } | 297 } |
| 281 | 298 |
| 282 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 299 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
| 283 int main(int argc, char** argv) { | 300 int main(int argc, char** argv) { |
| 284 SkCommandLineFlags::Parse(argc, argv); | 301 SkCommandLineFlags::Parse(argc, argv); |
| 285 return dm_main(); | 302 return dm_main(); |
| 286 } | 303 } |
| 287 #endif | 304 #endif |
| OLD | NEW |