Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(204)

Side by Side Diff: cc/scheduler/scheduler.cc

Issue 522903002: cc: Be less aggressive about scheduling for scroll handlers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Renamed scheduler part. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/scheduler/scheduler.h ('k') | cc/scheduler/scheduler_state_machine.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "cc/scheduler/scheduler.h" 5 #include "cc/scheduler/scheduler.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include "base/auto_reset.h" 8 #include "base/auto_reset.h"
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/debug/trace_event_argument.h" 10 #include "base/debug/trace_event_argument.h"
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 void Scheduler::SetSwapUsedIncompleteTile(bool used_incomplete_tile) { 204 void Scheduler::SetSwapUsedIncompleteTile(bool used_incomplete_tile) {
205 state_machine_.SetSwapUsedIncompleteTile(used_incomplete_tile); 205 state_machine_.SetSwapUsedIncompleteTile(used_incomplete_tile);
206 ProcessScheduledActions(); 206 ProcessScheduledActions();
207 } 207 }
208 208
209 void Scheduler::DidSwapBuffersComplete() { 209 void Scheduler::DidSwapBuffersComplete() {
210 state_machine_.DidSwapBuffersComplete(); 210 state_machine_.DidSwapBuffersComplete();
211 ProcessScheduledActions(); 211 ProcessScheduledActions();
212 } 212 }
213 213
214 void Scheduler::SetSmoothnessTakesPriority(bool smoothness_takes_priority) { 214 void Scheduler::SetImplLatencyTakesPriority(bool impl_latency_takes_priority) {
215 state_machine_.SetSmoothnessTakesPriority(smoothness_takes_priority); 215 state_machine_.SetImplLatencyTakesPriority(impl_latency_takes_priority);
216 ProcessScheduledActions(); 216 ProcessScheduledActions();
217 } 217 }
218 218
219 void Scheduler::NotifyReadyToCommit() { 219 void Scheduler::NotifyReadyToCommit() {
220 TRACE_EVENT0("cc", "Scheduler::NotifyReadyToCommit"); 220 TRACE_EVENT0("cc", "Scheduler::NotifyReadyToCommit");
221 state_machine_.NotifyReadyToCommit(); 221 state_machine_.NotifyReadyToCommit();
222 ProcessScheduledActions(); 222 ProcessScheduledActions();
223 } 223 }
224 224
225 void Scheduler::BeginMainFrameAborted(bool did_handle) { 225 void Scheduler::BeginMainFrameAborted(bool did_handle) {
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 DCHECK_EQ(state_machine_.begin_impl_frame_state(), 505 DCHECK_EQ(state_machine_.begin_impl_frame_state(),
506 SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_IDLE); 506 SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_IDLE);
507 DCHECK(state_machine_.HasInitializedOutputSurface()); 507 DCHECK(state_machine_.HasInitializedOutputSurface());
508 508
509 advance_commit_state_task_.Cancel(); 509 advance_commit_state_task_.Cancel();
510 510
511 base::TimeDelta draw_duration_estimate = client_->DrawDurationEstimate(); 511 base::TimeDelta draw_duration_estimate = client_->DrawDurationEstimate();
512 begin_impl_frame_args_ = args; 512 begin_impl_frame_args_ = args;
513 begin_impl_frame_args_.deadline -= draw_duration_estimate; 513 begin_impl_frame_args_.deadline -= draw_duration_estimate;
514 514
515 if (!state_machine_.smoothness_takes_priority() && 515 if (!state_machine_.impl_latency_takes_priority() &&
516 state_machine_.MainThreadIsInHighLatencyMode() && 516 state_machine_.MainThreadIsInHighLatencyMode() &&
517 CanCommitAndActivateBeforeDeadline()) { 517 CanCommitAndActivateBeforeDeadline()) {
518 state_machine_.SetSkipNextBeginMainFrameToReduceLatency(); 518 state_machine_.SetSkipNextBeginMainFrameToReduceLatency();
519 } 519 }
520 520
521 client_->WillBeginImplFrame(begin_impl_frame_args_); 521 client_->WillBeginImplFrame(begin_impl_frame_args_);
522 state_machine_.OnBeginImplFrame(begin_impl_frame_args_); 522 state_machine_.OnBeginImplFrame(begin_impl_frame_args_);
523 devtools_instrumentation::DidBeginFrame(layer_tree_host_id_); 523 devtools_instrumentation::DidBeginFrame(layer_tree_host_id_);
524 524
525 ProcessScheduledActions(); 525 ProcessScheduledActions();
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
753 } 753 }
754 754
755 bool Scheduler::IsBeginMainFrameSentOrStarted() const { 755 bool Scheduler::IsBeginMainFrameSentOrStarted() const {
756 return (state_machine_.commit_state() == 756 return (state_machine_.commit_state() ==
757 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || 757 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT ||
758 state_machine_.commit_state() == 758 state_machine_.commit_state() ==
759 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); 759 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED);
760 } 760 }
761 761
762 } // namespace cc 762 } // namespace cc
OLDNEW
« no previous file with comments | « cc/scheduler/scheduler.h ('k') | cc/scheduler/scheduler_state_machine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698