| 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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 return begin_impl_frame_args_.frame_time; | 328 return begin_impl_frame_args_.frame_time; |
| 329 } | 329 } |
| 330 | 330 |
| 331 void Scheduler::SetupNextBeginFrameIfNeeded() { | 331 void Scheduler::SetupNextBeginFrameIfNeeded() { |
| 332 if (!task_runner_.get()) | 332 if (!task_runner_.get()) |
| 333 return; | 333 return; |
| 334 | 334 |
| 335 if (state_machine_.ShouldSetNeedsBeginFrames( | 335 if (state_machine_.ShouldSetNeedsBeginFrames( |
| 336 frame_source_->NeedsBeginFrames())) { | 336 frame_source_->NeedsBeginFrames())) { |
| 337 frame_source_->SetNeedsBeginFrames(state_machine_.BeginFrameNeeded()); | 337 frame_source_->SetNeedsBeginFrames(state_machine_.BeginFrameNeeded()); |
| 338 if (!frame_source_->NeedsBeginFrames()) { |
| 339 client_->SendBeginMainFrameNoLongerRequired(); |
| 340 } |
| 338 } | 341 } |
| 339 | 342 |
| 340 if (state_machine_.begin_impl_frame_state() == | 343 if (state_machine_.begin_impl_frame_state() == |
| 341 SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_INSIDE_DEADLINE) { | 344 SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_INSIDE_DEADLINE) { |
| 342 frame_source_->DidFinishFrame(begin_retro_frame_args_.size()); | 345 frame_source_->DidFinishFrame(begin_retro_frame_args_.size()); |
| 343 } | 346 } |
| 344 | 347 |
| 345 PostBeginRetroFrameIfNeeded(); | 348 PostBeginRetroFrameIfNeeded(); |
| 346 SetupPollingMechanisms(); | 349 SetupPollingMechanisms(); |
| 347 } | 350 } |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 818 } | 821 } |
| 819 | 822 |
| 820 bool Scheduler::IsBeginMainFrameSentOrStarted() const { | 823 bool Scheduler::IsBeginMainFrameSentOrStarted() const { |
| 821 return (state_machine_.commit_state() == | 824 return (state_machine_.commit_state() == |
| 822 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || | 825 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || |
| 823 state_machine_.commit_state() == | 826 state_machine_.commit_state() == |
| 824 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); | 827 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); |
| 825 } | 828 } |
| 826 | 829 |
| 827 } // namespace cc | 830 } // namespace cc |
| OLD | NEW |