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

Unified Diff: bench/nanobench.cpp

Issue 1577873002: apply --match to image file names too, like we do for .skps (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: sp 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/nanobench.cpp
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp
index b791ab7db7e22c0e4ae6a27b1a71159d7a2ddcdc..cfac6be7ba4f77d7739446a11e185b9267e8f683 100644
--- a/bench/nanobench.cpp
+++ b/bench/nanobench.cpp
@@ -743,6 +743,9 @@ public:
fSourceType = "image";
fBenchType = "skcodec";
const SkString& path = fImages[fCurrentCodec];
+ if (SkCommandLineFlags::ShouldSkip(FLAGS_match, path.c_str())) {
msarett 2016/01/11 19:55:49 I should have noticed this on my review, but this
scroggo 2016/02/03 15:30:00 Proposed fix in crrev.com/1663103002
+ continue;
+ }
SkAutoTUnref<SkData> encoded(SkData::NewFromFileName(path.c_str()));
SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded));
if (!codec) {
@@ -810,11 +813,14 @@ public:
}
// Run the DecodingBenches
- while (fCurrentImage < fImages.count()) {
+ for (; fCurrentImage < fImages.count(); fCurrentImage++) {
fSourceType = "image";
fBenchType = "skimagedecoder";
+ const SkString& path = fImages[fCurrentImage];
+ if (SkCommandLineFlags::ShouldSkip(FLAGS_match, path.c_str())) {
+ continue;
+ }
while (fCurrentColorType < fColorTypes.count()) {
- const SkString& path = fImages[fCurrentImage];
SkColorType colorType = fColorTypes[fCurrentColorType];
fCurrentColorType++;
// Check if the image decodes to the right color type
@@ -827,7 +833,6 @@ public:
}
}
fCurrentColorType = 0;
- fCurrentImage++;
}
// Run the BRDBenches
@@ -856,12 +861,15 @@ public:
// these tests are sufficient to provide good coverage of our scaling options.
const uint32_t sampleSizes[] = { 1, 2, 4, 8, 16, 32, 64 };
const uint32_t minOutputSize = 512;
- while (fCurrentBRDImage < fImages.count()) {
+ for (; fCurrentBRDImage < fImages.count(); fCurrentBRDImage++) {
+ const SkString& path = fImages[fCurrentBRDImage];
+ if (SkCommandLineFlags::ShouldSkip(FLAGS_match, path.c_str())) {
+ continue;
+ }
while (fCurrentBRDStrategy < (int) SK_ARRAY_COUNT(strategies)) {
fSourceType = "image";
fBenchType = strategies[fCurrentBRDStrategy].fName;
- const SkString& path = fImages[fCurrentBRDImage];
const SkBitmapRegionDecoder::Strategy strategy =
strategies[fCurrentBRDStrategy].fStrategy;
@@ -927,7 +935,6 @@ public:
fCurrentBRDStrategy++;
}
fCurrentBRDStrategy = 0;
- fCurrentBRDImage++;
}
return nullptr;
« 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