OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 */ | 7 */ |
8 | 8 |
9 #ifndef TimingStateMachine_DEFINED | 9 #ifndef TimingStateMachine_DEFINED |
10 #define TimingStateMachine_DEFINED | 10 #define TimingStateMachine_DEFINED |
(...skipping 21 matching lines...) Expand all Loading... |
32 enum ParentEvents { | 32 enum ParentEvents { |
33 kReset_ParentEvents, | 33 kReset_ParentEvents, |
34 kTiming_ParentEvents, | 34 kTiming_ParentEvents, |
35 kTimingFinished_ParentEvents,// This implies parent can read lastMeasure
ment() and must | 35 kTimingFinished_ParentEvents,// This implies parent can read lastMeasure
ment() and must |
36 // reset | 36 // reset |
37 }; | 37 }; |
38 | 38 |
39 ParentEvents nextFrame(SkCanvas* canvas, Benchmark* benchmark); | 39 ParentEvents nextFrame(SkCanvas* canvas, Benchmark* benchmark); |
40 | 40 |
41 /* | 41 /* |
| 42 * Before taking another sample, the owner can choose to prewarm or not |
| 43 */ |
| 44 void nextSampleWithPrewarm(); |
| 45 void nextSample(); |
| 46 |
| 47 /* |
42 * The caller should call this when they are ready to move to the next bench
mark. The caller | 48 * The caller should call this when they are ready to move to the next bench
mark. The caller |
43 * must call this with the *last* benchmark so post draw hooks can be invoke
d | 49 * must call this with the *last* benchmark so post draw hooks can be invoke
d |
44 */ | 50 */ |
45 void nextBenchmark(SkCanvas*, Benchmark*); | 51 void nextBenchmark(SkCanvas*, Benchmark*); |
46 | 52 |
47 | 53 |
48 /* | 54 /* |
49 * When TimingStateMachine returns kTimingFinished_ParentEvents, then the ow
ner can call | 55 * When TimingStateMachine returns kTimingFinished_ParentEvents, then the ow
ner can call |
50 * lastMeasurement() to get the time | 56 * lastMeasurement() to get the time |
51 */ | 57 */ |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 void recordMeasurement(); | 100 void recordMeasurement(); |
95 | 101 |
96 int fCurrentFrame; | 102 int fCurrentFrame; |
97 int fLoops; | 103 int fLoops; |
98 double fLastMeasurement; | 104 double fLastMeasurement; |
99 WallTimer fTimer; | 105 WallTimer fTimer; |
100 State fState; | 106 State fState; |
101 }; | 107 }; |
102 | 108 |
103 #endif | 109 #endif |
OLD | NEW |