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 "nanobench.h" | 10 #include "nanobench.h" |
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 SkDebugf("Can't parse %s from --zoom as a zoomMax,zoomPeriodMs.\n",
FLAGS_zoom[0]); | 574 SkDebugf("Can't parse %s from --zoom as a zoomMax,zoomPeriodMs.\n",
FLAGS_zoom[0]); |
575 exit(1); | 575 exit(1); |
576 } | 576 } |
577 | 577 |
578 if (FLAGS_mpd) { | 578 if (FLAGS_mpd) { |
579 fUseMPDs.push_back() = true; | 579 fUseMPDs.push_back() = true; |
580 } | 580 } |
581 fUseMPDs.push_back() = false; | 581 fUseMPDs.push_back() = false; |
582 | 582 |
583 // Prepare the images for decoding | 583 // Prepare the images for decoding |
584 for (int i = 0; i < FLAGS_images.count(); i++) { | 584 if (!CollectImages(&fImages)) { |
585 const char* flag = FLAGS_images[i]; | 585 exit(1); |
586 if (sk_isdir(flag)) { | |
587 // If the value passed in is a directory, add all the images | |
588 SkOSFile::Iter it(flag); | |
589 SkString file; | |
590 while (it.next(&file)) { | |
591 fImages.push_back() = SkOSPath::Join(flag, file.c_str()); | |
592 } | |
593 } else if (sk_exists(flag)) { | |
594 // Also add the value if it is a single image | |
595 fImages.push_back() = flag; | |
596 } | |
597 } | 586 } |
598 | 587 |
599 // Choose the candidate color types for image decoding | 588 // Choose the candidate color types for image decoding |
600 const SkColorType colorTypes[] = | 589 const SkColorType colorTypes[] = |
601 { kN32_SkColorType, | 590 { kN32_SkColorType, |
602 kRGB_565_SkColorType, | 591 kRGB_565_SkColorType, |
603 kAlpha_8_SkColorType, | 592 kAlpha_8_SkColorType, |
604 kIndex_8_SkColorType, | 593 kIndex_8_SkColorType, |
605 kGray_8_SkColorType }; | 594 kGray_8_SkColorType }; |
606 fColorTypes.reset(colorTypes, SK_ARRAY_COUNT(colorTypes)); | 595 fColorTypes.reset(colorTypes, SK_ARRAY_COUNT(colorTypes)); |
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1216 | 1205 |
1217 return 0; | 1206 return 0; |
1218 } | 1207 } |
1219 | 1208 |
1220 #if !defined SK_BUILD_FOR_IOS | 1209 #if !defined SK_BUILD_FOR_IOS |
1221 int main(int argc, char** argv) { | 1210 int main(int argc, char** argv) { |
1222 SkCommandLineFlags::Parse(argc, argv); | 1211 SkCommandLineFlags::Parse(argc, argv); |
1223 return nanobench_main(); | 1212 return nanobench_main(); |
1224 } | 1213 } |
1225 #endif | 1214 #endif |
OLD | NEW |