OLD | NEW |
1 #include "CrashHandler.h" | 1 #include "CrashHandler.h" |
2 #include "DMJsonWriter.h" | 2 #include "DMJsonWriter.h" |
3 #include "DMSrcSink.h" | 3 #include "DMSrcSink.h" |
4 #include "DMSrcSinkAndroid.h" | 4 #include "DMSrcSinkAndroid.h" |
5 #include "OverwriteLine.h" | 5 #include "OverwriteLine.h" |
6 #include "ProcStats.h" | 6 #include "ProcStats.h" |
7 #include "SkBBHFactory.h" | 7 #include "SkBBHFactory.h" |
8 #include "SkChecksum.h" | 8 #include "SkChecksum.h" |
9 #include "SkCommonFlags.h" | 9 #include "SkCommonFlags.h" |
10 #include "SkForceLinking.h" | 10 #include "SkForceLinking.h" |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 struct : public Src { | 179 struct : public Src { |
180 Error draw(SkCanvas*) const SK_OVERRIDE { return ""; } | 180 Error draw(SkCanvas*) const SK_OVERRIDE { return ""; } |
181 SkISize size() const SK_OVERRIDE { return SkISize::Make(16, 16); } | 181 SkISize size() const SK_OVERRIDE { return SkISize::Make(16, 16); } |
182 Name name() const SK_OVERRIDE { return "noop"; } | 182 Name name() const SK_OVERRIDE { return "noop"; } |
183 } noop; | 183 } noop; |
184 | 184 |
185 SkBitmap bitmap; | 185 SkBitmap bitmap; |
186 SkDynamicMemoryWStream stream; | 186 SkDynamicMemoryWStream stream; |
187 SkString log; | 187 SkString log; |
188 Error err = sink->draw(noop, &bitmap, &stream, &log); | 188 Error err = sink->draw(noop, &bitmap, &stream, &log); |
189 if (!err.isEmpty()) { | 189 if (err.isFatal()) { |
190 SkDebugf("Skipping %s: %s\n", tag, err.c_str()); | 190 SkDebugf("Skipping %s: %s\n", tag, err.c_str()); |
191 return; | 191 return; |
192 } | 192 } |
193 | 193 |
194 Tagged<Sink>& ts = gSinks.push_back(); | 194 Tagged<Sink>& ts = gSinks.push_back(); |
195 ts.reset(sink.detach()); | 195 ts.reset(sink.detach()); |
196 ts.tag = tag; | 196 ts.tag = tag; |
197 } | 197 } |
198 | 198 |
199 static bool gpu_supported() { | 199 static bool gpu_supported() { |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 SkString name = task->src->name(); | 314 SkString name = task->src->name(); |
315 SkString whyBlacklisted = is_blacklisted(task->sink.tag, task->src.tag,
name.c_str()); | 315 SkString whyBlacklisted = is_blacklisted(task->sink.tag, task->src.tag,
name.c_str()); |
316 SkString log; | 316 SkString log; |
317 WallTimer timer; | 317 WallTimer timer; |
318 timer.start(); | 318 timer.start(); |
319 if (!FLAGS_dryRun && whyBlacklisted.isEmpty()) { | 319 if (!FLAGS_dryRun && whyBlacklisted.isEmpty()) { |
320 SkBitmap bitmap; | 320 SkBitmap bitmap; |
321 SkDynamicMemoryWStream stream; | 321 SkDynamicMemoryWStream stream; |
322 Error err = task->sink->draw(*task->src, &bitmap, &stream, &log); | 322 Error err = task->sink->draw(*task->src, &bitmap, &stream, &log); |
323 if (!err.isEmpty()) { | 323 if (!err.isEmpty()) { |
324 fail(SkStringPrintf("%s %s %s: %s", | 324 timer.end(); |
325 task->sink.tag, | 325 if (err.isFatal()) { |
326 task->src.tag, | 326 fail(SkStringPrintf("%s %s %s: %s", |
327 name.c_str(), | 327 task->sink.tag, |
328 err.c_str())); | 328 task->src.tag, |
| 329 name.c_str(), |
| 330 err.c_str())); |
| 331 } else { |
| 332 name.appendf(" (skipped: %s)", err.c_str()); |
| 333 } |
| 334 done(timer.fWall, task->sink.tag, task->src.tag, name, log); |
| 335 return; |
329 } | 336 } |
330 SkAutoTDelete<SkStreamAsset> data(stream.detachAsStream()); | 337 SkAutoTDelete<SkStreamAsset> data(stream.detachAsStream()); |
331 | 338 |
332 SkString md5; | 339 SkString md5; |
333 if (!FLAGS_writePath.isEmpty() || !FLAGS_readPath.isEmpty()) { | 340 if (!FLAGS_writePath.isEmpty() || !FLAGS_readPath.isEmpty()) { |
334 SkMD5 hash; | 341 SkMD5 hash; |
335 if (data->getLength()) { | 342 if (data->getLength()) { |
336 hash.writeStream(data, data->getLength()); | 343 hash.writeStream(data, data->getLength()); |
337 data->rewind(); | 344 data->rewind(); |
338 } else { | 345 } else { |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 } | 573 } |
567 return 0; | 574 return 0; |
568 } | 575 } |
569 | 576 |
570 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 577 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
571 int main(int argc, char** argv) { | 578 int main(int argc, char** argv) { |
572 SkCommandLineFlags::Parse(argc, argv); | 579 SkCommandLineFlags::Parse(argc, argv); |
573 return dm_main(); | 580 return dm_main(); |
574 } | 581 } |
575 #endif | 582 #endif |
OLD | NEW |