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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 * "results" : [ | 95 * "results" : [ |
96 * { | 96 * { |
97 * "name": "565", | 97 * "name": "565", |
98 * "cmsecs" : 143.188128906250, | 98 * "cmsecs" : 143.188128906250, |
99 * "msecs" : 143.835957031250 | 99 * "msecs" : 143.835957031250 |
100 * }, | 100 * }, |
101 * ... | 101 * ... |
102 */ | 102 */ |
103 | 103 |
104 Json::Value* SkFindNamedNode(Json::Value* root, const char name[]); | 104 Json::Value* SkFindNamedNode(Json::Value* root, const char name[]); |
| 105 Json::Value SkMakeBuilderJSON(const SkString &buildername); |
| 106 |
105 class JSONResultsWriter : public ResultsWriter { | 107 class JSONResultsWriter : public ResultsWriter { |
106 public: | 108 public: |
107 explicit JSONResultsWriter(const char filename[]) | 109 explicit JSONResultsWriter(const char filename[]) |
108 : fFilename(filename) | 110 : fFilename(filename) |
109 , fRoot() | 111 , fRoot() |
110 , fResults(fRoot["results"]) | 112 , fResults(fRoot["results"]) |
111 , fBench(NULL) | 113 , fBench(NULL) |
112 , fConfig(NULL) { | 114 , fConfig(NULL) { |
113 } | 115 } |
114 virtual void option(const char name[], const char value[]) { | 116 virtual void option(const char name[], const char value[]) { |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 */ | 191 */ |
190 template <typename T> class CallEnd : SkNoncopyable { | 192 template <typename T> class CallEnd : SkNoncopyable { |
191 public: | 193 public: |
192 CallEnd(T& obj) : fObj(obj) {} | 194 CallEnd(T& obj) : fObj(obj) {} |
193 ~CallEnd() { fObj.end(); } | 195 ~CallEnd() { fObj.end(); } |
194 private: | 196 private: |
195 T& fObj; | 197 T& fObj; |
196 }; | 198 }; |
197 | 199 |
198 #endif | 200 #endif |
OLD | NEW |