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 #include "base/auto_reset.h" | 8 #include "base/auto_reset.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 bool Scheduler::IsBeginMainFrameSent() const { | 605 bool Scheduler::IsBeginMainFrameSent() const { |
606 return state_machine_.commit_state() == | 606 return state_machine_.commit_state() == |
607 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT; | 607 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT; |
608 } | 608 } |
609 | 609 |
610 void Scheduler::DrawAndSwapIfPossible() { | 610 void Scheduler::DrawAndSwapIfPossible() { |
611 DrawResult result = client_->ScheduledActionDrawAndSwapIfPossible(); | 611 DrawResult result = client_->ScheduledActionDrawAndSwapIfPossible(); |
612 state_machine_.DidDrawIfPossibleCompleted(result); | 612 state_machine_.DidDrawIfPossibleCompleted(result); |
613 } | 613 } |
614 | 614 |
| 615 void Scheduler::SetDeferCommits(bool defer_commits) { |
| 616 TRACE_EVENT0("cc", "Scheduler::SetDeferCommits"); |
| 617 state_machine_.SetDeferCommits(defer_commits); |
| 618 ProcessScheduledActions(); |
| 619 } |
| 620 |
615 void Scheduler::ProcessScheduledActions() { | 621 void Scheduler::ProcessScheduledActions() { |
616 // We do not allow ProcessScheduledActions to be recursive. | 622 // We do not allow ProcessScheduledActions to be recursive. |
617 // The top-level call will iteratively execute the next action for us anyway. | 623 // The top-level call will iteratively execute the next action for us anyway. |
618 if (inside_process_scheduled_actions_) | 624 if (inside_process_scheduled_actions_) |
619 return; | 625 return; |
620 | 626 |
621 base::AutoReset<bool> mark_inside(&inside_process_scheduled_actions_, true); | 627 base::AutoReset<bool> mark_inside(&inside_process_scheduled_actions_, true); |
622 | 628 |
623 SchedulerStateMachine::Action action; | 629 SchedulerStateMachine::Action action; |
624 do { | 630 do { |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
747 } | 753 } |
748 | 754 |
749 bool Scheduler::IsBeginMainFrameSentOrStarted() const { | 755 bool Scheduler::IsBeginMainFrameSentOrStarted() const { |
750 return (state_machine_.commit_state() == | 756 return (state_machine_.commit_state() == |
751 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || | 757 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || |
752 state_machine_.commit_state() == | 758 state_machine_.commit_state() == |
753 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); | 759 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); |
754 } | 760 } |
755 | 761 |
756 } // namespace cc | 762 } // namespace cc |
OLD | NEW |