| 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/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 TRACE_EVENT0("cc", "Scheduler::PollToAdvanceCommitState"); | 644 TRACE_EVENT0("cc", "Scheduler::PollToAdvanceCommitState"); |
| 645 advance_commit_state_task_.Cancel(); | 645 advance_commit_state_task_.Cancel(); |
| 646 ProcessScheduledActions(); | 646 ProcessScheduledActions(); |
| 647 } | 647 } |
| 648 | 648 |
| 649 void Scheduler::DrawAndSwapIfPossible() { | 649 void Scheduler::DrawAndSwapIfPossible() { |
| 650 DrawResult result = client_->ScheduledActionDrawAndSwapIfPossible(); | 650 DrawResult result = client_->ScheduledActionDrawAndSwapIfPossible(); |
| 651 state_machine_.DidDrawIfPossibleCompleted(result); | 651 state_machine_.DidDrawIfPossibleCompleted(result); |
| 652 } | 652 } |
| 653 | 653 |
| 654 void Scheduler::SetDeferCommits(bool defer_commits) { |
| 655 TRACE_EVENT1("cc", "Scheduler::SetDeferCommits", |
| 656 "defer_commits", |
| 657 defer_commits); |
| 658 state_machine_.SetDeferCommits(defer_commits); |
| 659 ProcessScheduledActions(); |
| 660 } |
| 661 |
| 654 void Scheduler::ProcessScheduledActions() { | 662 void Scheduler::ProcessScheduledActions() { |
| 655 // We do not allow ProcessScheduledActions to be recursive. | 663 // We do not allow ProcessScheduledActions to be recursive. |
| 656 // The top-level call will iteratively execute the next action for us anyway. | 664 // The top-level call will iteratively execute the next action for us anyway. |
| 657 if (inside_process_scheduled_actions_) | 665 if (inside_process_scheduled_actions_) |
| 658 return; | 666 return; |
| 659 | 667 |
| 660 base::AutoReset<bool> mark_inside(&inside_process_scheduled_actions_, true); | 668 base::AutoReset<bool> mark_inside(&inside_process_scheduled_actions_, true); |
| 661 | 669 |
| 662 SchedulerStateMachine::Action action; | 670 SchedulerStateMachine::Action action; |
| 663 do { | 671 do { |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 796 } | 804 } |
| 797 | 805 |
| 798 bool Scheduler::IsBeginMainFrameSentOrStarted() const { | 806 bool Scheduler::IsBeginMainFrameSentOrStarted() const { |
| 799 return (state_machine_.commit_state() == | 807 return (state_machine_.commit_state() == |
| 800 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || | 808 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || |
| 801 state_machine_.commit_state() == | 809 state_machine_.commit_state() == |
| 802 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); | 810 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); |
| 803 } | 811 } |
| 804 | 812 |
| 805 } // namespace cc | 813 } // namespace cc |
| OLD | NEW |