Chromium Code Reviews| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 54 BEGIN_IMPL_FRAME_STATE_BEGIN_FRAME_STARTING, | 54 BEGIN_IMPL_FRAME_STATE_BEGIN_FRAME_STARTING, |
| 55 BEGIN_IMPL_FRAME_STATE_INSIDE_BEGIN_FRAME, | 55 BEGIN_IMPL_FRAME_STATE_INSIDE_BEGIN_FRAME, |
| 56 BEGIN_IMPL_FRAME_STATE_INSIDE_DEADLINE, | 56 BEGIN_IMPL_FRAME_STATE_INSIDE_DEADLINE, |
| 57 }; | 57 }; |
| 58 static const char* BeginImplFrameStateToString(BeginImplFrameState state); | 58 static const char* BeginImplFrameStateToString(BeginImplFrameState state); |
| 59 | 59 |
| 60 enum CommitState { | 60 enum CommitState { |
| 61 COMMIT_STATE_IDLE, | 61 COMMIT_STATE_IDLE, |
| 62 COMMIT_STATE_FRAME_IN_PROGRESS, | 62 COMMIT_STATE_FRAME_IN_PROGRESS, |
| 63 COMMIT_STATE_READY_TO_COMMIT, | 63 COMMIT_STATE_READY_TO_COMMIT, |
| 64 COMMIT_STATE_WAITING_FOR_FIRST_DRAW, | |
|
enne (OOO)
2014/01/23 21:51:55
I'm not sure I follow the removal of this state.
brianderson
2014/01/23 23:31:35
At ToT, COMMIT_STATE_WAITING_FOR_FIRST_DRAW can be
| |
| 65 }; | 64 }; |
| 66 static const char* CommitStateToString(CommitState state); | 65 static const char* CommitStateToString(CommitState state); |
| 67 | 66 |
| 68 enum TextureState { | 67 enum TextureState { |
| 69 LAYER_TEXTURE_STATE_UNLOCKED, | 68 LAYER_TEXTURE_STATE_UNLOCKED, |
| 70 LAYER_TEXTURE_STATE_ACQUIRED_BY_MAIN_THREAD, | 69 LAYER_TEXTURE_STATE_ACQUIRED_BY_MAIN_THREAD, |
| 71 LAYER_TEXTURE_STATE_ACQUIRED_BY_IMPL_THREAD, | 70 LAYER_TEXTURE_STATE_ACQUIRED_BY_IMPL_THREAD, |
| 72 }; | 71 }; |
| 73 static const char* TextureStateToString(TextureState state); | 72 static const char* TextureStateToString(TextureState state); |
| 74 | 73 |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 90 FORCED_REDRAW_STATE_WAITING_FOR_ACTIVATION, | 89 FORCED_REDRAW_STATE_WAITING_FOR_ACTIVATION, |
| 91 FORCED_REDRAW_STATE_WAITING_FOR_DRAW, | 90 FORCED_REDRAW_STATE_WAITING_FOR_DRAW, |
| 92 }; | 91 }; |
| 93 static const char* ForcedRedrawOnTimeoutStateToString( | 92 static const char* ForcedRedrawOnTimeoutStateToString( |
| 94 ForcedRedrawOnTimeoutState state); | 93 ForcedRedrawOnTimeoutState state); |
| 95 | 94 |
| 96 bool CommitPending() const { | 95 bool CommitPending() const { |
| 97 return commit_state_ == COMMIT_STATE_FRAME_IN_PROGRESS || | 96 return commit_state_ == COMMIT_STATE_FRAME_IN_PROGRESS || |
| 98 commit_state_ == COMMIT_STATE_READY_TO_COMMIT; | 97 commit_state_ == COMMIT_STATE_READY_TO_COMMIT; |
| 99 } | 98 } |
| 99 CommitState commit_state() const { return commit_state_; } | |
| 100 | 100 |
| 101 bool RedrawPending() const { return needs_redraw_; } | 101 bool RedrawPending() const { return needs_redraw_; } |
| 102 bool ManageTilesPending() const { return needs_manage_tiles_; } | 102 bool ManageTilesPending() const { return needs_manage_tiles_; } |
| 103 | 103 |
| 104 enum Action { | 104 enum Action { |
| 105 ACTION_NONE, | 105 ACTION_NONE, |
| 106 ACTION_SEND_BEGIN_MAIN_FRAME, | 106 ACTION_SEND_BEGIN_MAIN_FRAME, |
| 107 ACTION_COMMIT, | 107 ACTION_COMMIT, |
| 108 ACTION_UPDATE_VISIBLE_TILES, | 108 ACTION_UPDATE_VISIBLE_TILES, |
| 109 ACTION_ACTIVATE_PENDING_TREE, | 109 ACTION_ACTIVATE_PENDING_TREE, |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 217 | 217 |
| 218 // Indicates whether drawing would, at this time, make sense. | 218 // Indicates whether drawing would, at this time, make sense. |
| 219 // CanDraw can be used to suppress flashes or checkerboarding | 219 // CanDraw can be used to suppress flashes or checkerboarding |
| 220 // when such behavior would be undesirable. | 220 // when such behavior would be undesirable. |
| 221 void SetCanDraw(bool can); | 221 void SetCanDraw(bool can); |
| 222 | 222 |
| 223 // Indicates that the pending tree is ready for activation. | 223 // Indicates that the pending tree is ready for activation. |
| 224 void NotifyReadyToActivate(); | 224 void NotifyReadyToActivate(); |
| 225 | 225 |
| 226 bool has_pending_tree() const { return has_pending_tree_; } | 226 bool has_pending_tree() const { return has_pending_tree_; } |
| 227 bool active_tree_needs_first_draw() const { | |
| 228 return active_tree_needs_first_draw_; | |
| 229 } | |
| 227 | 230 |
| 228 void DidManageTiles(); | 231 void DidManageTiles(); |
| 229 void DidLoseOutputSurface(); | 232 void DidLoseOutputSurface(); |
| 230 void DidCreateAndInitializeOutputSurface(); | 233 void DidCreateAndInitializeOutputSurface(); |
| 231 bool HasInitializedOutputSurface() const; | 234 bool HasInitializedOutputSurface() const; |
| 232 | 235 |
| 233 // True if we need to abort draws to make forward progress. | 236 // True if we need to abort draws to make forward progress. |
| 234 bool PendingDrawsShouldBeAborted() const; | 237 bool PendingDrawsShouldBeAborted() const; |
| 235 | 238 |
| 236 bool SupportsProactiveBeginImplFrame() const; | 239 bool SupportsProactiveBeginImplFrame() const; |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 305 bool smoothness_takes_priority_; | 308 bool smoothness_takes_priority_; |
| 306 bool skip_begin_main_frame_to_reduce_latency_; | 309 bool skip_begin_main_frame_to_reduce_latency_; |
| 307 | 310 |
| 308 private: | 311 private: |
| 309 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); | 312 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); |
| 310 }; | 313 }; |
| 311 | 314 |
| 312 } // namespace cc | 315 } // namespace cc |
| 313 | 316 |
| 314 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ | 317 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ |
| OLD | NEW |