Index: bench/ResultsWriter.h |
diff --git a/bench/ResultsWriter.h b/bench/ResultsWriter.h |
index f53a980de43d87c79e3ff45570e7064fdcdaf594..b8b9a2e5ed52ce5ac4fa12214ba37a04ed25b9da 100644 |
--- a/bench/ResultsWriter.h |
+++ b/bench/ResultsWriter.h |
@@ -12,6 +12,7 @@ |
#include "BenchLogger.h" |
#include "SkJSONCPP.h" |
+#include "SkOSFile.h" |
#include "SkStream.h" |
#include "SkString.h" |
#include "SkTArray.h" |
@@ -116,6 +117,12 @@ public: |
// Flush to storage now please. |
virtual void flush() { |
+ SkString dirname = SkOSPath::Dirname(fFilename.c_str()); |
+ if (!sk_exists(dirname.c_str(), kWrite_SkFILE_Flag)) { |
+ if (!sk_mkdir(dirname.c_str())) { |
+ SkDebugf("Failed to create directory."); |
+ } |
+ } |
SkFILEWStream stream(fFilename.c_str()); |
stream.writeText(Json::StyledWriter().write(fRoot).c_str()); |
stream.flush(); |