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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 275 | 275 |
| 276 bool ShouldAnimate() const; | 276 bool ShouldAnimate() const; |
| 277 bool ShouldBeginOutputSurfaceCreation() const; | 277 bool ShouldBeginOutputSurfaceCreation() const; |
| 278 bool ShouldDraw() const; | 278 bool ShouldDraw() const; |
| 279 bool ShouldActivatePendingTree() const; | 279 bool ShouldActivatePendingTree() const; |
| 280 bool ShouldSendBeginMainFrame() const; | 280 bool ShouldSendBeginMainFrame() const; |
| 281 bool ShouldCommit() const; | 281 bool ShouldCommit() const; |
| 282 bool ShouldPrepareTiles() const; | 282 bool ShouldPrepareTiles() const; |
| 283 | 283 |
| 284 void AdvanceCurrentFrameNumber(); | 284 void AdvanceCurrentFrameNumber(); |
| 285 bool HasAnimatedThisFrame() const; | |
| 286 bool HasSentBeginMainFrameThisFrame() const; | |
| 287 bool HasRequestedSwapThisFrame() const; | |
| 288 bool HasSwappedThisFrame() const; | |
| 289 | 285 |
| 290 void UpdateStateOnCommit(bool commit_had_no_updates); | 286 void UpdateStateOnCommit(bool commit_had_no_updates); |
| 291 void UpdateStateOnActivation(); | 287 void UpdateStateOnActivation(); |
| 292 void UpdateStateOnDraw(bool did_request_swap); | 288 void UpdateStateOnDraw(bool did_request_swap); |
| 293 void UpdateStateOnPrepareTiles(); | 289 void UpdateStateOnPrepareTiles(); |
| 294 | 290 |
| 295 const SchedulerSettings settings_; | 291 const SchedulerSettings settings_; |
| 296 | 292 |
| 297 OutputSurfaceState output_surface_state_; | 293 OutputSurfaceState output_surface_state_; |
| 298 BeginImplFrameState begin_impl_frame_state_; | 294 BeginImplFrameState begin_impl_frame_state_; |
| 299 CommitState commit_state_; | 295 CommitState commit_state_; |
| 300 ForcedRedrawOnTimeoutState forced_redraw_state_; | 296 ForcedRedrawOnTimeoutState forced_redraw_state_; |
| 301 | 297 |
| 298 // These are used for tracing only. | |
| 302 int commit_count_; | 299 int commit_count_; |
| 303 int current_frame_number_; | 300 int current_frame_number_; |
| 304 int last_frame_number_animate_performed_; | 301 int last_frame_number_animate_performed_; |
| 305 int last_frame_number_swap_performed_; | 302 int last_frame_number_swap_performed_; |
| 306 int last_frame_number_swap_requested_; | 303 int last_frame_number_swap_requested_; |
| 307 int last_frame_number_begin_main_frame_sent_; | 304 int last_frame_number_begin_main_frame_sent_; |
| 308 | 305 |
| 306 // These are used to ensure that an action only happens once per frame, | |
| 307 // deadline, etc. | |
| 308 bool animate_funnel_; | |
|
brianderson
2015/03/19 23:31:43
animate_funnel_ can be reset in the middle of a fr
sunnyps
2015/03/20 01:13:44
We can change the names later - I wasn't able to c
| |
| 309 bool perform_swap_funnel_; | |
| 310 bool request_swap_funnel_; | |
| 311 bool send_begin_main_frame_funnel_; | |
| 309 // prepare_tiles_funnel_ is "filled" each time PrepareTiles is called | 312 // prepare_tiles_funnel_ is "filled" each time PrepareTiles is called |
| 310 // and "drained" on each BeginImplFrame. If the funnel gets too full, | 313 // and "drained" on each BeginImplFrame. If the funnel gets too full, |
| 311 // we start throttling ACTION_PREPARE_TILES such that we average one | 314 // we start throttling ACTION_PREPARE_TILES such that we average one |
| 312 // PrepareTiles per BeginImplFrame. | 315 // PrepareTiles per BeginImplFrame. |
| 313 int prepare_tiles_funnel_; | 316 int prepare_tiles_funnel_; |
|
brianderson
2015/03/19 23:31:43
nit: Space after this line to separate all the fun
sunnyps
2015/03/20 01:13:44
Done.
| |
| 314 int consecutive_checkerboard_animations_; | 317 int consecutive_checkerboard_animations_; |
| 315 int max_pending_swaps_; | 318 int max_pending_swaps_; |
| 316 int pending_swaps_; | 319 int pending_swaps_; |
| 317 bool needs_redraw_; | 320 bool needs_redraw_; |
| 318 bool needs_animate_; | 321 bool needs_animate_; |
| 319 bool needs_prepare_tiles_; | 322 bool needs_prepare_tiles_; |
| 320 bool needs_commit_; | 323 bool needs_commit_; |
| 321 bool inside_poll_for_anticipated_draw_triggers_; | 324 bool inside_poll_for_anticipated_draw_triggers_; |
| 322 bool visible_; | 325 bool visible_; |
| 323 bool can_start_; | 326 bool can_start_; |
| 324 bool can_draw_; | 327 bool can_draw_; |
| 325 bool has_pending_tree_; | 328 bool has_pending_tree_; |
| 326 bool pending_tree_is_ready_for_activation_; | 329 bool pending_tree_is_ready_for_activation_; |
| 327 bool active_tree_needs_first_draw_; | 330 bool active_tree_needs_first_draw_; |
| 328 bool did_commit_after_animating_; | |
| 329 bool did_create_and_initialize_first_output_surface_; | 331 bool did_create_and_initialize_first_output_surface_; |
| 330 bool impl_latency_takes_priority_; | 332 bool impl_latency_takes_priority_; |
| 331 bool skip_next_begin_main_frame_to_reduce_latency_; | 333 bool skip_next_begin_main_frame_to_reduce_latency_; |
| 332 bool skip_begin_main_frame_to_reduce_latency_; | 334 bool skip_begin_main_frame_to_reduce_latency_; |
| 333 bool continuous_painting_; | 335 bool continuous_painting_; |
| 334 bool children_need_begin_frames_; | 336 bool children_need_begin_frames_; |
| 335 bool defer_commits_; | 337 bool defer_commits_; |
| 336 | 338 |
| 337 private: | 339 private: |
| 338 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); | 340 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); |
| 339 }; | 341 }; |
| 340 | 342 |
| 341 } // namespace cc | 343 } // namespace cc |
| 342 | 344 |
| 343 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ | 345 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ |
| OLD | NEW |