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 #ifndef TimingStateMachine_DEFINED | 8 #ifndef TimingStateMachine_DEFINED |
9 #define TimingStateMachine_DEFINED | 9 #define TimingStateMachine_DEFINED |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... |
31 enum ParentEvents { | 31 enum ParentEvents { |
32 kReset_ParentEvents, | 32 kReset_ParentEvents, |
33 kTiming_ParentEvents, | 33 kTiming_ParentEvents, |
34 kTimingFinished_ParentEvents,// This implies parent can read lastMeasure
ment() and must | 34 kTimingFinished_ParentEvents,// This implies parent can read lastMeasure
ment() and must |
35 // reset | 35 // reset |
36 }; | 36 }; |
37 | 37 |
38 ParentEvents nextFrame(bool preWarmBetweenSamples); | 38 ParentEvents nextFrame(bool preWarmBetweenSamples); |
39 | 39 |
40 /* | 40 /* |
41 * The caller should call this when they are ready to move to the next bench
mark. The caller | 41 * The caller should call this when they are ready to move to the next bench
mark. |
42 * must call this with the *last* benchmark so post draw hooks can be invoke
d | |
43 */ | 42 */ |
44 void nextBenchmark(SkCanvas*, Benchmark*); | 43 void nextBenchmark(); |
45 | 44 |
46 /* | 45 /* |
47 * When TimingStateMachine returns kTimingFinished_ParentEvents, then the ow
ner can call | 46 * When TimingStateMachine returns kTimingFinished_ParentEvents, then the ow
ner can call |
48 * lastMeasurement() to get the time | 47 * lastMeasurement() to get the time |
49 */ | 48 */ |
50 double lastMeasurement() const { return fLastMeasurement; } | 49 double lastMeasurement() const { return fLastMeasurement; } |
51 | 50 |
52 int loops() const { return fLoops; } | 51 int loops() const { return fLoops; } |
53 | 52 |
54 private: | 53 private: |
(...skipping 12 matching lines...) Expand all Loading... |
67 | 66 |
68 int fCurrentFrame; | 67 int fCurrentFrame; |
69 int fLoops; | 68 int fLoops; |
70 double fLastMeasurement; | 69 double fLastMeasurement; |
71 WallTimer fTimer; | 70 WallTimer fTimer; |
72 State fState; | 71 State fState; |
73 InnerState fInnerState; | 72 InnerState fInnerState; |
74 }; | 73 }; |
75 | 74 |
76 #endif | 75 #endif |
OLD | NEW |