Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(547)

Side by Side Diff: bench/ResultsWriter.h

Issue 303913002: In Android framework, make tools depend on jsoncpp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Do as Thoreau would do. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | bench/ResultsWriter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef SkResultsWriter_DEFINED 9 #ifndef SkResultsWriter_DEFINED
10 #define SkResultsWriter_DEFINED 10 #define SkResultsWriter_DEFINED
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 fLogger.logProgress(SkStringPrintf(fTimeFormat, ms)); 70 fLogger.logProgress(SkStringPrintf(fTimeFormat, ms));
71 } 71 }
72 virtual void end() { 72 virtual void end() {
73 fLogger.logProgress("\n"); 73 fLogger.logProgress("\n");
74 } 74 }
75 private: 75 private:
76 SkBenchLogger& fLogger; 76 SkBenchLogger& fLogger;
77 const char* fTimeFormat; 77 const char* fTimeFormat;
78 }; 78 };
79 79
80 #ifdef SK_BUILD_JSON_WRITER
81 /** 80 /**
82 * This ResultsWriter handles writing out the results in JSON. 81 * This ResultsWriter handles writing out the results in JSON.
83 * 82 *
84 * The output looks like (except compressed to a single line): 83 * The output looks like (except compressed to a single line):
85 * 84 *
86 * { 85 * {
87 * "options" : { 86 * "options" : {
88 * "alpha" : "0xFF", 87 * "alpha" : "0xFF",
89 * "scale" : "0", 88 * "scale" : "0",
90 * ... 89 * ...
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 } 138 }
140 private: 139 private:
141 140
142 SkString fFilename; 141 SkString fFilename;
143 Json::Value fRoot; 142 Json::Value fRoot;
144 Json::Value& fResults; 143 Json::Value& fResults;
145 Json::Value* fBench; 144 Json::Value* fBench;
146 Json::Value* fConfig; 145 Json::Value* fConfig;
147 }; 146 };
148 147
149 #endif // SK_BUILD_JSON_WRITER
150
151 /** 148 /**
152 * This ResultsWriter writes out to multiple ResultsWriters. 149 * This ResultsWriter writes out to multiple ResultsWriters.
153 */ 150 */
154 class MultiResultsWriter : public ResultsWriter { 151 class MultiResultsWriter : public ResultsWriter {
155 public: 152 public:
156 MultiResultsWriter() : writers() { 153 MultiResultsWriter() : writers() {
157 }; 154 };
158 void add(ResultsWriter* writer) { 155 void add(ResultsWriter* writer) {
159 writers.push_back(writer); 156 writers.push_back(writer);
160 } 157 }
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 */ 189 */
193 template <typename T> class CallEnd : SkNoncopyable { 190 template <typename T> class CallEnd : SkNoncopyable {
194 public: 191 public:
195 CallEnd(T& obj) : fObj(obj) {} 192 CallEnd(T& obj) : fObj(obj) {}
196 ~CallEnd() { fObj.end(); } 193 ~CallEnd() { fObj.end(); }
197 private: 194 private:
198 T& fObj; 195 T& fObj;
199 }; 196 };
200 197
201 #endif 198 #endif
OLDNEW
« no previous file with comments | « no previous file | bench/ResultsWriter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698