OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |