Index: tools/render_pictures_main.cpp |
diff --git a/tools/render_pictures_main.cpp b/tools/render_pictures_main.cpp |
index f11eb0b80ee05fed4c4c17f9037e0a9b438b5f1a..e714c290a49454ec9a4f237c84bafed37bf17b1a 100644 |
--- a/tools/render_pictures_main.cpp |
+++ b/tools/render_pictures_main.cpp |
@@ -29,6 +29,7 @@ DECLARE_bool(deferImageDecoding); |
DEFINE_int32(maxComponentDiff, 256, "Maximum diff on a component, 0 - 256. Components that differ " |
"by more than this amount are considered errors, though all diffs are reported. " |
"Requires --validate."); |
+DEFINE_string(readJsonSummaryPath, "", "JSON file to read image expectations from."); |
DECLARE_string(readPath); |
DEFINE_bool(writeChecksumBasedFilenames, false, |
"When writing out images, use checksum-based filenames."); |
@@ -346,9 +347,10 @@ static bool render_picture(const SkString& inputPath, const SkString* outputDir, |
outputPath.append(".png"); |
if (NULL != jsonSummaryPtr) { |
+ sk_tools::ImageDigest imageDigest(*bitmap); |
SkString outputFileBasename; |
sk_tools::get_basename(&outputFileBasename, outputPath); |
- jsonSummaryPtr->add(inputFilename.c_str(), outputFileBasename.c_str(), *bitmap); |
+ jsonSummaryPtr->add(inputFilename.c_str(), outputFileBasename.c_str(), imageDigest); |
} |
if (NULL != outputDir) { |
@@ -451,6 +453,9 @@ int tool_main(int argc, char** argv) { |
sk_tools::ImageResultsSummary* jsonSummaryPtr = NULL; |
if (FLAGS_writeJsonSummaryPath.count() == 1) { |
jsonSummaryPtr = &jsonSummary; |
+ if (FLAGS_readJsonSummaryPath.count() == 1) { |
+ SkASSERT(jsonSummary.readExpectationsFile(FLAGS_readJsonSummaryPath[0])); |
+ } |
} |
int failures = 0; |