OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 #include "TimerData.h" | 8 #include "TimerData.h" |
9 | 9 |
10 #include "BenchTimer.h" | 10 #include "BenchTimer.h" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 } | 133 } |
134 if (timerFlags & kTruncatedCpu_Flag) { | 134 if (timerFlags & kTruncatedCpu_Flag) { |
135 str += truncCpuStr; | 135 str += truncCpuStr; |
136 } | 136 } |
137 if ((timerFlags & kGpu_Flag) && gpuSum > 0) { | 137 if ((timerFlags & kGpu_Flag) && gpuSum > 0) { |
138 str += gpuStr; | 138 str += gpuStr; |
139 } | 139 } |
140 return str; | 140 return str; |
141 } | 141 } |
142 | 142 |
143 #ifdef SK_BUILD_JSON_WRITER | |
144 Json::Value TimerData::getJSON(uint32_t timerFlags, | 143 Json::Value TimerData::getJSON(uint32_t timerFlags, |
145 Result result, | 144 Result result, |
146 int itersPerTiming) { | 145 int itersPerTiming) { |
147 SkASSERT(itersPerTiming >= 1); | 146 SkASSERT(itersPerTiming >= 1); |
148 Json::Value dataNode; | 147 Json::Value dataNode; |
149 Json::Value wallNode, truncWall, cpuNode, truncCpu, gpuNode; | 148 Json::Value wallNode, truncWall, cpuNode, truncCpu, gpuNode; |
150 if (!fCurrTiming) { | 149 if (!fCurrTiming) { |
151 return dataNode; | 150 return dataNode; |
152 } | 151 } |
153 | 152 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 dataNode["cpu"] = cpuNode; | 215 dataNode["cpu"] = cpuNode; |
217 } | 216 } |
218 if (timerFlags & kTruncatedCpu_Flag) { | 217 if (timerFlags & kTruncatedCpu_Flag) { |
219 dataNode["trucCpu"] = truncCpu; | 218 dataNode["trucCpu"] = truncCpu; |
220 } | 219 } |
221 if ((timerFlags & kGpu_Flag) && gpuSum > 0) { | 220 if ((timerFlags & kGpu_Flag) && gpuSum > 0) { |
222 dataNode["gpu"] = gpuNode; | 221 dataNode["gpu"] = gpuNode; |
223 } | 222 } |
224 return dataNode; | 223 return dataNode; |
225 } | 224 } |
226 #endif // SK_BUILD_JSON_WRITER | |
OLD | NEW |