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

Side by Side Diff: tools/VisualBench/VisualBenchmarkStream.cpp

Issue 1234123004: Match works correctly on visualbench (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks Created 5 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 | « tools/VisualBench/VisualBenchmarkStream.h ('k') | 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 2015 Google Inc. 2 * Copyright 2015 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 8
9 #include <VisualBench/VisualBenchmarkStream.h> 9 #include <VisualBench/VisualBenchmarkStream.h>
10 #include "GMBench.h" 10 #include "GMBench.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 pic->reset(SkPicture::CreateFromStream(stream.get())); 59 pic->reset(SkPicture::CreateFromStream(stream.get()));
60 if (pic->get() == NULL) { 60 if (pic->get() == NULL) {
61 SkDebugf("Could not read %s as an SkPicture.\n", path); 61 SkDebugf("Could not read %s as an SkPicture.\n", path);
62 return false; 62 return false;
63 } 63 }
64 return true; 64 return true;
65 } 65 }
66 66
67 Benchmark* VisualBenchmarkStream::next() { 67 Benchmark* VisualBenchmarkStream::next() {
68 Benchmark* bench;
69 // skips non matching benches
70 while ((bench = this->innerNext()) &&
71 SkCommandLineFlags::ShouldSkip(FLAGS_match, bench->getUniqueName())) {
72 }
73 return bench;
74 }
75
76 Benchmark* VisualBenchmarkStream::innerNext() {
68 while (fBenches) { 77 while (fBenches) {
69 Benchmark* bench = fBenches->factory()(NULL); 78 Benchmark* bench = fBenches->factory()(NULL);
70 fBenches = fBenches->next(); 79 fBenches = fBenches->next();
71 if (bench->isVisual()) { 80 if (bench->isVisual()) {
72 fSourceType = "bench"; 81 fSourceType = "bench";
73 fBenchType = "micro"; 82 fBenchType = "micro";
74 return bench; 83 return bench;
75 } 84 }
76 } 85 }
77 86
(...skipping 16 matching lines...) Expand all
94 } 103 }
95 104
96 SkString name = SkOSPath::Basename(path.c_str()); 105 SkString name = SkOSPath::Basename(path.c_str());
97 fSourceType = "skp"; 106 fSourceType = "skp";
98 fBenchType = "playback"; 107 fBenchType = "playback";
99 return SkNEW_ARGS(VisualSKPBench, (name.c_str(), pic.get())); 108 return SkNEW_ARGS(VisualSKPBench, (name.c_str(), pic.get()));
100 } 109 }
101 110
102 return NULL; 111 return NULL;
103 } 112 }
OLDNEW
« no previous file with comments | « tools/VisualBench/VisualBenchmarkStream.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698