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 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 state_machine_.SetChildrenNeedBeginFrames(children_need_begin_frames); | 393 state_machine_.SetChildrenNeedBeginFrames(children_need_begin_frames); |
394 ProcessScheduledActions(); | 394 ProcessScheduledActions(); |
395 } | 395 } |
396 | 396 |
397 void Scheduler::SetAuthoritativeVSyncInterval(const base::TimeDelta& interval) { | 397 void Scheduler::SetAuthoritativeVSyncInterval(const base::TimeDelta& interval) { |
398 authoritative_vsync_interval_ = interval; | 398 authoritative_vsync_interval_ = interval; |
399 if (vsync_observer_) | 399 if (vsync_observer_) |
400 vsync_observer_->OnUpdateVSyncParameters(last_vsync_timebase_, interval); | 400 vsync_observer_->OnUpdateVSyncParameters(last_vsync_timebase_, interval); |
401 } | 401 } |
402 | 402 |
| 403 void Scheduler::SetVideoNeedsBeginFrames(bool video_needs_begin_frames) { |
| 404 state_machine_.SetVideoNeedsBeginFrames(video_needs_begin_frames); |
| 405 ProcessScheduledActions(); |
| 406 } |
| 407 |
403 void Scheduler::OnDrawForOutputSurface() { | 408 void Scheduler::OnDrawForOutputSurface() { |
404 DCHECK(settings_.using_synchronous_renderer_compositor); | 409 DCHECK(settings_.using_synchronous_renderer_compositor); |
405 DCHECK_EQ(state_machine_.begin_impl_frame_state(), | 410 DCHECK_EQ(state_machine_.begin_impl_frame_state(), |
406 SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_IDLE); | 411 SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_IDLE); |
407 DCHECK(!BeginImplFrameDeadlinePending()); | 412 DCHECK(!BeginImplFrameDeadlinePending()); |
408 | 413 |
409 state_machine_.OnBeginImplFrameDeadline(); | 414 state_machine_.OnBeginImplFrameDeadline(); |
410 ProcessScheduledActions(); | 415 ProcessScheduledActions(); |
411 | 416 |
412 state_machine_.OnBeginImplFrameIdle(); | 417 state_machine_.OnBeginImplFrameIdle(); |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
824 } | 829 } |
825 | 830 |
826 bool Scheduler::IsBeginMainFrameSentOrStarted() const { | 831 bool Scheduler::IsBeginMainFrameSentOrStarted() const { |
827 return (state_machine_.commit_state() == | 832 return (state_machine_.commit_state() == |
828 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || | 833 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || |
829 state_machine_.commit_state() == | 834 state_machine_.commit_state() == |
830 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); | 835 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); |
831 } | 836 } |
832 | 837 |
833 } // namespace cc | 838 } // namespace cc |
OLD | NEW |