OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CCSchedulerStateMachine_h | 5 #ifndef CCSchedulerStateMachine_h |
6 #define CCSchedulerStateMachine_h | 6 #define CCSchedulerStateMachine_h |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 | 11 |
12 namespace cc { | 12 namespace cc { |
13 | 13 |
14 // The CCSchedulerStateMachine decides how to coordinate main thread activites | 14 // The SchedulerStateMachine decides how to coordinate main thread activites |
15 // like painting/running javascript with rendering and input activities on the | 15 // like painting/running javascript with rendering and input activities on the |
16 // impl thread. | 16 // impl thread. |
17 // | 17 // |
18 // The state machine tracks internal state but is also influenced by external st
ate. | 18 // The state machine tracks internal state but is also influenced by external st
ate. |
19 // Internal state includes things like whether a frame has been requested, while | 19 // Internal state includes things like whether a frame has been requested, while |
20 // external state includes things like the current time being near to the vblank
time. | 20 // external state includes things like the current time being near to the vblank
time. |
21 // | 21 // |
22 // The scheduler seperates "what to do next" from the updating of its internal s
tate to | 22 // The scheduler seperates "what to do next" from the updating of its internal s
tate to |
23 // make testing cleaner. | 23 // make testing cleaner. |
24 class CCSchedulerStateMachine { | 24 class SchedulerStateMachine { |
25 public: | 25 public: |
26 CCSchedulerStateMachine(); | 26 SchedulerStateMachine(); |
27 | 27 |
28 enum CommitState { | 28 enum CommitState { |
29 COMMIT_STATE_IDLE, | 29 COMMIT_STATE_IDLE, |
30 COMMIT_STATE_FRAME_IN_PROGRESS, | 30 COMMIT_STATE_FRAME_IN_PROGRESS, |
31 COMMIT_STATE_READY_TO_COMMIT, | 31 COMMIT_STATE_READY_TO_COMMIT, |
32 COMMIT_STATE_WAITING_FOR_FIRST_DRAW, | 32 COMMIT_STATE_WAITING_FOR_FIRST_DRAW, |
33 }; | 33 }; |
34 | 34 |
35 enum TextureState { | 35 enum TextureState { |
36 LAYER_TEXTURE_STATE_UNLOCKED, | 36 LAYER_TEXTURE_STATE_UNLOCKED, |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 bool m_needsForcedCommit; | 146 bool m_needsForcedCommit; |
147 bool m_mainThreadNeedsLayerTextures; | 147 bool m_mainThreadNeedsLayerTextures; |
148 bool m_insideVSync; | 148 bool m_insideVSync; |
149 bool m_visible; | 149 bool m_visible; |
150 bool m_canBeginFrame; | 150 bool m_canBeginFrame; |
151 bool m_canDraw; | 151 bool m_canDraw; |
152 bool m_drawIfPossibleFailed; | 152 bool m_drawIfPossibleFailed; |
153 TextureState m_textureState; | 153 TextureState m_textureState; |
154 ContextState m_contextState; | 154 ContextState m_contextState; |
155 | 155 |
156 DISALLOW_COPY_AND_ASSIGN(CCSchedulerStateMachine); | 156 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); |
157 }; | 157 }; |
158 | 158 |
159 } | 159 } |
160 | 160 |
161 #endif // CCSchedulerStateMachine_h | 161 #endif // CCSchedulerStateMachine_h |
OLD | NEW |