зеркало из https://github.com/mozilla/moz-skia.git
If skdiff encounters image size mismatch, do not display diff images
Currently, if skdiff encounters images whose expected and actual dimensions do not match, it will attempt (incorrectly) to display diffs. Better to not display the diffs at all than to display misleading diffs... Review URL: https://codereview.appspot.com/6015049 git-svn-id: http://skia.googlecode.com/svn/trunk@3662 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
Родитель
a707f60874
Коммит
01f78702f1
|
@ -809,6 +809,14 @@ static void print_image_cell (SkFILEWStream* stream,
|
|||
stream->writeText("px\"></a></td>");
|
||||
}
|
||||
|
||||
static void print_text_cell (SkFILEWStream* stream, const char* text) {
|
||||
stream->writeText("<td align=center>");
|
||||
if (NULL != text) {
|
||||
stream->writeText(text);
|
||||
}
|
||||
stream->writeText("</td>");
|
||||
}
|
||||
|
||||
static void print_diff_with_missing_file(SkFILEWStream* stream,
|
||||
DiffRecord& diff,
|
||||
const SkString& relativePath) {
|
||||
|
@ -894,10 +902,17 @@ static void print_diff_page (const int matchCount,
|
|||
int height = compute_image_height(diff->fBaseHeight, diff->fBaseWidth);
|
||||
outputStream.writeText("<tr>\n");
|
||||
print_label_cell(&outputStream, *diff);
|
||||
print_image_cell(&outputStream,
|
||||
filename_to_white_filename(diff->fFilename), height);
|
||||
print_image_cell(&outputStream,
|
||||
filename_to_diff_filename(diff->fFilename), height);
|
||||
if (diff->fDoImageSizesMismatch) {
|
||||
print_text_cell(&outputStream,
|
||||
"[image size mismatch, so no diff to display]");
|
||||
print_text_cell(&outputStream,
|
||||
"[image size mismatch, so no diff to display]");
|
||||
} else {
|
||||
print_image_cell(&outputStream,
|
||||
filename_to_white_filename(diff->fFilename), height);
|
||||
print_image_cell(&outputStream,
|
||||
filename_to_diff_filename(diff->fFilename), height);
|
||||
}
|
||||
print_image_cell(&outputStream, diff->fBasePath, height);
|
||||
print_image_cell(&outputStream, diff->fComparisonPath, height);
|
||||
outputStream.writeText("</tr>\n");
|
||||
|
|
Загрузка…
Ссылка в новой задаче