Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Side by Side Diff: bench/nanobench.cpp

Issue 1611323004: Treat bad values passed to --images as a fatal error (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | dm/DM.cpp » ('j') | dm/DM.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 if (!CollectImages(&fImages)) {
609 const char* flag = FLAGS_images[i]; 609 exit(1);
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 } 610 }
622 611
623 // Choose the candidate color types for image decoding 612 // Choose the candidate color types for image decoding
624 const SkColorType colorTypes[] = 613 const SkColorType colorTypes[] =
625 { kN32_SkColorType, 614 { kN32_SkColorType,
626 kRGB_565_SkColorType, 615 kRGB_565_SkColorType,
627 kAlpha_8_SkColorType, 616 kAlpha_8_SkColorType,
628 kIndex_8_SkColorType, 617 kIndex_8_SkColorType,
629 kGray_8_SkColorType }; 618 kGray_8_SkColorType };
630 fColorTypes.reset(colorTypes, SK_ARRAY_COUNT(colorTypes)); 619 fColorTypes.reset(colorTypes, SK_ARRAY_COUNT(colorTypes));
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after
1264 1253
1265 return 0; 1254 return 0;
1266 } 1255 }
1267 1256
1268 #if !defined SK_BUILD_FOR_IOS 1257 #if !defined SK_BUILD_FOR_IOS
1269 int main(int argc, char** argv) { 1258 int main(int argc, char** argv) {
1270 SkCommandLineFlags::Parse(argc, argv); 1259 SkCommandLineFlags::Parse(argc, argv);
1271 return nanobench_main(); 1260 return nanobench_main();
1272 } 1261 }
1273 #endif 1262 #endif
OLDNEW
« no previous file with comments | « no previous file | dm/DM.cpp » ('j') | dm/DM.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698