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 #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 Loading... |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |