DM: dm.json can be missing some final results
authormtklein <mtklein@chromium.org>
Fri, 26 Feb 2016 23:53:06 +0000 (15:53 -0800)
committerCommit bot <commit-bot@chromium.org>
Fri, 26 Feb 2016 23:53:06 +0000 (15:53 -0800)
We called JsonWriter::DumpJson() every once in a while,
but this did not necssarily wait for offloaded PNG encoding to finish.

This means we might have been dropping some DM results for a while now.
Fix by one more JsonWriter::DumpJson() call after joining back to the
main thread.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1744723002

Review URL: https://codereview.chromium.org/1744723002

dm/DM.cpp

index 59c7def..df93bfc 100644 (file)
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -1225,6 +1225,8 @@ int dm_main() {
 
     // We'd better have run everything.
     SkASSERT(gPending == 0);
+    // Make sure we've flushed all our results to disk.
+    JsonWriter::DumpJson();
 
     // At this point we're back in single-threaded land.
     sk_tool_utils::release_portable_typefaces();