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

Unified Diff: dm/DM.cpp

Issue 980333002: DM: support non-fatal errors (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | dm/DMSrcSink.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DM.cpp
diff --git a/dm/DM.cpp b/dm/DM.cpp
index 24808cf33ada4ff3de8b32a2331885381fd9d189..ae8d9b26545021e4cb22a9fb881c99fb7b875711 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -186,7 +186,7 @@ static void push_sink(const char* tag, Sink* s) {
SkDynamicMemoryWStream stream;
SkString log;
Error err = sink->draw(noop, &bitmap, &stream, &log);
- if (!err.isEmpty()) {
+ if (err.isFatal()) {
SkDebugf("Skipping %s: %s\n", tag, err.c_str());
return;
}
@@ -321,11 +321,18 @@ struct Task {
SkDynamicMemoryWStream stream;
Error err = task->sink->draw(*task->src, &bitmap, &stream, &log);
if (!err.isEmpty()) {
- fail(SkStringPrintf("%s %s %s: %s",
- task->sink.tag,
- task->src.tag,
- name.c_str(),
- err.c_str()));
+ timer.end();
+ if (err.isFatal()) {
+ fail(SkStringPrintf("%s %s %s: %s",
+ task->sink.tag,
+ task->src.tag,
+ name.c_str(),
+ err.c_str()));
+ } else {
+ name.appendf(" (skipped: %s)", err.c_str());
+ }
+ done(timer.fWall, task->sink.tag, task->src.tag, name, log);
+ return;
}
SkAutoTDelete<SkStreamAsset> data(stream.detachAsStream());
« no previous file with comments | « no previous file | dm/DMSrcSink.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698