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

Side by Side Diff: tools/skdiff_main.cpp

Issue 1865563002: Create output directory in skdiff (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | 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 2011 Google Inc. 2 * Copyright 2011 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 #include "skdiff.h" 7 #include "skdiff.h"
8 #include "skdiff_html.h" 8 #include "skdiff_html.h"
9 #include "skdiff_utils.h" 9 #include "skdiff_utils.h"
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 398
399 if (!baseFiles.isEmpty()) { 399 if (!baseFiles.isEmpty()) {
400 qsort(baseFiles.begin(), baseFiles.count(), sizeof(SkString*), 400 qsort(baseFiles.begin(), baseFiles.count(), sizeof(SkString*),
401 SkCastForQSort(compare_file_name_metrics)); 401 SkCastForQSort(compare_file_name_metrics));
402 } 402 }
403 if (!comparisonFiles.isEmpty()) { 403 if (!comparisonFiles.isEmpty()) {
404 qsort(comparisonFiles.begin(), comparisonFiles.count(), 404 qsort(comparisonFiles.begin(), comparisonFiles.count(),
405 sizeof(SkString*), SkCastForQSort(compare_file_name_metrics)); 405 sizeof(SkString*), SkCastForQSort(compare_file_name_metrics));
406 } 406 }
407 407
408 if (!outputDir.isEmpty()) {
409 sk_mkdir(outputDir.c_str());
410 }
411
408 int i = 0; 412 int i = 0;
409 int j = 0; 413 int j = 0;
410 414
411 while (i < baseFiles.count() && 415 while (i < baseFiles.count() &&
412 j < comparisonFiles.count()) { 416 j < comparisonFiles.count()) {
413 417
414 SkString basePath(baseDir); 418 SkString basePath(baseDir);
415 SkString comparisonPath(comparisonDir); 419 SkString comparisonPath(comparisonDir);
416 420
417 DiffRecord *drp = new DiffRecord; 421 DiffRecord *drp = new DiffRecord;
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 // range [0...255] are wrapped (mod 256). Do the conversion ourselves, to 853 // range [0...255] are wrapped (mod 256). Do the conversion ourselves, to
850 // make sure that we only return 0 when there were no failures. 854 // make sure that we only return 0 when there were no failures.
851 return (num_failing_results > 255) ? 255 : num_failing_results; 855 return (num_failing_results > 255) ? 255 : num_failing_results;
852 } 856 }
853 857
854 #if !defined SK_BUILD_FOR_IOS 858 #if !defined SK_BUILD_FOR_IOS
855 int main(int argc, char * const argv[]) { 859 int main(int argc, char * const argv[]) {
856 return tool_main(argc, (char**) argv); 860 return tool_main(argc, (char**) argv);
857 } 861 }
858 #endif 862 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698