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

Unified Diff: dm/DM.cpp

Issue 978823002: Run CodecSrc DM. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Respond to comments. 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') | no next file with comments »
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 f2b0dfdfcbd7c1e22e0ca761622ba833fdf78246..109a00de442e9f277fcd0d8276ed2e8ee659ac62 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");
@@ -148,6 +148,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()));
@@ -176,12 +182,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.
}
}
}
« no previous file with comments | « no previous file | dm/DMSrcSink.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698