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

Unified Diff: gm/gmmain.cpp

Issue 14855005: GM: fix --mismatchPath option (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: extract_prepare_subdirectories Created 7 years, 8 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/compared-against-different-pixels-images/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 8959)
+++ gm/gmmain.cpp (working copy)
@@ -1640,6 +1640,26 @@
return total;
}
+bool prepare_subdirectories(const char *root, bool useFileHierarchy,
epoger 2013/05/02 16:23:31 All patchset 2 does is extract prepare_subdirector
+ const SkTDArray<size_t> &configs);
+bool prepare_subdirectories(const char *root, bool useFileHierarchy,
+ const SkTDArray<size_t> &configs) {
+ if (!sk_mkdir(root)) {
+ return false;
+ }
+ if (useFileHierarchy) {
+ for (int i = 0; i < configs.count(); i++) {
+ ConfigData config = gRec[configs[i]];
+ SkString subdir;
+ subdir.appendf("%s%c%s", root, SkPATH_SEPARATOR, config.fName);
+ if (!sk_mkdir(subdir.c_str())) {
+ return false;
+ }
+ }
+ }
+ return true;
+}
+
int tool_main(int argc, char** argv);
int tool_main(int argc, char** argv) {
@@ -1872,20 +1892,9 @@
// If we will be writing out files, prepare subdirectories.
if (FLAGS_writePath.count() == 1) {
- if (!sk_mkdir(FLAGS_writePath[0])) {
+ if (!prepare_subdirectories(FLAGS_writePath[0], gmmain.fUseFileHierarchy, configs)) {
return -1;
}
- if (gmmain.fUseFileHierarchy) {
- for (int i = 0; i < configs.count(); i++) {
- ConfigData config = gRec[configs[i]];
- SkString subdir;
- subdir.appendf("%s%c%s", FLAGS_writePath[0], SkPATH_SEPARATOR,
- config.fName);
- if (!sk_mkdir(subdir.c_str())) {
- return -1;
- }
- }
- }
}
if (FLAGS_pdfJpegQuality < -1 || FLAGS_pdfJpegQuality > 100) {
« no previous file with comments | « no previous file | gm/tests/outputs/compared-against-different-pixels-images/output-expected/command_line » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698