aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar msarett <msarett@google.com>2016-04-29 09:38:40 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-04-29 09:38:40 -0700
commit69deca8d1e57daec540f8a7f10d9c660b640b9a9 (patch)
treedbf8b6d316f6d0f49373870692ca6e442630b74e /tools
parent1b5dd884546d35ff0909168cbfeafd7f53225a97 (diff)
Add ColorCodecSrc for testing/comparison on color corrected decodes
Diffstat (limited to 'tools')
-rw-r--r--tools/flags/SkCommonFlags.cpp9
-rw-r--r--tools/flags/SkCommonFlags.h16
2 files changed, 14 insertions, 11 deletions
diff --git a/tools/flags/SkCommonFlags.cpp b/tools/flags/SkCommonFlags.cpp
index eb2075c58a..1caffd54d6 100644
--- a/tools/flags/SkCommonFlags.cpp
+++ b/tools/flags/SkCommonFlags.cpp
@@ -18,6 +18,9 @@ DEFINE_bool(gpu, true, "master switch for running GPU-bound work.");
DEFINE_string(images, "", "List of images and/or directories to decode. A directory with no images"
" is treated as a fatal error.");
+DEFINE_string(colorImages, "", "List of images and/or directories to decode with color correction. "
+ "A directory with no images is treated as a fatal error.");
+
DEFINE_string2(match, m, nullptr,
"[~][^]substring[$] [...] of GM name to run.\n"
"Multiple matches may be separated by spaces.\n"
@@ -55,7 +58,7 @@ DEFINE_string(properties, "",
"Space-separated key/value pairs to add to JSON identifying this run.");
DEFINE_bool2(pre_log, p, false, "Log before running each test. May be incomprehensible when threading");
-bool CollectImages(SkTArray<SkString>* output) {
+bool CollectImages(SkCommandLineFlags::StringArray images, SkTArray<SkString>* output) {
SkASSERT(output);
static const char* const exts[] = {
@@ -67,8 +70,8 @@ bool CollectImages(SkTArray<SkString>* output) {
#endif
};
- for (int i = 0; i < FLAGS_images.count(); ++i) {
- const char* flag = FLAGS_images[i];
+ for (int i = 0; i < images.count(); ++i) {
+ const char* flag = images[i];
if (!sk_exists(flag)) {
SkDebugf("%s does not exist!\n", flag);
return false;
diff --git a/tools/flags/SkCommonFlags.h b/tools/flags/SkCommonFlags.h
index c6cbde45ca..ddd0fc89e0 100644
--- a/tools/flags/SkCommonFlags.h
+++ b/tools/flags/SkCommonFlags.h
@@ -16,6 +16,7 @@ DECLARE_bool(cpu);
DECLARE_bool(dryRun);
DECLARE_bool(gpu);
DECLARE_string(images);
+DECLARE_string(colorImages);
DECLARE_string(match);
DECLARE_bool(quiet);
DECLARE_bool(resetGpuContext);
@@ -34,17 +35,16 @@ DECLARE_string(key);
DECLARE_string(properties);
/**
- * Helper to assist in collecting image paths from --images.
+ * Helper to assist in collecting image paths from |dir| specified through a command line flag.
*
- * Populates an array of strings with paths to images to test.
+ * Populates |output|, an array of strings with paths to images to test.
*
- * Returns true if each argument to --images is meaningful:
+ * Returns true if each argument to the images flag is meaningful:
* - If the file/directory does not exist, return false.
- * - If a directory passed to --images does not have any supported images (based on file
- * type), return false.
- * - If a file is passed to --images, assume the user is deliberately testing this image,
- * regardless of file type.
+ * - If |dir| does not have any supported images (based on file type), return false.
+ * - If |dir| is a single file, assume the user is deliberately testing this image,
+ * regardless of file type.
*/
-bool CollectImages(SkTArray<SkString>*);
+bool CollectImages(SkCommandLineFlags::StringArray dir, SkTArray<SkString>* output);
#endif