| 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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 void Scheduler::DidSwapBuffers() { | 237 void Scheduler::DidSwapBuffers() { |
| 238 state_machine_.DidSwapBuffers(); | 238 state_machine_.DidSwapBuffers(); |
| 239 | 239 |
| 240 // There is no need to call ProcessScheduledActions here because | 240 // There is no need to call ProcessScheduledActions here because |
| 241 // swapping should not trigger any new actions. | 241 // swapping should not trigger any new actions. |
| 242 if (!inside_process_scheduled_actions_) { | 242 if (!inside_process_scheduled_actions_) { |
| 243 DCHECK_EQ(state_machine_.NextAction(), SchedulerStateMachine::ACTION_NONE); | 243 DCHECK_EQ(state_machine_.NextAction(), SchedulerStateMachine::ACTION_NONE); |
| 244 } | 244 } |
| 245 } | 245 } |
| 246 | 246 |
| 247 void Scheduler::SetSwapUsedIncompleteTile(bool used_incomplete_tile) { | |
| 248 state_machine_.SetSwapUsedIncompleteTile(used_incomplete_tile); | |
| 249 ProcessScheduledActions(); | |
| 250 } | |
| 251 | |
| 252 void Scheduler::DidSwapBuffersComplete() { | 247 void Scheduler::DidSwapBuffersComplete() { |
| 253 state_machine_.DidSwapBuffersComplete(); | 248 state_machine_.DidSwapBuffersComplete(); |
| 254 ProcessScheduledActions(); | 249 ProcessScheduledActions(); |
| 255 } | 250 } |
| 256 | 251 |
| 257 void Scheduler::SetImplLatencyTakesPriority(bool impl_latency_takes_priority) { | 252 void Scheduler::SetImplLatencyTakesPriority(bool impl_latency_takes_priority) { |
| 258 state_machine_.SetImplLatencyTakesPriority(impl_latency_takes_priority); | 253 state_machine_.SetImplLatencyTakesPriority(impl_latency_takes_priority); |
| 259 ProcessScheduledActions(); | 254 ProcessScheduledActions(); |
| 260 } | 255 } |
| 261 | 256 |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 662 break; | 657 break; |
| 663 case SchedulerStateMachine::ACTION_ANIMATE: | 658 case SchedulerStateMachine::ACTION_ANIMATE: |
| 664 client_->ScheduledActionAnimate(); | 659 client_->ScheduledActionAnimate(); |
| 665 break; | 660 break; |
| 666 case SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME: | 661 case SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME: |
| 667 client_->ScheduledActionSendBeginMainFrame(); | 662 client_->ScheduledActionSendBeginMainFrame(); |
| 668 break; | 663 break; |
| 669 case SchedulerStateMachine::ACTION_COMMIT: | 664 case SchedulerStateMachine::ACTION_COMMIT: |
| 670 client_->ScheduledActionCommit(); | 665 client_->ScheduledActionCommit(); |
| 671 break; | 666 break; |
| 672 case SchedulerStateMachine::ACTION_UPDATE_VISIBLE_TILES: | |
| 673 client_->ScheduledActionUpdateVisibleTiles(); | |
| 674 break; | |
| 675 case SchedulerStateMachine::ACTION_ACTIVATE_SYNC_TREE: | 667 case SchedulerStateMachine::ACTION_ACTIVATE_SYNC_TREE: |
| 676 client_->ScheduledActionActivateSyncTree(); | 668 client_->ScheduledActionActivateSyncTree(); |
| 677 break; | 669 break; |
| 678 case SchedulerStateMachine::ACTION_DRAW_AND_SWAP_IF_POSSIBLE: | 670 case SchedulerStateMachine::ACTION_DRAW_AND_SWAP_IF_POSSIBLE: |
| 679 DrawAndSwapIfPossible(); | 671 DrawAndSwapIfPossible(); |
| 680 break; | 672 break; |
| 681 case SchedulerStateMachine::ACTION_DRAW_AND_SWAP_FORCED: | 673 case SchedulerStateMachine::ACTION_DRAW_AND_SWAP_FORCED: |
| 682 client_->ScheduledActionDrawAndSwapForced(); | 674 client_->ScheduledActionDrawAndSwapForced(); |
| 683 break; | 675 break; |
| 684 case SchedulerStateMachine::ACTION_DRAW_AND_SWAP_ABORT: | 676 case SchedulerStateMachine::ACTION_DRAW_AND_SWAP_ABORT: |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 784 } | 776 } |
| 785 | 777 |
| 786 bool Scheduler::IsBeginMainFrameSentOrStarted() const { | 778 bool Scheduler::IsBeginMainFrameSentOrStarted() const { |
| 787 return (state_machine_.commit_state() == | 779 return (state_machine_.commit_state() == |
| 788 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || | 780 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || |
| 789 state_machine_.commit_state() == | 781 state_machine_.commit_state() == |
| 790 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); | 782 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); |
| 791 } | 783 } |
| 792 | 784 |
| 793 } // namespace cc | 785 } // namespace cc |
| OLD | NEW |