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