JSON results are written out in the following format: { "failures": { "skp1": 12, "skp4": 2, ... }, "unsupported": { "skp9": 13, "skp17": 3, ... } "totalFailures": 32, "totalUnsupported": 9, "totalSuccesses": 21, }
143 {
145 "Usage: get_images_from_skps -s <dir of skps> -o <dir for output images> --testDecode "
146 "-j <output JSON path> --writeImages, --writeFailedImages\n");
147
149 const char*
inputs = FLAGS_skps[0];
151
154 return 1;
155 }
156
161 return 2;
162 }
163 }
164 } else {
166 return 2;
167 }
168 }
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188 unsigned int totalFailures = 0,
189 totalUnsupported = 0;
192 writer.beginObject();
193 {
194 writer.beginObject("failures");
195 {
197 SkDebugf(
"%s %u\n", failure.first.c_str(), failure.second);
198 totalFailures += failure.second;
199 writer.appendU32(failure.first.c_str(), failure.second);
200 }
201 }
202 writer.endObject();
203 writer.appendU32("totalFailures", totalFailures);
204
205#ifdef SK_DEBUG
206 writer.beginObject("unsupported");
207 {
212 }
213 }
214 writer.endObject();
215 writer.appendU32("totalUnsupported", totalUnsupported);
216#endif
217
218 writer.appendS32(
"totalSuccesses",
gKnown);
219 SkDebugf(
"%d known, %u failures, %u unsupported\n",
220 gKnown, totalFailures, totalUnsupported);
221 }
222 writer.endObject();
223 writer.flush();
224
225 if (totalFailures > 0 || totalUnsupported > 0) {
226 if (!FLAGS_failuresJsonPath.isEmpty()) {
227 SkDebugf(
"Writing failures to %s\n", FLAGS_failuresJsonPath[0]);
230 stream.writeStream(jsonStream.get(), jsonStream->getLength());
231 }
232 }
233
234 return 0;
235}
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
bool sk_isdir(const char *path)
static void Parse(int argc, const char *const *argv)
static void SetUsage(const char *usage)
std::unique_ptr< SkStreamAsset > detachAsStream()
static SkString Join(const char *rootPath, const char *relativePath)
static bool get_images_from_file(const SkString &file)
static std::map< std::string, unsigned int > gSkpToUnsupportedCount
static std::map< std::string, unsigned int > gSkpToUnknownCount
static const char * gOutputDir
static bool unsupported()