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

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: Another gyp fix 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 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 for (int i = 0; i < FLAGS_images.count(); i++) { 606 if (!CollectImages(&fImages)) {
607 const char* flag = FLAGS_images[i]; 607 exit(1);
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 }
619 } 608 }
620 609
621 // Choose the candidate color types for image decoding 610 // Choose the candidate color types for image decoding
622 const SkColorType colorTypes[] = 611 const SkColorType colorTypes[] =
623 { kN32_SkColorType, 612 { kN32_SkColorType,
624 kRGB_565_SkColorType, 613 kRGB_565_SkColorType,
625 kAlpha_8_SkColorType, 614 kAlpha_8_SkColorType,
626 kIndex_8_SkColorType, 615 kIndex_8_SkColorType,
627 kGray_8_SkColorType }; 616 kGray_8_SkColorType };
628 fColorTypes.reset(colorTypes, SK_ARRAY_COUNT(colorTypes)); 617 fColorTypes.reset(colorTypes, SK_ARRAY_COUNT(colorTypes));
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after
1238 1227
1239 return 0; 1228 return 0;
1240 } 1229 }
1241 1230
1242 #if !defined SK_BUILD_FOR_IOS 1231 #if !defined SK_BUILD_FOR_IOS
1243 int main(int argc, char** argv) { 1232 int main(int argc, char** argv) {
1244 SkCommandLineFlags::Parse(argc, argv); 1233 SkCommandLineFlags::Parse(argc, argv);
1245 return nanobench_main(); 1234 return nanobench_main();
1246 } 1235 }
1247 #endif 1236 #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