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 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 SkDebugf("Can't parse %s from --zoom as a zoomMax,zoomPeriodMs.\n",
FLAGS_zoom[0]); | 596 SkDebugf("Can't parse %s from --zoom as a zoomMax,zoomPeriodMs.\n",
FLAGS_zoom[0]); |
597 exit(1); | 597 exit(1); |
598 } | 598 } |
599 | 599 |
600 if (FLAGS_mpd) { | 600 if (FLAGS_mpd) { |
601 fUseMPDs.push_back() = true; | 601 fUseMPDs.push_back() = true; |
602 } | 602 } |
603 fUseMPDs.push_back() = false; | 603 fUseMPDs.push_back() = false; |
604 | 604 |
605 // Prepare the images for decoding | 605 // Prepare the images for decoding |
606 if (!CollectImages(&fImages)) { | 606 for (int i = 0; i < FLAGS_images.count(); i++) { |
607 exit(1); | 607 const char* flag = FLAGS_images[i]; |
| 608 if (sk_isdir(flag)) { |
| 609 // If the value passed in is a directory, add all the images |
| 610 SkOSFile::Iter it(flag); |
| 611 SkString file; |
| 612 while (it.next(&file)) { |
| 613 fImages.push_back() = SkOSPath::Join(flag, file.c_str()); |
| 614 } |
| 615 } else if (sk_exists(flag)) { |
| 616 // Also add the value if it is a single image |
| 617 fImages.push_back() = flag; |
| 618 } |
608 } | 619 } |
609 | 620 |
610 // Choose the candidate color types for image decoding | 621 // Choose the candidate color types for image decoding |
611 const SkColorType colorTypes[] = | 622 const SkColorType colorTypes[] = |
612 { kN32_SkColorType, | 623 { kN32_SkColorType, |
613 kRGB_565_SkColorType, | 624 kRGB_565_SkColorType, |
614 kAlpha_8_SkColorType, | 625 kAlpha_8_SkColorType, |
615 kIndex_8_SkColorType, | 626 kIndex_8_SkColorType, |
616 kGray_8_SkColorType }; | 627 kGray_8_SkColorType }; |
617 fColorTypes.reset(colorTypes, SK_ARRAY_COUNT(colorTypes)); | 628 fColorTypes.reset(colorTypes, SK_ARRAY_COUNT(colorTypes)); |
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1227 | 1238 |
1228 return 0; | 1239 return 0; |
1229 } | 1240 } |
1230 | 1241 |
1231 #if !defined SK_BUILD_FOR_IOS | 1242 #if !defined SK_BUILD_FOR_IOS |
1232 int main(int argc, char** argv) { | 1243 int main(int argc, char** argv) { |
1233 SkCommandLineFlags::Parse(argc, argv); | 1244 SkCommandLineFlags::Parse(argc, argv); |
1234 return nanobench_main(); | 1245 return nanobench_main(); |
1235 } | 1246 } |
1236 #endif | 1247 #endif |
OLD | NEW |