diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-12 14:27:29 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-13 09:35:20 +0000 |
commit | c30a6232df03e1efbd9f3b226777b07e087a1122 (patch) | |
tree | e992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/cc/scheduler/scheduler.cc | |
parent | 7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff) | |
download | qtwebengine-chromium-85-based.tar.gz |
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/cc/scheduler/scheduler.cc')
-rw-r--r-- | chromium/cc/scheduler/scheduler.cc | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/chromium/cc/scheduler/scheduler.cc b/chromium/cc/scheduler/scheduler.cc index 445e0696639..8292ee70801 100644 --- a/chromium/cc/scheduler/scheduler.cc +++ b/chromium/cc/scheduler/scheduler.cc @@ -516,20 +516,19 @@ void Scheduler::BeginImplFrameWithDeadline(const viz::BeginFrameArgs& args) { ->BeginMainFrameQueueDurationNotCriticalEstimate(); } - // We defer the invalidation if we expect the main thread to respond within - // this frame, and our prediction in the last frame was correct. That - // is, if we predicted the main thread to be fast and it fails to respond - // before the deadline in the previous frame, we don't defer the invalidation - // in the next frame. - const bool main_thread_response_expected_before_deadline = - bmf_sent_to_ready_to_commit_estimate - time_since_main_frame_sent < - bmf_to_activate_threshold; - const bool previous_invalidation_maybe_skipped_for_main_frame = - state_machine_.should_defer_invalidation_for_fast_main_frame() && - state_machine_.main_thread_failed_to_respond_last_deadline(); + bool main_thread_response_expected_before_deadline; + if (time_since_main_frame_sent > bmf_to_activate_threshold) { + // If the response to a main frame is pending past the desired duration + // then proactively assume that the main thread is slow instead of late + // correction through the frame history. + main_thread_response_expected_before_deadline = false; + } else { + main_thread_response_expected_before_deadline = + bmf_sent_to_ready_to_commit_estimate - time_since_main_frame_sent < + bmf_to_activate_threshold; + } state_machine_.set_should_defer_invalidation_for_fast_main_frame( - main_thread_response_expected_before_deadline && - !previous_invalidation_maybe_skipped_for_main_frame); + main_thread_response_expected_before_deadline); base::TimeDelta bmf_to_activate_estimate = bmf_to_activate_estimate_critical; if (!begin_main_frame_args_.on_critical_path) { @@ -594,7 +593,7 @@ void Scheduler::FinishImplFrame() { DCHECK(!inside_scheduled_action_); { base::AutoReset<bool> mark_inside(&inside_scheduled_action_, true); - client_->DidFinishImplFrame(); + client_->DidFinishImplFrame(last_activate_origin_frame_args()); } if (begin_frame_source_) @@ -745,9 +744,6 @@ void Scheduler::DrawIfPossible() { state_machine_.DidDraw(result); compositor_timing_history_->DidDraw( drawing_with_new_active_tree, - client_->CompositedAnimationsCount(), - client_->MainThreadAnimationsCount(), client_->CurrentFrameHadRAF(), - client_->NextFrameHasPendingRAF(), client_->HasCustomPropertyAnimations()); } @@ -763,9 +759,6 @@ void Scheduler::DrawForced() { state_machine_.DidDraw(result); compositor_timing_history_->DidDraw( drawing_with_new_active_tree, - client_->CompositedAnimationsCount(), - client_->MainThreadAnimationsCount(), client_->CurrentFrameHadRAF(), - client_->NextFrameHasPendingRAF(), client_->HasCustomPropertyAnimations()); } |