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

Unified Diff: gm/gmmain.cpp

Issue 17365002: GM: add --writeChecksumBasedFilenames option (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: add_make_bitmap_filename Created 7 years, 6 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
« no previous file with comments | « no previous file | gm/tests/outputs/checksum-based-filenames/output-expected/command_line » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/gmmain.cpp
===================================================================
--- gm/gmmain.cpp (revision 9460)
+++ gm/gmmain.cpp (working copy)
@@ -225,6 +225,16 @@
return SkOSPath::SkPathJoin(path, filename.c_str());
}
+ /**
+ * Assemble filename suitable for writing out an SkBitmap.
+ */
+ SkString make_bitmap_filename(const char *path,
epoger 2013/06/18 05:45:36 Patchset 2 adds the make_bitmap_filename() wrapper
+ const char *shortName,
+ const char *configName,
+ const char *renderModeDescriptor) {
+ return make_filename(path, shortName, configName, renderModeDescriptor, kPNG_FileExtension);
+ }
+
/* since PNG insists on unpremultiplying our alpha, we take no
precision chances and force all pixels to be 100% opaque,
otherwise on compare we may not get a perfect match.
@@ -253,6 +263,8 @@
}
}
+ // EPOGER: make sure to create any directories needed along the path
+ // EPOGER: make sure this works even if the destination file already exists -- just overwrite it
static bool write_bitmap(const SkString& path, const SkBitmap& bitmap) {
// TODO(epoger): Now that we have removed force_all_opaque()
// from this method, we should be able to get rid of the
@@ -642,8 +654,7 @@
gRec.fBackend == kGPU_Backend ||
(gRec.fBackend == kPDF_Backend && CAN_IMAGE_PDF)) {
- path = make_filename(writePath, shortName, gRec.fName, renderModeDescriptor,
- kPNG_FileExtension);
+ path = make_bitmap_filename(writePath, shortName, gRec.fName, renderModeDescriptor);
success = write_bitmap(path, bitmap);
}
if (kPDF_Backend == gRec.fBackend) {
@@ -780,9 +791,8 @@
// Write out the "actuals" for any mismatches, if we have
// been directed to do so.
if (fMismatchPath) {
- SkString path =
- make_filename(fMismatchPath, shortName, configName, renderModeDescriptor,
- kPNG_FileExtension);
+ SkString path = make_bitmap_filename(fMismatchPath, shortName, configName,
+ renderModeDescriptor);
write_bitmap(path, actualBitmap);
}
@@ -1303,9 +1313,11 @@
DEFINE_bool(tileGrid, true, "Exercise the tile grid variant of SkPicture.");
DEFINE_string(tileGridReplayScales, "", "Space separated list of floating-point scale "
"factors to be used for tileGrid playback testing. Default value: 1.0");
-DEFINE_string(writeJsonSummaryPath, "", "Write a JSON-formatted result summary to this file.");
DEFINE_bool2(verbose, v, false, "Give more detail (e.g. list all GMs run, more info about "
"each test).");
+DEFINE_bool(writeChecksumBasedFilenames, false, "When writing out actual images, use checksum-"
+ "based filenames, as rebaseline.py will use when downloading them from Google Storage");
+DEFINE_string(writeJsonSummaryPath, "", "Write a JSON-formatted result summary to this file.");
DEFINE_string2(writePath, w, "", "Write rendered images into this directory.");
DEFINE_string2(writePicturePath, p, "", "Write .skp files into this directory.");
DEFINE_int32(pdfJpegQuality, -1, "Encodes images in JPEG at quality level N, "
« no previous file with comments | « no previous file | gm/tests/outputs/checksum-based-filenames/output-expected/command_line » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698