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

Unified Diff: tools/render_pictures_main.cpp

Issue 261313004: add --readJsonSummaryPath to render_pictures (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: split out SkDataUtils.[h,cpp] Created 6 years, 7 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
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;

Powered by Google App Engine
This is Rietveld 408576698