| 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 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 SkDebugf("Can't parse %s from --zoom as a zoomMax,zoomPeriodMs.\n",
FLAGS_zoom[0]); | 598 SkDebugf("Can't parse %s from --zoom as a zoomMax,zoomPeriodMs.\n",
FLAGS_zoom[0]); |
| 599 exit(1); | 599 exit(1); |
| 600 } | 600 } |
| 601 | 601 |
| 602 if (FLAGS_mpd) { | 602 if (FLAGS_mpd) { |
| 603 fUseMPDs.push_back() = true; | 603 fUseMPDs.push_back() = true; |
| 604 } | 604 } |
| 605 fUseMPDs.push_back() = false; | 605 fUseMPDs.push_back() = false; |
| 606 | 606 |
| 607 // Prepare the images for decoding | 607 // Prepare the images for decoding |
| 608 for (int i = 0; i < FLAGS_images.count(); i++) { | 608 SkCommonFlags::collectImages(&fImages); |
| 609 const char* flag = FLAGS_images[i]; | |
| 610 if (sk_isdir(flag)) { | |
| 611 // If the value passed in is a directory, add all the images | |
| 612 SkOSFile::Iter it(flag); | |
| 613 SkString file; | |
| 614 while (it.next(&file)) { | |
| 615 fImages.push_back() = SkOSPath::Join(flag, file.c_str()); | |
| 616 } | |
| 617 } else if (sk_exists(flag)) { | |
| 618 // Also add the value if it is a single image | |
| 619 fImages.push_back() = flag; | |
| 620 } | |
| 621 } | |
| 622 | 609 |
| 623 // Choose the candidate color types for image decoding | 610 // Choose the candidate color types for image decoding |
| 624 const SkColorType colorTypes[] = | 611 const SkColorType colorTypes[] = |
| 625 { kN32_SkColorType, | 612 { kN32_SkColorType, |
| 626 kRGB_565_SkColorType, | 613 kRGB_565_SkColorType, |
| 627 kAlpha_8_SkColorType, | 614 kAlpha_8_SkColorType, |
| 628 kIndex_8_SkColorType, | 615 kIndex_8_SkColorType, |
| 629 kGray_8_SkColorType }; | 616 kGray_8_SkColorType }; |
| 630 fColorTypes.reset(colorTypes, SK_ARRAY_COUNT(colorTypes)); | 617 fColorTypes.reset(colorTypes, SK_ARRAY_COUNT(colorTypes)); |
| 631 } | 618 } |
| (...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1258 | 1245 |
| 1259 return 0; | 1246 return 0; |
| 1260 } | 1247 } |
| 1261 | 1248 |
| 1262 #if !defined SK_BUILD_FOR_IOS | 1249 #if !defined SK_BUILD_FOR_IOS |
| 1263 int main(int argc, char** argv) { | 1250 int main(int argc, char** argv) { |
| 1264 SkCommandLineFlags::Parse(argc, argv); | 1251 SkCommandLineFlags::Parse(argc, argv); |
| 1265 return nanobench_main(); | 1252 return nanobench_main(); |
| 1266 } | 1253 } |
| 1267 #endif | 1254 #endif |
| OLD | NEW |