| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 * | 6 * |
| 7 * Classes for writing out bench results in various formats. | 7 * Classes for writing out bench results in various formats. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 #ifndef SkResultsWriter_DEFINED | 10 #ifndef SkResultsWriter_DEFINED |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 ... | 72 ... |
| 73 }, | 73 }, |
| 74 ... | 74 ... |
| 75 */ | 75 */ |
| 76 class NanoJSONResultsWriter : public ResultsWriter { | 76 class NanoJSONResultsWriter : public ResultsWriter { |
| 77 public: | 77 public: |
| 78 explicit NanoJSONResultsWriter(const char filename[]) | 78 explicit NanoJSONResultsWriter(const char filename[]) |
| 79 : fFilename(filename) | 79 : fFilename(filename) |
| 80 , fRoot() | 80 , fRoot() |
| 81 , fResults(fRoot["results"]) | 81 , fResults(fRoot["results"]) |
| 82 , fBench(NULL) | 82 , fBench(nullptr) |
| 83 , fConfig(NULL) {} | 83 , fConfig(nullptr) {} |
| 84 | 84 |
| 85 ~NanoJSONResultsWriter() { | 85 ~NanoJSONResultsWriter() { |
| 86 this->flush(); | 86 this->flush(); |
| 87 } | 87 } |
| 88 | 88 |
| 89 // Added under "key". | 89 // Added under "key". |
| 90 virtual void key(const char name[], const char value[]) { | 90 virtual void key(const char name[], const char value[]) { |
| 91 fRoot["key"][name] = value; | 91 fRoot["key"][name] = value; |
| 92 } | 92 } |
| 93 // Inserted directly into the root. | 93 // Inserted directly into the root. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 private: | 131 private: |
| 132 SkString fFilename; | 132 SkString fFilename; |
| 133 Json::Value fRoot; | 133 Json::Value fRoot; |
| 134 Json::Value& fResults; | 134 Json::Value& fResults; |
| 135 Json::Value* fBench; | 135 Json::Value* fBench; |
| 136 Json::Value* fConfig; | 136 Json::Value* fConfig; |
| 137 }; | 137 }; |
| 138 | 138 |
| 139 | 139 |
| 140 #endif | 140 #endif |
| OLD | NEW |