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 | 8 |
9 #ifndef TimerData_DEFINED | 9 #ifndef TimerData_DEFINED |
10 #define TimerData_DEFINED | 10 #define TimerData_DEFINED |
11 | 11 |
12 #include "SkJSONCPP.h" | |
13 #include "SkString.h" | 12 #include "SkString.h" |
14 #include "SkTemplates.h" | 13 #include "SkTemplates.h" |
15 | 14 |
16 | 15 |
17 class BenchTimer; | 16 class BenchTimer; |
18 | 17 |
19 class TimerData { | 18 class TimerData { |
20 public: | 19 public: |
21 /** | 20 /** |
22 * Constructs a TimerData to hold at most maxNumTimings sets of elapsed time
r values. | 21 * Constructs a TimerData to hold at most maxNumTimings sets of elapsed time
r values. |
(...skipping 29 matching lines...) Expand all Loading... |
52 * @param the name of the config being timed (prepended to results string) | 51 * @param the name of the config being timed (prepended to results string) |
53 * @param timerFlags bitfield of TimerFlags values indicating which timers s
hould be reported. | 52 * @param timerFlags bitfield of TimerFlags values indicating which timers s
hould be reported. |
54 * @param itersPerTiming the number of test/bench iterations that correspond
to each | 53 * @param itersPerTiming the number of test/bench iterations that correspond
to each |
55 * appendTimes() call, 1 when appendTimes is called for each iteratio
n. | 54 * appendTimes() call, 1 when appendTimes is called for each iteratio
n. |
56 */ | 55 */ |
57 SkString getResult(const char* doubleFormat, | 56 SkString getResult(const char* doubleFormat, |
58 Result result, | 57 Result result, |
59 const char* configName, | 58 const char* configName, |
60 uint32_t timerFlags, | 59 uint32_t timerFlags, |
61 int itersPerTiming = 1); | 60 int itersPerTiming = 1); |
62 Json::Value getJSON(uint32_t timerFlags, | |
63 Result result, | |
64 int itersPerTiming = 1); | |
65 | 61 |
66 private: | 62 private: |
67 int fMaxNumTimings; | 63 int fMaxNumTimings; |
68 int fCurrTiming; | 64 int fCurrTiming; |
69 | 65 |
70 SkAutoTArray<double> fWallTimes; | 66 SkAutoTArray<double> fWallTimes; |
71 SkAutoTArray<double> fTruncatedWallTimes; | 67 SkAutoTArray<double> fTruncatedWallTimes; |
72 SkAutoTArray<double> fCpuTimes; | 68 SkAutoTArray<double> fCpuTimes; |
73 SkAutoTArray<double> fTruncatedCpuTimes; | 69 SkAutoTArray<double> fTruncatedCpuTimes; |
74 SkAutoTArray<double> fGpuTimes; | 70 SkAutoTArray<double> fGpuTimes; |
75 }; | 71 }; |
76 | 72 |
77 #endif // TimerData_DEFINED | 73 #endif // TimerData_DEFINED |
OLD | NEW |