| 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/debug/trace_event_argument.h" | 10 #include "base/debug/trace_event_argument.h" |
| (...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 625 | 625 |
| 626 base::AutoReset<bool> mark_inside(&inside_process_scheduled_actions_, true); | 626 base::AutoReset<bool> mark_inside(&inside_process_scheduled_actions_, true); |
| 627 | 627 |
| 628 SchedulerStateMachine::Action action; | 628 SchedulerStateMachine::Action action; |
| 629 do { | 629 do { |
| 630 action = state_machine_.NextAction(); | 630 action = state_machine_.NextAction(); |
| 631 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("cc.debug.scheduler"), | 631 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("cc.debug.scheduler"), |
| 632 "SchedulerStateMachine", | 632 "SchedulerStateMachine", |
| 633 "state", | 633 "state", |
| 634 AsValue()); | 634 AsValue()); |
| 635 VLOG(2) << "Scheduler::ProcessScheduledActions: " |
| 636 << SchedulerStateMachine::ActionToString(action) << " " |
| 637 << state_machine_.GetStatesForDebugging(); |
| 635 state_machine_.UpdateState(action); | 638 state_machine_.UpdateState(action); |
| 636 base::AutoReset<SchedulerStateMachine::Action> | 639 base::AutoReset<SchedulerStateMachine::Action> |
| 637 mark_inside_action(&inside_action_, action); | 640 mark_inside_action(&inside_action_, action); |
| 638 switch (action) { | 641 switch (action) { |
| 639 case SchedulerStateMachine::ACTION_NONE: | 642 case SchedulerStateMachine::ACTION_NONE: |
| 640 break; | 643 break; |
| 641 case SchedulerStateMachine::ACTION_ANIMATE: | 644 case SchedulerStateMachine::ACTION_ANIMATE: |
| 642 client_->ScheduledActionAnimate(); | 645 client_->ScheduledActionAnimate(); |
| 643 break; | 646 break; |
| 644 case SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME: | 647 case SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME: |
| 645 VLOG(2) << "Scheduler::ProcessScheduledActions: " | |
| 646 "ACTION_SEND_BEGIN_MAIN_FRAME"; | |
| 647 client_->ScheduledActionSendBeginMainFrame(); | 648 client_->ScheduledActionSendBeginMainFrame(); |
| 648 break; | 649 break; |
| 649 case SchedulerStateMachine::ACTION_COMMIT: | 650 case SchedulerStateMachine::ACTION_COMMIT: |
| 650 client_->ScheduledActionCommit(); | 651 client_->ScheduledActionCommit(); |
| 651 break; | 652 break; |
| 652 case SchedulerStateMachine::ACTION_UPDATE_VISIBLE_TILES: | 653 case SchedulerStateMachine::ACTION_UPDATE_VISIBLE_TILES: |
| 653 client_->ScheduledActionUpdateVisibleTiles(); | 654 client_->ScheduledActionUpdateVisibleTiles(); |
| 654 break; | 655 break; |
| 655 case SchedulerStateMachine::ACTION_ACTIVATE_SYNC_TREE: | 656 case SchedulerStateMachine::ACTION_ACTIVATE_SYNC_TREE: |
| 656 client_->ScheduledActionActivateSyncTree(); | 657 client_->ScheduledActionActivateSyncTree(); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 757 } | 758 } |
| 758 | 759 |
| 759 bool Scheduler::IsBeginMainFrameSentOrStarted() const { | 760 bool Scheduler::IsBeginMainFrameSentOrStarted() const { |
| 760 return (state_machine_.commit_state() == | 761 return (state_machine_.commit_state() == |
| 761 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || | 762 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || |
| 762 state_machine_.commit_state() == | 763 state_machine_.commit_state() == |
| 763 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); | 764 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); |
| 764 } | 765 } |
| 765 | 766 |
| 766 } // namespace cc | 767 } // namespace cc |
| OLD | NEW |