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

Side by Side Diff: dm/DM.cpp

Issue 872993005: dm: allow multiple --images flags, allow single files (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include "CrashHandler.h" 1 #include "CrashHandler.h"
2 #include "DMJsonWriter.h" 2 #include "DMJsonWriter.h"
3 #include "DMSrcSink.h" 3 #include "DMSrcSink.h"
4 #include "OverwriteLine.h" 4 #include "OverwriteLine.h"
5 #include "ProcStats.h" 5 #include "ProcStats.h"
6 #include "SkBBHFactory.h" 6 #include "SkBBHFactory.h"
7 #include "SkChecksum.h" 7 #include "SkChecksum.h"
8 #include "SkCommonFlags.h" 8 #include "SkCommonFlags.h"
9 #include "SkForceLinking.h" 9 #include "SkForceLinking.h"
10 #include "SkGraphics.h" 10 #include "SkGraphics.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 const char* path = FLAGS_skps[i]; 126 const char* path = FLAGS_skps[i];
127 if (sk_isdir(path)) { 127 if (sk_isdir(path)) {
128 SkOSFile::Iter it(path, "skp"); 128 SkOSFile::Iter it(path, "skp");
129 for (SkString file; it.next(&file); ) { 129 for (SkString file; it.next(&file); ) {
130 push_src("skp", new SKPSrc(SkOSPath::Join(path, file.c_str()))); 130 push_src("skp", new SKPSrc(SkOSPath::Join(path, file.c_str())));
131 } 131 }
132 } else { 132 } else {
133 push_src("skp", new SKPSrc(SkString(path))); 133 push_src("skp", new SKPSrc(SkString(path)));
134 } 134 }
135 } 135 }
136 if (!FLAGS_images.isEmpty()) { 136 static const char* const exts[] = {
137 const char* exts[] = { 137 "bmp", "gif", "jpg", "jpeg", "png", "webp", "ktx", "astc", "wbmp", "ico" ,
138 "bmp", "gif", "jpg", "jpeg", "png", "webp", "ktx", "astc", "wbmp", " ico", 138 "BMP", "GIF", "JPG", "JPEG", "PNG", "WEBP", "KTX", "ASTC", "WBMP", "ICO" ,
139 "BMP", "GIF", "JPG", "JPEG", "PNG", "WEBP", "KTX", "ASTC", "WBMP", " ICO", 139 };
140 }; 140 for (int i = 0; i < FLAGS_images.count(); i++) {
141 for (size_t i = 0; i < SK_ARRAY_COUNT(exts); i++) { 141 const char* flag = FLAGS_images[i];
scroggo 2015/01/30 17:57:22 nit: flag -> path
142 SkOSFile::Iter it(FLAGS_images[0], exts[i]); 142 if (sk_isdir(flag)) {
scroggo 2015/01/30 17:57:22 I was trying to imagine how to make this share cod
143 for (SkString file; it.next(&file); ) { 143 for (size_t j = 0; j < SK_ARRAY_COUNT(exts); j++) {
144 SkString path = SkOSPath::Join(FLAGS_images[0], file.c_str()); 144 SkOSFile::Iter it(flag, exts[j]);
145 push_src("image", new ImageSrc(path)); // Decode entire imag e. 145 for (SkString file; it.next(&file); ) {
146 push_src("image", new ImageSrc(path, 5)); // Decode 5 random su bsets. 146 SkString path = SkOSPath::Join(flag, file.c_str());
147 push_src("image", new ImageSrc(path)); // Decode entire image.
148 push_src("image", new ImageSrc(path, 5)); // Decode 5 rando m subsets.
149 }
147 } 150 }
151 } else if (sk_exists(flag)) {
152 // assume that FLAGS_images[i] is a valid image if it is a file.
153 push_src("image", new ImageSrc(SkString(flag))); // Decode entir e image.
154 push_src("image", new ImageSrc(SkString(flag), 5)); // Decode 5 ran dom subsets.
148 } 155 }
149 } 156 }
150 } 157 }
151 158
152 static GrGLStandard get_gpu_api() { 159 static GrGLStandard get_gpu_api() {
153 if (FLAGS_gpuAPI.contains("gl")) { return kGL_GrGLStandard; } 160 if (FLAGS_gpuAPI.contains("gl")) { return kGL_GrGLStandard; }
154 if (FLAGS_gpuAPI.contains("gles")) { return kGLES_GrGLStandard; } 161 if (FLAGS_gpuAPI.contains("gles")) { return kGLES_GrGLStandard; }
155 return kNone_GrGLStandard; 162 return kNone_GrGLStandard;
156 } 163 }
157 164
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 } 542 }
536 return 0; 543 return 0;
537 } 544 }
538 545
539 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) 546 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL)
540 int main(int argc, char** argv) { 547 int main(int argc, char** argv) {
541 SkCommandLineFlags::Parse(argc, argv); 548 SkCommandLineFlags::Parse(argc, argv);
542 return dm_main(); 549 return dm_main();
543 } 550 }
544 #endif 551 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698