Index: tools/render_pictures_main.cpp |
diff --git a/tools/render_pictures_main.cpp b/tools/render_pictures_main.cpp |
index 1bc4d21e33098edc3cb5a0f06f9b3fdce9a99bfc..2d17c2a52631a7d9090f156d2c5ffc76ac24cf45 100644 |
--- a/tools/render_pictures_main.cpp |
+++ b/tools/render_pictures_main.cpp |
@@ -31,6 +31,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."); |
@@ -348,9 +349,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) { |
@@ -453,6 +455,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; |