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_->SendBeginMainFrameNotExpectedSoon(); | |
340 } | |
341 } | 338 } |
342 | 339 |
343 if (state_machine_.begin_impl_frame_state() == | 340 if (state_machine_.begin_impl_frame_state() == |
344 SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_INSIDE_DEADLINE) { | 341 SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_INSIDE_DEADLINE) { |
345 frame_source_->DidFinishFrame(begin_retro_frame_args_.size()); | 342 frame_source_->DidFinishFrame(begin_retro_frame_args_.size()); |
346 } | 343 } |
347 | 344 |
348 PostBeginRetroFrameIfNeeded(); | 345 PostBeginRetroFrameIfNeeded(); |
349 SetupPollingMechanisms(); | 346 SetupPollingMechanisms(); |
350 } | 347 } |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
821 } | 818 } |
822 | 819 |
823 bool Scheduler::IsBeginMainFrameSentOrStarted() const { | 820 bool Scheduler::IsBeginMainFrameSentOrStarted() const { |
824 return (state_machine_.commit_state() == | 821 return (state_machine_.commit_state() == |
825 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || | 822 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || |
826 state_machine_.commit_state() == | 823 state_machine_.commit_state() == |
827 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); | 824 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); |
828 } | 825 } |
829 | 826 |
830 } // namespace cc | 827 } // namespace cc |
OLD | NEW |