OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 #ifndef Timer_DEFINED | 7 #ifndef Timer_DEFINED |
8 #define Timer_DEFINED | 8 #define Timer_DEFINED |
9 | 9 |
10 #include "SkTypes.h" | 10 #include "SkTypes.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 * SysTimers and GpuTimers are implemented orthogonally. | 28 * SysTimers and GpuTimers are implemented orthogonally. |
29 * This class combines 2 SysTimers and a GpuTimer into one single, | 29 * This class combines 2 SysTimers and a GpuTimer into one single, |
30 * platform specific Timer with a simple interface. The truncated | 30 * platform specific Timer with a simple interface. The truncated |
31 * timer doesn't include the time required for the GPU to finish | 31 * timer doesn't include the time required for the GPU to finish |
32 * its rendering. It should always be <= the un-truncated system | 32 * its rendering. It should always be <= the un-truncated system |
33 * times and (for GPU configurations) can be used to roughly (very | 33 * times and (for GPU configurations) can be used to roughly (very |
34 * roughly) gauge the GPU load/backlog. | 34 * roughly) gauge the GPU load/backlog. |
35 */ | 35 */ |
36 class Timer { | 36 class Timer { |
37 public: | 37 public: |
38 explicit Timer(SkGLContext* gl = NULL); | 38 explicit Timer(SkGLContext* gl = nullptr); |
39 | 39 |
40 void start(); | 40 void start(); |
41 void truncatedEnd(); | 41 void truncatedEnd(); |
42 void end(); | 42 void end(); |
43 | 43 |
44 // All times in milliseconds. | 44 // All times in milliseconds. |
45 double fCpu; | 45 double fCpu; |
46 double fWall; | 46 double fWall; |
47 double fTruncatedCpu; | 47 double fTruncatedCpu; |
48 double fTruncatedWall; | 48 double fTruncatedWall; |
(...skipping 18 matching lines...) Expand all Loading... |
67 | 67 |
68 double fWall; // Milliseconds. | 68 double fWall; // Milliseconds. |
69 | 69 |
70 private: | 70 private: |
71 SysTimer fSysTimer; | 71 SysTimer fSysTimer; |
72 }; | 72 }; |
73 | 73 |
74 SkString HumanizeMs(double); | 74 SkString HumanizeMs(double); |
75 | 75 |
76 #endif | 76 #endif |
OLD | NEW |