OLD | NEW |
1 | |
2 /* | 1 /* |
3 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
4 * | 3 * |
5 * 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 |
6 * found in the LICENSE file. | 5 * found in the LICENSE file. |
7 */ | 6 */ |
8 | 7 |
9 #ifndef TimerData_DEFINED | 8 #ifndef TimerData_DEFINED |
10 #define TimerData_DEFINED | 9 #define TimerData_DEFINED |
11 | 10 |
12 #include "SkString.h" | 11 #include "SkString.h" |
13 #include "SkTemplates.h" | 12 #include "SkTemplates.h" |
14 | 13 |
15 #ifdef SK_BUILD_FOR_WIN | 14 #ifdef SK_BUILD_FOR_WIN |
16 #pragma warning(push) | 15 #pragma warning(push) |
17 #pragma warning(disable : 4530) | 16 #pragma warning(disable : 4530) |
18 #endif | 17 #endif |
19 | 18 |
20 #include "SkJSONCPP.h" | 19 #include "SkJSONCPP.h" |
21 | 20 |
22 #ifdef SK_BUILD_FOR_WIN | 21 #ifdef SK_BUILD_FOR_WIN |
23 #pragma warning(pop) | 22 #pragma warning(pop) |
24 #endif | 23 #endif |
25 | 24 |
26 class BenchTimer; | 25 class Timer; |
27 | 26 |
28 class TimerData { | 27 class TimerData { |
29 public: | 28 public: |
30 /** | 29 /** |
31 * Constructs a TimerData to hold at most maxNumTimings sets of elapsed time
r values. | 30 * Constructs a TimerData to hold at most maxNumTimings sets of elapsed time
r values. |
32 **/ | 31 **/ |
33 explicit TimerData(int maxNumTimings); | 32 explicit TimerData(int maxNumTimings); |
34 | 33 |
35 /** | 34 /** |
36 * Collect times from the BenchTimer for an iteration. It will fail if calle
d more often than | 35 * Collect times from the Timer for an iteration. It will fail if called mor
e often than |
37 * indicated in the constructor. | 36 * indicated in the constructor. |
38 * | 37 * |
39 * @param BenchTimer Must not be null. | 38 * @param Timer Must not be null. |
40 */ | 39 */ |
41 bool appendTimes(BenchTimer*); | 40 bool appendTimes(Timer*); |
42 | 41 |
43 enum Result { | 42 enum Result { |
44 kMin_Result, | 43 kMin_Result, |
45 kAvg_Result, | 44 kAvg_Result, |
46 kPerIter_Result | 45 kPerIter_Result |
47 }; | 46 }; |
48 | 47 |
49 enum TimerFlags { | 48 enum TimerFlags { |
50 kWall_Flag = 0x1, | 49 kWall_Flag = 0x1, |
51 kTruncatedWall_Flag = 0x2, | 50 kTruncatedWall_Flag = 0x2, |
(...skipping 25 matching lines...) Expand all Loading... |
77 int fCurrTiming; | 76 int fCurrTiming; |
78 | 77 |
79 SkAutoTArray<double> fWallTimes; | 78 SkAutoTArray<double> fWallTimes; |
80 SkAutoTArray<double> fTruncatedWallTimes; | 79 SkAutoTArray<double> fTruncatedWallTimes; |
81 SkAutoTArray<double> fCpuTimes; | 80 SkAutoTArray<double> fCpuTimes; |
82 SkAutoTArray<double> fTruncatedCpuTimes; | 81 SkAutoTArray<double> fTruncatedCpuTimes; |
83 SkAutoTArray<double> fGpuTimes; | 82 SkAutoTArray<double> fGpuTimes; |
84 }; | 83 }; |
85 | 84 |
86 #endif // TimerData_DEFINED | 85 #endif // TimerData_DEFINED |
OLD | NEW |