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

Unified Diff: dm/DM.cpp

Issue 978823002: Run CodecSrc DM. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove unneeded include. Created 5 years, 9 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 | dm/DMSrcSink.h » ('j') | dm/DMSrcSink.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DM.cpp
diff --git a/dm/DM.cpp b/dm/DM.cpp
index 2e41413b7ec7e093c6bc44e1dc4cb6dd422f795d..d2e811d666b2663da3c5eb40c08d072742067e02 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -18,7 +18,7 @@
#include "Test.h"
#include "Timer.h"
-DEFINE_string(src, "tests gm skp image subset", "Source types to test.");
+DEFINE_string(src, "tests gm skp image subset codec", "Source types to test.");
DEFINE_bool(nameByHash, false,
"If true, write to FLAGS_writePath[0]/<hash>.png instead of "
"to FLAGS_writePath[0]/<config>/<sourceType>/<name>.png");
@@ -127,6 +127,12 @@ static void push_src(const char* tag, Src* s) {
}
}
+static bool codec_supported(const char* ext) {
+ // FIXME: Once other versions of SkCodec are available, we can add them to this
+ // list (and eventually we can remove this check once they are all supported).
+ return strcmp(ext, "png") == 0 || strcmp(ext, "PNG") == 0;
+}
+
static void gather_srcs() {
for (const skiagm::GMRegistry* r = skiagm::GMRegistry::Head(); r; r = r->next()) {
push_src("gm", new GMSrc(r->factory()));
@@ -155,12 +161,16 @@ static void gather_srcs() {
SkString path = SkOSPath::Join(flag, file.c_str());
push_src("image", new ImageSrc(path)); // Decode entire image.
push_src("subset", new ImageSrc(path, 2)); // Decode into 2 x 2 subsets
+ if (codec_supported(exts[j])) {
+ push_src("codec", new CodecSrc(path)); // Decode with SkCodec.
+ }
}
}
} else if (sk_exists(flag)) {
// assume that FLAGS_images[i] is a valid image if it is a file.
push_src("image", new ImageSrc(flag)); // Decode entire image.
push_src("subset", new ImageSrc(flag, 2)); // Decode into 2 x 2 subsets
+ push_src("codec", new CodecSrc(flag)); // Decode with SkCodec.
mtklein 2015/03/17 20:24:15 Want to check the extension here too?
scroggo 2015/03/19 12:57:54 I thought about it, but this case is different: We
}
}
}
« no previous file with comments | « no previous file | dm/DMSrcSink.h » ('j') | dm/DMSrcSink.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698