| 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 commit_state_ == COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED || | 101 commit_state_ == COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED || |
| 102 commit_state_ == COMMIT_STATE_READY_TO_COMMIT; | 102 commit_state_ == COMMIT_STATE_READY_TO_COMMIT; |
| 103 } | 103 } |
| 104 CommitState commit_state() const { return commit_state_; } | 104 CommitState commit_state() const { return commit_state_; } |
| 105 | 105 |
| 106 bool RedrawPending() const { return needs_redraw_; } | 106 bool RedrawPending() const { return needs_redraw_; } |
| 107 bool ManageTilesPending() const { return needs_manage_tiles_; } | 107 bool ManageTilesPending() const { return needs_manage_tiles_; } |
| 108 | 108 |
| 109 enum Action { | 109 enum Action { |
| 110 ACTION_NONE, | 110 ACTION_NONE, |
| 111 ACTION_ANIMATE, |
| 111 ACTION_SEND_BEGIN_MAIN_FRAME, | 112 ACTION_SEND_BEGIN_MAIN_FRAME, |
| 112 ACTION_COMMIT, | 113 ACTION_COMMIT, |
| 113 ACTION_UPDATE_VISIBLE_TILES, | 114 ACTION_UPDATE_VISIBLE_TILES, |
| 114 ACTION_ACTIVATE_PENDING_TREE, | 115 ACTION_ACTIVATE_PENDING_TREE, |
| 115 ACTION_DRAW_AND_SWAP_IF_POSSIBLE, | 116 ACTION_DRAW_AND_SWAP_IF_POSSIBLE, |
| 116 ACTION_DRAW_AND_SWAP_FORCED, | 117 ACTION_DRAW_AND_SWAP_FORCED, |
| 117 ACTION_DRAW_AND_SWAP_ABORT, | 118 ACTION_DRAW_AND_SWAP_ABORT, |
| 118 ACTION_DRAW_AND_READBACK, | 119 ACTION_DRAW_AND_READBACK, |
| 119 ACTION_BEGIN_OUTPUT_SURFACE_CREATION, | 120 ACTION_BEGIN_OUTPUT_SURFACE_CREATION, |
| 120 ACTION_ACQUIRE_LAYER_TEXTURES_FOR_MAIN_THREAD, | 121 ACTION_ACQUIRE_LAYER_TEXTURES_FOR_MAIN_THREAD, |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 | 248 |
| 248 bool SupportsProactiveBeginImplFrame() const; | 249 bool SupportsProactiveBeginImplFrame() const; |
| 249 | 250 |
| 250 protected: | 251 protected: |
| 251 bool BeginImplFrameNeededToDraw() const; | 252 bool BeginImplFrameNeededToDraw() const; |
| 252 bool ProactiveBeginImplFrameWanted() const; | 253 bool ProactiveBeginImplFrameWanted() const; |
| 253 | 254 |
| 254 // True if we need to force activations to make forward progress. | 255 // True if we need to force activations to make forward progress. |
| 255 bool PendingActivationsShouldBeForced() const; | 256 bool PendingActivationsShouldBeForced() const; |
| 256 | 257 |
| 258 bool ShouldAnimate() const; |
| 257 bool ShouldBeginOutputSurfaceCreation() const; | 259 bool ShouldBeginOutputSurfaceCreation() const; |
| 258 bool ShouldDrawForced() const; | 260 bool ShouldDrawForced() const; |
| 259 bool ShouldDraw() const; | 261 bool ShouldDraw() const; |
| 260 bool ShouldActivatePendingTree() const; | 262 bool ShouldActivatePendingTree() const; |
| 261 bool ShouldAcquireLayerTexturesForMainThread() const; | 263 bool ShouldAcquireLayerTexturesForMainThread() const; |
| 262 bool ShouldUpdateVisibleTiles() const; | 264 bool ShouldUpdateVisibleTiles() const; |
| 263 bool ShouldSendBeginMainFrame() const; | 265 bool ShouldSendBeginMainFrame() const; |
| 264 bool ShouldCommit() const; | 266 bool ShouldCommit() const; |
| 265 bool ShouldManageTiles() const; | 267 bool ShouldManageTiles() const; |
| 266 | 268 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 281 BeginImplFrameState begin_impl_frame_state_; | 283 BeginImplFrameState begin_impl_frame_state_; |
| 282 CommitState commit_state_; | 284 CommitState commit_state_; |
| 283 TextureState texture_state_; | 285 TextureState texture_state_; |
| 284 ForcedRedrawOnTimeoutState forced_redraw_state_; | 286 ForcedRedrawOnTimeoutState forced_redraw_state_; |
| 285 SynchronousReadbackState readback_state_; | 287 SynchronousReadbackState readback_state_; |
| 286 | 288 |
| 287 BeginFrameArgs last_begin_impl_frame_args_; | 289 BeginFrameArgs last_begin_impl_frame_args_; |
| 288 | 290 |
| 289 int commit_count_; | 291 int commit_count_; |
| 290 int current_frame_number_; | 292 int current_frame_number_; |
| 293 int last_frame_number_animate_performed_; |
| 291 int last_frame_number_swap_performed_; | 294 int last_frame_number_swap_performed_; |
| 292 int last_frame_number_begin_main_frame_sent_; | 295 int last_frame_number_begin_main_frame_sent_; |
| 293 int last_frame_number_update_visible_tiles_was_called_; | 296 int last_frame_number_update_visible_tiles_was_called_; |
| 294 | 297 |
| 295 // manage_tiles_funnel_ is "filled" each time ManageTiles is called | 298 // manage_tiles_funnel_ is "filled" each time ManageTiles is called |
| 296 // and "drained" on each BeginImplFrame. If the funnel gets too full, | 299 // and "drained" on each BeginImplFrame. If the funnel gets too full, |
| 297 // we start throttling ACTION_MANAGE_TILES such that we average one | 300 // we start throttling ACTION_MANAGE_TILES such that we average one |
| 298 // ManageTile per BeginImplFrame. | 301 // ManageTile per BeginImplFrame. |
| 299 int manage_tiles_funnel_; | 302 int manage_tiles_funnel_; |
| 300 int consecutive_checkerboard_animations_; | 303 int consecutive_checkerboard_animations_; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 316 bool skip_next_begin_main_frame_to_reduce_latency_; | 319 bool skip_next_begin_main_frame_to_reduce_latency_; |
| 317 bool skip_begin_main_frame_to_reduce_latency_; | 320 bool skip_begin_main_frame_to_reduce_latency_; |
| 318 | 321 |
| 319 private: | 322 private: |
| 320 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); | 323 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); |
| 321 }; | 324 }; |
| 322 | 325 |
| 323 } // namespace cc | 326 } // namespace cc |
| 324 | 327 |
| 325 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ | 328 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ |
| OLD | NEW |