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 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 TRACE_EVENT0("cc", "Scheduler::PollToAdvanceCommitState"); | 664 TRACE_EVENT0("cc", "Scheduler::PollToAdvanceCommitState"); |
665 advance_commit_state_task_.Cancel(); | 665 advance_commit_state_task_.Cancel(); |
666 ProcessScheduledActions(); | 666 ProcessScheduledActions(); |
667 } | 667 } |
668 | 668 |
669 void Scheduler::DrawAndSwapIfPossible() { | 669 void Scheduler::DrawAndSwapIfPossible() { |
670 DrawResult result = client_->ScheduledActionDrawAndSwapIfPossible(); | 670 DrawResult result = client_->ScheduledActionDrawAndSwapIfPossible(); |
671 state_machine_.DidDrawIfPossibleCompleted(result); | 671 state_machine_.DidDrawIfPossibleCompleted(result); |
672 } | 672 } |
673 | 673 |
674 void Scheduler::SetDeferCommits(bool defer_commits) { | |
675 TRACE_EVENT1("cc", "Scheduler::SetDeferCommits", | |
676 "defer_commits", | |
677 defer_commits); | |
678 state_machine_.SetDeferCommits(defer_commits); | |
679 ProcessScheduledActions(); | |
680 } | |
681 | |
682 void Scheduler::ProcessScheduledActions() { | 674 void Scheduler::ProcessScheduledActions() { |
683 // We do not allow ProcessScheduledActions to be recursive. | 675 // We do not allow ProcessScheduledActions to be recursive. |
684 // The top-level call will iteratively execute the next action for us anyway. | 676 // The top-level call will iteratively execute the next action for us anyway. |
685 if (inside_process_scheduled_actions_) | 677 if (inside_process_scheduled_actions_) |
686 return; | 678 return; |
687 | 679 |
688 base::AutoReset<bool> mark_inside(&inside_process_scheduled_actions_, true); | 680 base::AutoReset<bool> mark_inside(&inside_process_scheduled_actions_, true); |
689 | 681 |
690 SchedulerStateMachine::Action action; | 682 SchedulerStateMachine::Action action; |
691 do { | 683 do { |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
818 } | 810 } |
819 | 811 |
820 bool Scheduler::IsBeginMainFrameSentOrStarted() const { | 812 bool Scheduler::IsBeginMainFrameSentOrStarted() const { |
821 return (state_machine_.commit_state() == | 813 return (state_machine_.commit_state() == |
822 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || | 814 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || |
823 state_machine_.commit_state() == | 815 state_machine_.commit_state() == |
824 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); | 816 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); |
825 } | 817 } |
826 | 818 |
827 } // namespace cc | 819 } // namespace cc |
OLD | NEW |