| 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 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 args.AsValue()); | 524 args.AsValue()); |
| 525 begin_impl_frame_args_ = args; | 525 begin_impl_frame_args_ = args; |
| 526 BeginImplFrame(); | 526 BeginImplFrame(); |
| 527 FinishImplFrame(); | 527 FinishImplFrame(); |
| 528 } | 528 } |
| 529 | 529 |
| 530 void Scheduler::FinishImplFrame() { | 530 void Scheduler::FinishImplFrame() { |
| 531 state_machine_.OnBeginImplFrameIdle(); | 531 state_machine_.OnBeginImplFrameIdle(); |
| 532 ProcessScheduledActions(); | 532 ProcessScheduledActions(); |
| 533 | 533 |
| 534 client_->DidBeginImplFrameDeadline(); | 534 client_->DidFinishImplFrame(); |
| 535 frame_source_->DidFinishFrame(begin_retro_frame_args_.size()); | 535 frame_source_->DidFinishFrame(begin_retro_frame_args_.size()); |
| 536 } | 536 } |
| 537 | 537 |
| 538 // BeginImplFrame starts a compositor frame that will wait up until a deadline | 538 // BeginImplFrame starts a compositor frame that will wait up until a deadline |
| 539 // for a BeginMainFrame+activation to complete before it times out and draws | 539 // for a BeginMainFrame+activation to complete before it times out and draws |
| 540 // any asynchronous animation and scroll/pinch updates. | 540 // any asynchronous animation and scroll/pinch updates. |
| 541 void Scheduler::BeginImplFrame() { | 541 void Scheduler::BeginImplFrame() { |
| 542 DCHECK_EQ(state_machine_.begin_impl_frame_state(), | 542 DCHECK_EQ(state_machine_.begin_impl_frame_state(), |
| 543 SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_IDLE); | 543 SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_IDLE); |
| 544 DCHECK(!BeginImplFrameDeadlinePending()); | 544 DCHECK(!BeginImplFrameDeadlinePending()); |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 831 } | 831 } |
| 832 | 832 |
| 833 bool Scheduler::IsBeginMainFrameSentOrStarted() const { | 833 bool Scheduler::IsBeginMainFrameSentOrStarted() const { |
| 834 return (state_machine_.commit_state() == | 834 return (state_machine_.commit_state() == |
| 835 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || | 835 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || |
| 836 state_machine_.commit_state() == | 836 state_machine_.commit_state() == |
| 837 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); | 837 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); |
| 838 } | 838 } |
| 839 | 839 |
| 840 } // namespace cc | 840 } // namespace cc |
| OLD | NEW |