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

Side by Side Diff: tools/viewer/Viewer.cpp

Issue 2144643002: Respect --match for samples and jpgs in viewer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 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 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 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 "Viewer.h" 8 #include "Viewer.h"
9 9
10 #include "GMSlide.h" 10 #include "GMSlide.h"
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 for (int i = 0; i < fSlides.count()/2; ++i) { 211 for (int i = 0; i < fSlides.count()/2; ++i) {
212 sk_sp<Slide> temp = fSlides[i]; 212 sk_sp<Slide> temp = fSlides[i];
213 fSlides[i] = fSlides[fSlides.count() - i - 1]; 213 fSlides[i] = fSlides[fSlides.count() - i - 1];
214 fSlides[fSlides.count() - i - 1] = temp; 214 fSlides[fSlides.count() - i - 1] = temp;
215 } 215 }
216 216
217 // samples 217 // samples
218 const SkViewRegister* reg = SkViewRegister::Head(); 218 const SkViewRegister* reg = SkViewRegister::Head();
219 while (reg) { 219 while (reg) {
220 sk_sp<Slide> slide(new SampleSlide(reg->factory())); 220 sk_sp<Slide> slide(new SampleSlide(reg->factory()));
221 fSlides.push_back(slide); 221 if (!SkCommandLineFlags::ShouldSkip(FLAGS_match, slide->getName().c_str( ))) {
222 fSlides.push_back(slide);
223 }
222 reg = reg->next(); 224 reg = reg->next();
223 } 225 }
224 226
225 // SKPs 227 // SKPs
226 for (int i = 0; i < FLAGS_skps.count(); i++) { 228 for (int i = 0; i < FLAGS_skps.count(); i++) {
227 if (SkStrEndsWith(FLAGS_skps[i], ".skp")) { 229 if (SkStrEndsWith(FLAGS_skps[i], ".skp")) {
228 if (SkCommandLineFlags::ShouldSkip(FLAGS_match, FLAGS_skps[i])) { 230 if (SkCommandLineFlags::ShouldSkip(FLAGS_match, FLAGS_skps[i])) {
229 continue; 231 continue;
230 } 232 }
231 233
(...skipping 17 matching lines...) Expand all
249 } 251 }
250 } 252 }
251 } 253 }
252 } 254 }
253 255
254 // JPGs 256 // JPGs
255 for (int i = 0; i < FLAGS_jpgs.count(); i++) { 257 for (int i = 0; i < FLAGS_jpgs.count(); i++) {
256 SkOSFile::Iter it(FLAGS_jpgs[i], ".jpg"); 258 SkOSFile::Iter it(FLAGS_jpgs[i], ".jpg");
257 SkString jpgName; 259 SkString jpgName;
258 while (it.next(&jpgName)) { 260 while (it.next(&jpgName)) {
261 if (SkCommandLineFlags::ShouldSkip(FLAGS_match, jpgName.c_str())) {
262 continue;
263 }
264
259 SkString path = SkOSPath::Join(FLAGS_jpgs[i], jpgName.c_str()); 265 SkString path = SkOSPath::Join(FLAGS_jpgs[i], jpgName.c_str());
260 sk_sp<ImageSlide> slide(new ImageSlide(jpgName, path)); 266 sk_sp<ImageSlide> slide(new ImageSlide(jpgName, path));
261 if (slide) { 267 if (slide) {
262 fSlides.push_back(slide); 268 fSlides.push_back(slide);
263 } 269 }
264 } 270 }
265 } 271 }
266 } 272 }
267 273
268 274
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 updateUIState(); 608 updateUIState();
603 } 609 }
604 } else if (stateName.equals(kRefreshStateName)) { 610 } else if (stateName.equals(kRefreshStateName)) {
605 // This state is actually NOT in the UI state. 611 // This state is actually NOT in the UI state.
606 // We use this to allow Android to quickly set bool fRefresh. 612 // We use this to allow Android to quickly set bool fRefresh.
607 fRefresh = stateValue.equals(kON); 613 fRefresh = stateValue.equals(kON);
608 } else { 614 } else {
609 SkDebugf("Unknown stateName: %s", stateName.c_str()); 615 SkDebugf("Unknown stateName: %s", stateName.c_str());
610 } 616 }
611 } 617 }
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