Commit 55ee3562 authored by sunnyps's avatar sunnyps Committed by Commit bot

cc: Do not use current frame number in state machine decisions.

This allows the scheduler to evolve to a state where it's able to
perform multiple actions of the same type in a given frame. One example
of this is webview where we can stop receiving BeginFrames but still
have to draw any number of times the system asks us to.

BUG=439275

Review URL: https://codereview.chromium.org/1002493006

Cr-Commit-Position: refs/heads/master@{#321625}
parent f71cc7bb
This diff is collapsed.
...@@ -278,10 +278,6 @@ class CC_EXPORT SchedulerStateMachine { ...@@ -278,10 +278,6 @@ class CC_EXPORT SchedulerStateMachine {
bool ShouldPrepareTiles() const; bool ShouldPrepareTiles() const;
void AdvanceCurrentFrameNumber(); void AdvanceCurrentFrameNumber();
bool HasAnimatedThisFrame() const;
bool HasSentBeginMainFrameThisFrame() const;
bool HasRequestedSwapThisFrame() const;
bool HasSwappedThisFrame() const;
void UpdateStateOnCommit(bool commit_had_no_updates); void UpdateStateOnCommit(bool commit_had_no_updates);
void UpdateStateOnActivation(); void UpdateStateOnActivation();
...@@ -295,6 +291,7 @@ class CC_EXPORT SchedulerStateMachine { ...@@ -295,6 +291,7 @@ class CC_EXPORT SchedulerStateMachine {
CommitState commit_state_; CommitState commit_state_;
ForcedRedrawOnTimeoutState forced_redraw_state_; ForcedRedrawOnTimeoutState forced_redraw_state_;
// These are used for tracing only.
int commit_count_; int commit_count_;
int current_frame_number_; int current_frame_number_;
int last_frame_number_animate_performed_; int last_frame_number_animate_performed_;
...@@ -302,11 +299,18 @@ class CC_EXPORT SchedulerStateMachine { ...@@ -302,11 +299,18 @@ class CC_EXPORT SchedulerStateMachine {
int last_frame_number_swap_requested_; int last_frame_number_swap_requested_;
int last_frame_number_begin_main_frame_sent_; int last_frame_number_begin_main_frame_sent_;
// These are used to ensure that an action only happens once per frame,
// deadline, etc.
bool animate_funnel_;
bool perform_swap_funnel_;
bool request_swap_funnel_;
bool send_begin_main_frame_funnel_;
// prepare_tiles_funnel_ is "filled" each time PrepareTiles is called // prepare_tiles_funnel_ is "filled" each time PrepareTiles is called
// and "drained" on each BeginImplFrame. If the funnel gets too full, // and "drained" on each BeginImplFrame. If the funnel gets too full,
// we start throttling ACTION_PREPARE_TILES such that we average one // we start throttling ACTION_PREPARE_TILES such that we average one
// PrepareTiles per BeginImplFrame. // PrepareTiles per BeginImplFrame.
int prepare_tiles_funnel_; int prepare_tiles_funnel_;
int consecutive_checkerboard_animations_; int consecutive_checkerboard_animations_;
int max_pending_swaps_; int max_pending_swaps_;
int pending_swaps_; int pending_swaps_;
...@@ -321,7 +325,6 @@ class CC_EXPORT SchedulerStateMachine { ...@@ -321,7 +325,6 @@ class CC_EXPORT SchedulerStateMachine {
bool has_pending_tree_; bool has_pending_tree_;
bool pending_tree_is_ready_for_activation_; bool pending_tree_is_ready_for_activation_;
bool active_tree_needs_first_draw_; bool active_tree_needs_first_draw_;
bool did_commit_after_animating_;
bool did_create_and_initialize_first_output_surface_; bool did_create_and_initialize_first_output_surface_;
bool impl_latency_takes_priority_; bool impl_latency_takes_priority_;
bool skip_next_begin_main_frame_to_reduce_latency_; bool skip_next_begin_main_frame_to_reduce_latency_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment