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

Unified Diff: tools/skpdiff/skpdiff_main.cpp

Issue 325413003: rebaseline_server: use just skpdiff, not Python Image Library (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: attempt to fix "'abs' : ambiguous call to overloaded function" on Windows Created 6 years, 6 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 | « tools/skpdiff/SkPMetric.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/skpdiff/skpdiff_main.cpp
diff --git a/tools/skpdiff/skpdiff_main.cpp b/tools/skpdiff/skpdiff_main.cpp
index b1bf9173c7c5fad03e6d30aa23f12f17d3a34afe..3d1bcda0f475159b3c36c203ffa0487c8dac4658 100644
--- a/tools/skpdiff/skpdiff_main.cpp
+++ b/tools/skpdiff/skpdiff_main.cpp
@@ -5,6 +5,11 @@
* found in the LICENSE file.
*/
+// TODO(djsollen): Rename this whole package (perhaps to "SkMultiDiffer").
+// It's not just for "pdiff" (perceptual diffs)--it's a harness that allows
+// the execution of an arbitrary set of difference algorithms.
+// See http://skbug.com/2711 ('rename skpdiff')
+
#if SK_SUPPORT_OPENCL
#define __NO_STD_VECTOR // Uses cl::vectpr instead of std::vectpr
@@ -37,10 +42,12 @@ DEFINE_bool2(list, l, false, "List out available differs");
DEFINE_string2(differs, d, "", "The names of the differs to use or all of them by default");
DEFINE_string2(folders, f, "", "Compare two folders with identical subfile names: <baseline folder> <test folder>");
DEFINE_string2(patterns, p, "", "Use two patterns to compare images: <baseline> <test>");
-DEFINE_string2(output, o, "", "Writes the output of these diffs to output: <output>");
-DEFINE_string(alphaDir, "", "Writes the alpha mask of these diffs to output: <output>");
+DEFINE_string2(output, o, "", "Writes a JSON summary of these diffs to file: <filepath>");
+DEFINE_string(alphaDir, "", "If the differ can generate an alpha mask, write it into directory: <dirpath>");
+DEFINE_string(rgbDiffDir, "", "If the differ can generate an image showing the RGB diff at each pixel, write it into directory: <dirpath>");
+DEFINE_string(whiteDiffDir, "", "If the differ can generate an image showing every changed pixel in white, write it into directory: <dirpath>");
DEFINE_bool(jsonp, true, "Output JSON with padding");
-DEFINE_string(csv, "", "Writes the output of these diffs to a csv file");
+DEFINE_string(csv, "", "Writes the output of these diffs to a csv file: <filepath>");
DEFINE_int32(threads, -1, "run N threads in parallel [default is derived from CPUs available]");
#if SK_SUPPORT_OPENCL
@@ -193,12 +200,30 @@ int tool_main(int argc, char * argv[]) {
return 1;
}
}
+ if (!FLAGS_rgbDiffDir.isEmpty()) {
+ if (1 != FLAGS_rgbDiffDir.count()) {
+ SkDebugf("rgbDiffDir flag expects one argument: <directory>\n");
+ return 1;
+ }
+ }
+ if (!FLAGS_whiteDiffDir.isEmpty()) {
+ if (1 != FLAGS_whiteDiffDir.count()) {
+ SkDebugf("whiteDiffDir flag expects one argument: <directory>\n");
+ return 1;
+ }
+ }
SkDiffContext ctx;
ctx.setDiffers(chosenDiffers);
if (!FLAGS_alphaDir.isEmpty()) {
- ctx.setDifferenceDir(SkString(FLAGS_alphaDir[0]));
+ ctx.setAlphaMaskDir(SkString(FLAGS_alphaDir[0]));
+ }
+ if (!FLAGS_rgbDiffDir.isEmpty()) {
+ ctx.setRgbDiffDir(SkString(FLAGS_rgbDiffDir[0]));
+ }
+ if (!FLAGS_whiteDiffDir.isEmpty()) {
+ ctx.setWhiteDiffDir(SkString(FLAGS_whiteDiffDir[0]));
}
if (FLAGS_threads >= 0) {
« no previous file with comments | « tools/skpdiff/SkPMetric.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698