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

Side by Side Diff: tools/render_pictures_main.cpp

Issue 262453002: reland r14391 ('fix contents of render_pictures JSON summary') (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « tools/PictureRenderer.cpp ('k') | tools/tests/render_pictures_test.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "LazyDecodeBitmap.h" 8 #include "LazyDecodeBitmap.h"
9 #include "CopyTilesRenderer.h" 9 #include "CopyTilesRenderer.h"
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 17 matching lines...) Expand all
28 DECLARE_bool(deferImageDecoding); 28 DECLARE_bool(deferImageDecoding);
29 DEFINE_int32(maxComponentDiff, 256, "Maximum diff on a component, 0 - 256. Compo nents that differ " 29 DEFINE_int32(maxComponentDiff, 256, "Maximum diff on a component, 0 - 256. Compo nents that differ "
30 "by more than this amount are considered errors, though all diffs a re reported. " 30 "by more than this amount are considered errors, though all diffs a re reported. "
31 "Requires --validate."); 31 "Requires --validate.");
32 DECLARE_string(readPath); 32 DECLARE_string(readPath);
33 DEFINE_bool(writeChecksumBasedFilenames, false, 33 DEFINE_bool(writeChecksumBasedFilenames, false,
34 "When writing out images, use checksum-based filenames."); 34 "When writing out images, use checksum-based filenames.");
35 DEFINE_bool(writeEncodedImages, false, "Any time the skp contains an encoded ima ge, write it to a " 35 DEFINE_bool(writeEncodedImages, false, "Any time the skp contains an encoded ima ge, write it to a "
36 "file rather than decoding it. Requires writePath to be set. Skips d rawing the full " 36 "file rather than decoding it. Requires writePath to be set. Skips d rawing the full "
37 "skp to a file. Not compatible with deferImageDecoding."); 37 "skp to a file. Not compatible with deferImageDecoding.");
38 DEFINE_string(writeJsonSummaryPath, "", "File to write a JSON summary of image r esults to. " 38 DEFINE_string(writeJsonSummaryPath, "", "File to write a JSON summary of image r esults to.");
39 "TODO(epoger): Currently, this only works if --writePath is also s pecified. " 39 DEFINE_string2(writePath, w, "", "Directory to write the rendered images into.") ;
40 "See https://code.google.com/p/skia/issues/detail?id=2043 .");
41 DEFINE_string2(writePath, w, "", "Directory to write the rendered images.");
42 DEFINE_bool(writeWholeImage, false, "In tile mode, write the entire rendered ima ge to a " 40 DEFINE_bool(writeWholeImage, false, "In tile mode, write the entire rendered ima ge to a "
43 "file, instead of an image for each tile."); 41 "file, instead of an image for each tile.");
44 DEFINE_bool(validate, false, "Verify that the rendered image contains the same p ixels as " 42 DEFINE_bool(validate, false, "Verify that the rendered image contains the same p ixels as "
45 "the picture rendered in simple mode. When used in conjunction with --bbh, results " 43 "the picture rendered in simple mode. When used in conjunction with --bbh, results "
46 "are validated against the picture rendered in the same mode, but wi thout the bbh."); 44 "are validated against the picture rendered in the same mode, but wi thout the bbh.");
47 45
48 DEFINE_bool(bench_record, false, "If true, drop into an infinite loop of recordi ng the picture."); 46 DEFINE_bool(bench_record, false, "If true, drop into an infinite loop of recordi ng the picture.");
49 47
50 DEFINE_bool(preprocess, false, "If true, perform device specific preprocessing b efore rendering."); 48 DEFINE_bool(preprocess, false, "If true, perform device specific preprocessing b efore rendering.");
51 49
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 for (int i = 1; i <= 255; ++i) { 332 for (int i = 1; i <= 255; ++i) {
335 if(diffs[i] > 0) { 333 if(diffs[i] > 0) {
336 SkDebugf("Number of pixels with max diff of %i is %i\n", i, diff s[i]); 334 SkDebugf("Number of pixels with max diff of %i is %i\n", i, diff s[i]);
337 } 335 }
338 } 336 }
339 } 337 }
340 338
341 if (FLAGS_writeWholeImage) { 339 if (FLAGS_writeWholeImage) {
342 sk_tools::force_all_opaque(*bitmap); 340 sk_tools::force_all_opaque(*bitmap);
343 341
344 // TODO(epoger): It would be better for the filename (without outputDir) to be passed in
345 // here, and used both for the checksum file and writing into outputDir.
346 SkString inputFilename, outputPath; 342 SkString inputFilename, outputPath;
347 sk_tools::get_basename(&inputFilename, inputPath); 343 sk_tools::get_basename(&inputFilename, inputPath);
348 sk_tools::make_filepath(&outputPath, *outputDir, inputFilename); 344 sk_tools::make_filepath(&outputPath, *outputDir, inputFilename);
349 sk_tools::replace_char(&outputPath, '.', '_'); 345 sk_tools::replace_char(&outputPath, '.', '_');
350 outputPath.append(".png"); 346 outputPath.append(".png");
351 347
352 if (NULL != jsonSummaryPtr) { 348 if (NULL != jsonSummaryPtr) {
353 SkString outputFileBasename; 349 SkString outputFileBasename;
354 sk_tools::get_basename(&outputFileBasename, outputPath); 350 sk_tools::get_basename(&outputFileBasename, outputPath);
355 jsonSummaryPtr->add(inputFilename.c_str(), outputFileBasename.c_str( ), *bitmap); 351 jsonSummaryPtr->add(inputFilename.c_str(), outputFileBasename.c_str( ), *bitmap);
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 jsonSummary.writeToFile(FLAGS_writeJsonSummaryPath[0]); 476 jsonSummary.writeToFile(FLAGS_writeJsonSummaryPath[0]);
481 } 477 }
482 return 0; 478 return 0;
483 } 479 }
484 480
485 #if !defined SK_BUILD_FOR_IOS 481 #if !defined SK_BUILD_FOR_IOS
486 int main(int argc, char * const argv[]) { 482 int main(int argc, char * const argv[]) {
487 return tool_main(argc, (char**) argv); 483 return tool_main(argc, (char**) argv);
488 } 484 }
489 #endif 485 #endif
OLDNEW
« no previous file with comments | « tools/PictureRenderer.cpp ('k') | tools/tests/render_pictures_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698