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

Side by Side Diff: tools/get_images_from_skps.cpp

Issue 1916183002: Return error code when get_images_from_skps has failures (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Undo test change Created 4 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 | « 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 2016 Google Inc. 2 * Copyright 2016 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 "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkCodec.h" 9 #include "SkCodec.h"
10 #include "SkCommandLineFlags.h" 10 #include "SkCommandLineFlags.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 Json::Value fRoot; 150 Json::Value fRoot;
151 for(auto it = gSkpToUnknownCount.cbegin(); it != gSkpToUnknownCount.cend(); ++it) 151 for(auto it = gSkpToUnknownCount.cbegin(); it != gSkpToUnknownCount.cend(); ++it)
152 { 152 {
153 SkDebugf("%s %d\n", it->first.c_str(), it->second); 153 SkDebugf("%s %d\n", it->first.c_str(), it->second);
154 totalUnknowns += it->second; 154 totalUnknowns += it->second;
155 fRoot["failures"][it->first.c_str()] = it->second; 155 fRoot["failures"][it->first.c_str()] = it->second;
156 } 156 }
157 SkDebugf("%d known, %d unknown\n", gKnown, totalUnknowns); 157 SkDebugf("%d known, %d unknown\n", gKnown, totalUnknowns);
158 fRoot["totalFailures"] = totalUnknowns; 158 fRoot["totalFailures"] = totalUnknowns;
159 fRoot["totalSuccesses"] = gKnown; 159 fRoot["totalSuccesses"] = gKnown;
160 if (totalUnknowns > 0 && !FLAGS_failuresJsonPath.isEmpty()) { 160 if (totalUnknowns > 0) {
161 SkDebugf("Writing failures to %s\n", FLAGS_failuresJsonPath[0]); 161 if (!FLAGS_failuresJsonPath.isEmpty()) {
162 SkFILEWStream stream(FLAGS_failuresJsonPath[0]); 162 SkDebugf("Writing failures to %s\n", FLAGS_failuresJsonPath[0]);
163 stream.writeText(Json::StyledWriter().write(fRoot).c_str()); 163 SkFILEWStream stream(FLAGS_failuresJsonPath[0]);
164 stream.flush(); 164 stream.writeText(Json::StyledWriter().write(fRoot).c_str());
165 stream.flush();
166 }
167 return -1;
165 } 168 }
166
167 return 0; 169 return 0;
168 } 170 }
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