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

Side by Side Diff: bench/nanobench.cpp

Issue 1653543002: Revert of Treat bad values passed to --images as a fatal error (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 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') | no next file with comments »
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 585 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « no previous file | dm/DM.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698