Chromium Code Reviews| 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); | |
|
brianderson
2014/06/17 15:57:01
Probably want to call ProcessScheduledActions here
simonhong
2014/06/18 21:52:05
Done.
| |
| 618 } | |
| 619 | |
| 615 void Scheduler::ProcessScheduledActions() { | 620 void Scheduler::ProcessScheduledActions() { |
| 616 // We do not allow ProcessScheduledActions to be recursive. | 621 // We do not allow ProcessScheduledActions to be recursive. |
| 617 // The top-level call will iteratively execute the next action for us anyway. | 622 // The top-level call will iteratively execute the next action for us anyway. |
| 618 if (inside_process_scheduled_actions_) | 623 if (inside_process_scheduled_actions_) |
| 619 return; | 624 return; |
| 620 | 625 |
| 621 base::AutoReset<bool> mark_inside(&inside_process_scheduled_actions_, true); | 626 base::AutoReset<bool> mark_inside(&inside_process_scheduled_actions_, true); |
| 622 | 627 |
| 623 SchedulerStateMachine::Action action; | 628 SchedulerStateMachine::Action action; |
| 624 do { | 629 do { |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 747 } | 752 } |
| 748 | 753 |
| 749 bool Scheduler::IsBeginMainFrameSentOrStarted() const { | 754 bool Scheduler::IsBeginMainFrameSentOrStarted() const { |
| 750 return (state_machine_.commit_state() == | 755 return (state_machine_.commit_state() == |
| 751 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || | 756 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || |
| 752 state_machine_.commit_state() == | 757 state_machine_.commit_state() == |
| 753 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); | 758 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); |
| 754 } | 759 } |
| 755 | 760 |
| 756 } // namespace cc | 761 } // namespace cc |
| OLD | NEW |