| 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. | 41 * The caller should call this when they are ready to move to the next bench
mark. The caller |
| 42 * must call this with the *last* benchmark so post draw hooks can be invoke
d |
| 42 */ | 43 */ |
| 43 void nextBenchmark(); | 44 void nextBenchmark(SkCanvas*, Benchmark*); |
| 44 | 45 |
| 45 /* | 46 /* |
| 46 * When TimingStateMachine returns kTimingFinished_ParentEvents, then the ow
ner can call | 47 * When TimingStateMachine returns kTimingFinished_ParentEvents, then the ow
ner can call |
| 47 * lastMeasurement() to get the time | 48 * lastMeasurement() to get the time |
| 48 */ | 49 */ |
| 49 double lastMeasurement() const { return fLastMeasurement; } | 50 double lastMeasurement() const { return fLastMeasurement; } |
| 50 | 51 |
| 51 int loops() const { return fLoops; } | 52 int loops() const { return fLoops; } |
| 52 | 53 |
| 53 private: | 54 private: |
| (...skipping 12 matching lines...) Expand all Loading... |
| 66 | 67 |
| 67 int fCurrentFrame; | 68 int fCurrentFrame; |
| 68 int fLoops; | 69 int fLoops; |
| 69 double fLastMeasurement; | 70 double fLastMeasurement; |
| 70 WallTimer fTimer; | 71 WallTimer fTimer; |
| 71 State fState; | 72 State fState; |
| 72 InnerState fInnerState; | 73 InnerState fInnerState; |
| 73 }; | 74 }; |
| 74 | 75 |
| 75 #endif | 76 #endif |
| OLD | NEW |