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 CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ | 5 #ifndef CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ |
6 #define CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ | 6 #define CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 BEGIN_IMPL_FRAME_STATE_BEGIN_FRAME_STARTING, | 55 BEGIN_IMPL_FRAME_STATE_BEGIN_FRAME_STARTING, |
56 BEGIN_IMPL_FRAME_STATE_INSIDE_BEGIN_FRAME, | 56 BEGIN_IMPL_FRAME_STATE_INSIDE_BEGIN_FRAME, |
57 BEGIN_IMPL_FRAME_STATE_INSIDE_DEADLINE, | 57 BEGIN_IMPL_FRAME_STATE_INSIDE_DEADLINE, |
58 }; | 58 }; |
59 static const char* BeginImplFrameStateToString(BeginImplFrameState state); | 59 static const char* BeginImplFrameStateToString(BeginImplFrameState state); |
60 | 60 |
61 enum CommitState { | 61 enum CommitState { |
62 COMMIT_STATE_IDLE, | 62 COMMIT_STATE_IDLE, |
63 COMMIT_STATE_FRAME_IN_PROGRESS, | 63 COMMIT_STATE_FRAME_IN_PROGRESS, |
64 COMMIT_STATE_READY_TO_COMMIT, | 64 COMMIT_STATE_READY_TO_COMMIT, |
| 65 COMMIT_STATE_WAITING_FOR_ACTIVATION, |
65 COMMIT_STATE_WAITING_FOR_FIRST_DRAW, | 66 COMMIT_STATE_WAITING_FOR_FIRST_DRAW, |
66 }; | 67 }; |
67 static const char* CommitStateToString(CommitState state); | 68 static const char* CommitStateToString(CommitState state); |
68 | 69 |
69 enum TextureState { | 70 enum TextureState { |
70 LAYER_TEXTURE_STATE_UNLOCKED, | 71 LAYER_TEXTURE_STATE_UNLOCKED, |
71 LAYER_TEXTURE_STATE_ACQUIRED_BY_MAIN_THREAD, | 72 LAYER_TEXTURE_STATE_ACQUIRED_BY_MAIN_THREAD, |
72 LAYER_TEXTURE_STATE_ACQUIRED_BY_IMPL_THREAD, | 73 LAYER_TEXTURE_STATE_ACQUIRED_BY_IMPL_THREAD, |
73 }; | 74 }; |
74 static const char* TextureStateToString(TextureState state); | 75 static const char* TextureStateToString(TextureState state); |
(...skipping 16 matching lines...) Expand all Loading... |
91 FORCED_REDRAW_STATE_WAITING_FOR_ACTIVATION, | 92 FORCED_REDRAW_STATE_WAITING_FOR_ACTIVATION, |
92 FORCED_REDRAW_STATE_WAITING_FOR_DRAW, | 93 FORCED_REDRAW_STATE_WAITING_FOR_DRAW, |
93 }; | 94 }; |
94 static const char* ForcedRedrawOnTimeoutStateToString( | 95 static const char* ForcedRedrawOnTimeoutStateToString( |
95 ForcedRedrawOnTimeoutState state); | 96 ForcedRedrawOnTimeoutState state); |
96 | 97 |
97 bool CommitPending() const { | 98 bool CommitPending() const { |
98 return commit_state_ == COMMIT_STATE_FRAME_IN_PROGRESS || | 99 return commit_state_ == COMMIT_STATE_FRAME_IN_PROGRESS || |
99 commit_state_ == COMMIT_STATE_READY_TO_COMMIT; | 100 commit_state_ == COMMIT_STATE_READY_TO_COMMIT; |
100 } | 101 } |
| 102 CommitState commit_state() const { return commit_state_; } |
101 | 103 |
102 bool RedrawPending() const { return needs_redraw_; } | 104 bool RedrawPending() const { return needs_redraw_; } |
103 bool ManageTilesPending() const { return needs_manage_tiles_; } | 105 bool ManageTilesPending() const { return needs_manage_tiles_; } |
104 | 106 |
105 enum Action { | 107 enum Action { |
106 ACTION_NONE, | 108 ACTION_NONE, |
107 ACTION_SEND_BEGIN_MAIN_FRAME, | 109 ACTION_SEND_BEGIN_MAIN_FRAME, |
108 ACTION_COMMIT, | 110 ACTION_COMMIT, |
109 ACTION_UPDATE_VISIBLE_TILES, | 111 ACTION_UPDATE_VISIBLE_TILES, |
110 ACTION_ACTIVATE_PENDING_TREE, | 112 ACTION_ACTIVATE_PENDING_TREE, |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 | 220 |
219 // Indicates whether drawing would, at this time, make sense. | 221 // Indicates whether drawing would, at this time, make sense. |
220 // CanDraw can be used to suppress flashes or checkerboarding | 222 // CanDraw can be used to suppress flashes or checkerboarding |
221 // when such behavior would be undesirable. | 223 // when such behavior would be undesirable. |
222 void SetCanDraw(bool can); | 224 void SetCanDraw(bool can); |
223 | 225 |
224 // Indicates that the pending tree is ready for activation. | 226 // Indicates that the pending tree is ready for activation. |
225 void NotifyReadyToActivate(); | 227 void NotifyReadyToActivate(); |
226 | 228 |
227 bool has_pending_tree() const { return has_pending_tree_; } | 229 bool has_pending_tree() const { return has_pending_tree_; } |
| 230 bool active_tree_needs_first_draw() const { |
| 231 return active_tree_needs_first_draw_; |
| 232 } |
228 | 233 |
229 void DidManageTiles(); | 234 void DidManageTiles(); |
230 void DidLoseOutputSurface(); | 235 void DidLoseOutputSurface(); |
231 void DidCreateAndInitializeOutputSurface(); | 236 void DidCreateAndInitializeOutputSurface(); |
232 bool HasInitializedOutputSurface() const; | 237 bool HasInitializedOutputSurface() const; |
233 | 238 |
234 // True if we need to abort draws to make forward progress. | 239 // True if we need to abort draws to make forward progress. |
235 bool PendingDrawsShouldBeAborted() const; | 240 bool PendingDrawsShouldBeAborted() const; |
236 | 241 |
237 bool SupportsProactiveBeginImplFrame() const; | 242 bool SupportsProactiveBeginImplFrame() const; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 bool smoothness_takes_priority_; | 311 bool smoothness_takes_priority_; |
307 bool skip_begin_main_frame_to_reduce_latency_; | 312 bool skip_begin_main_frame_to_reduce_latency_; |
308 | 313 |
309 private: | 314 private: |
310 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); | 315 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); |
311 }; | 316 }; |
312 | 317 |
313 } // namespace cc | 318 } // namespace cc |
314 | 319 |
315 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ | 320 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ |
OLD | NEW |