From ed01f12d13d3a5d2943c36595bbc70308aac563f Mon Sep 17 00:00:00 2001 From: "jkleinert@google.com" Date: Thu, 30 Aug 2012 22:05:53 +0000 Subject: [PATCH] Adding checkboxes to skdiff output so a user can select a subset of images to rebaseline. BUG=745 Review URL: https://codereview.appspot.com/6497054 git-svn-id: http://skia.googlecode.com/svn/trunk@5360 2bbb7eff-a529-9590-31e7-b0007b416f81 --- tools/skdiff_main.cpp | 37 ++++++++++++++++-- .../skdiff/test1/output-expected/index.html | 38 ++++++++++++++----- 2 files changed, 62 insertions(+), 13 deletions(-) diff --git a/tools/skdiff_main.cpp b/tools/skdiff_main.cpp index 61fd83bbb0..cf83be8bf0 100644 --- a/tools/skdiff_main.cpp +++ b/tools/skdiff_main.cpp @@ -931,6 +931,7 @@ static void print_table_header (SkFILEWStream* stream, bool doOutputDate=false) { stream->writeText("\n"); stream->writeText("\n"); +} + static void print_label_cell (SkFILEWStream* stream, const DiffRecord& diff) { char metricBuf [20]; @@ -1067,6 +1075,7 @@ static void print_diff_with_missing_file(SkFILEWStream* stream, DiffRecord& diff, const SkString& relativePath) { stream->writeText("\n"); + print_checkbox_cell(stream, diff); print_label_cell(stream, diff); stream->writeText(""); stream->writeText(""); @@ -1144,7 +1153,23 @@ static void print_diff_page (const int matchCount, } } - outputStream.writeText("\n\n"); + outputStream.writeText( + "\n\n" + "\n" + "\n\n\n"); print_table_header(&outputStream, matchCount, colorThreshold, differences, baseDir, comparisonDir); int i; @@ -1180,6 +1205,7 @@ static void print_diff_page (const int matchCount, int height = compute_image_height(diff->fBaseHeight, diff->fBaseWidth); outputStream.writeText("\n"); + print_checkbox_cell(&outputStream, *diff); print_label_cell(&outputStream, *diff); print_image_cell(&outputStream, filename_to_white_filename(diff->fFilename), height); @@ -1190,8 +1216,13 @@ static void print_diff_page (const int matchCount, outputStream.writeText("\n"); outputStream.flush(); } - outputStream.writeText("
"); + stream->writeText("select image"); if (doOutputDate) { SkTime::DateTime dt; SkTime::GetDateTime(&dt); @@ -987,6 +988,13 @@ static void print_pixel_count (SkFILEWStream* stream, */ } +static void print_checkbox_cell (SkFILEWStream* stream, + const DiffRecord& diff) { + stream->writeText("writeText(diff.fFilename.c_str()); + stream->writeText("\" checked=\"yes\">
N/AN/A
\n"); - outputStream.writeText("\n\n"); + outputStream.writeText( + "\n" + "\n" + "
\n" + "\n\n"); outputStream.flush(); } diff --git a/tools/tests/skdiff/test1/output-expected/index.html b/tools/tests/skdiff/test1/output-expected/index.html index e749620bc6..ed321e243a 100644 --- a/tools/tests/skdiff/test1/output-expected/index.html +++ b/tools/tests/skdiff/test1/output-expected/index.html @@ -1,32 +1,50 @@ + + + + - + + - + - + - + - + - + - + - + - -
3 of 12 images matched exactly.
select image3 of 12 images matched exactly.
every different pixel shown in white color difference at each pixel baseDir: tools/tests/skdiff/baseDir/ comparisonDir: tools/tests/skdiff/comparisonDir/
missing-files/missing-from-baseDir.png
Missing from baseDir
N/AN/AN/A
missing-files/missing-from-baseDir.png
Missing from baseDir
N/AN/AN/A
missing-files/missing-from-baseDir.xyz
Missing from baseDir
N/AN/AN/AN/A
missing-files/missing-from-baseDir.xyz
Missing from baseDir
N/AN/AN/AN/A
missing-files/missing-from-comparisonDir.png
Missing from comparisonDir
N/AN/AN/A
missing-files/missing-from-comparisonDir.png
Missing from comparisonDir
N/AN/AN/A
missing-files/missing-from-comparisonDir.xyz
Missing from comparisonDir
N/AN/AN/AN/A
missing-files/missing-from-comparisonDir.xyz
Missing from comparisonDir
N/AN/AN/AN/A
different-bits/different-bits-unknown-format.xyz
Files differ; unable to parse one or both files
N/AN/AN/AN/A
different-bits/different-bits-unknown-format.xyz
Files differ; unable to parse one or both files
N/AN/AN/AN/A
different-bits/slightly-different-sizes.png
Image sizes differ
N/AN/A
different-bits/slightly-different-sizes.png
Image sizes differ
N/AN/A
different-bits/very-different-sizes.png
Image sizes differ
N/AN/A
different-bits/very-different-sizes.png
Image sizes differ
N/AN/A
different-bits/very-different-pixels-same-size.png
97.9926% of pixels differ +
different-bits/very-different-pixels-same-size.png
97.9926% of pixels differ ( 42.8911% weighted)
Average color mismatch 89
Max color mismatch 239
different-bits/slightly-different-pixels-same-size.png
0.6630% of pixels differ +
different-bits/slightly-different-pixels-same-size.png
0.6630% of pixels differ ( 0.1904% weighted)
(2164 pixels)
Average color mismatch 0
Max color mismatch 213
+ +