OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 #ifndef SkPictureResultsWriter_DEFINED | 9 #ifndef SkPictureResultsWriter_DEFINED |
10 #define SkPictureResultsWriter_DEFINED | 10 #define SkPictureResultsWriter_DEFINED |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 currentLine.c_str(), timerTypes, numInnerLoops); | 133 currentLine.c_str(), timerTypes, numInnerLoops); |
134 results.append("\n"); | 134 results.append("\n"); |
135 this->logProgress(results.c_str()); | 135 this->logProgress(results.c_str()); |
136 } | 136 } |
137 virtual void end() {} | 137 virtual void end() {} |
138 private: | 138 private: |
139 SkBenchLogger* fLogger; | 139 SkBenchLogger* fLogger; |
140 SkString currentLine; | 140 SkString currentLine; |
141 }; | 141 }; |
142 | 142 |
143 #ifdef SK_BUILD_JSON_WRITER | |
144 /** | 143 /** |
145 * This PictureResultsWriter collects data in a JSON node | 144 * This PictureResultsWriter collects data in a JSON node |
146 * | 145 * |
147 * The format is something like | 146 * The format is something like |
148 * { | 147 * { |
149 * benches: [ | 148 * benches: [ |
150 * { | 149 * { |
151 * name: "Name_of_test" | 150 * name: "Name_of_test" |
152 * tilesets: [ | 151 * tilesets: [ |
153 * { | 152 * { |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 stream.writeText(Json::FastWriter().write(fRoot).c_str()); | 219 stream.writeText(Json::FastWriter().write(fRoot).c_str()); |
221 stream.flush(); | 220 stream.flush(); |
222 } | 221 } |
223 private: | 222 private: |
224 SkString fFilename; | 223 SkString fFilename; |
225 Json::Value fRoot; | 224 Json::Value fRoot; |
226 Json::Value *fCurrentBench; | 225 Json::Value *fCurrentBench; |
227 Json::Value *fCurrentTileSet; | 226 Json::Value *fCurrentTileSet; |
228 Json::Value *fCurrentTile; | 227 Json::Value *fCurrentTile; |
229 }; | 228 }; |
230 #endif // SK_BUILD_JSON_WRITER | |
231 | 229 |
232 #endif | 230 #endif |
OLD | NEW |