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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 void Scheduler::DidSwapBuffers() { | 225 void Scheduler::DidSwapBuffers() { |
226 state_machine_.DidSwapBuffers(); | 226 state_machine_.DidSwapBuffers(); |
227 | 227 |
228 // There is no need to call ProcessScheduledActions here because | 228 // There is no need to call ProcessScheduledActions here because |
229 // swapping should not trigger any new actions. | 229 // swapping should not trigger any new actions. |
230 if (!inside_process_scheduled_actions_) { | 230 if (!inside_process_scheduled_actions_) { |
231 DCHECK_EQ(state_machine_.NextAction(), SchedulerStateMachine::ACTION_NONE); | 231 DCHECK_EQ(state_machine_.NextAction(), SchedulerStateMachine::ACTION_NONE); |
232 } | 232 } |
233 } | 233 } |
234 | 234 |
235 void Scheduler::SetSwapUsedIncompleteTile(bool used_incomplete_tile) { | |
236 state_machine_.SetSwapUsedIncompleteTile(used_incomplete_tile); | |
237 ProcessScheduledActions(); | |
238 } | |
239 | |
240 void Scheduler::DidSwapBuffersComplete() { | 235 void Scheduler::DidSwapBuffersComplete() { |
241 state_machine_.DidSwapBuffersComplete(); | 236 state_machine_.DidSwapBuffersComplete(); |
242 ProcessScheduledActions(); | 237 ProcessScheduledActions(); |
243 } | 238 } |
244 | 239 |
245 void Scheduler::SetImplLatencyTakesPriority(bool impl_latency_takes_priority) { | 240 void Scheduler::SetImplLatencyTakesPriority(bool impl_latency_takes_priority) { |
246 state_machine_.SetImplLatencyTakesPriority(impl_latency_takes_priority); | 241 state_machine_.SetImplLatencyTakesPriority(impl_latency_takes_priority); |
247 ProcessScheduledActions(); | 242 ProcessScheduledActions(); |
248 } | 243 } |
249 | 244 |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
650 break; | 645 break; |
651 case SchedulerStateMachine::ACTION_ANIMATE: | 646 case SchedulerStateMachine::ACTION_ANIMATE: |
652 client_->ScheduledActionAnimate(); | 647 client_->ScheduledActionAnimate(); |
653 break; | 648 break; |
654 case SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME: | 649 case SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME: |
655 client_->ScheduledActionSendBeginMainFrame(); | 650 client_->ScheduledActionSendBeginMainFrame(); |
656 break; | 651 break; |
657 case SchedulerStateMachine::ACTION_COMMIT: | 652 case SchedulerStateMachine::ACTION_COMMIT: |
658 client_->ScheduledActionCommit(); | 653 client_->ScheduledActionCommit(); |
659 break; | 654 break; |
660 case SchedulerStateMachine::ACTION_UPDATE_VISIBLE_TILES: | |
661 client_->ScheduledActionUpdateVisibleTiles(); | |
662 break; | |
663 case SchedulerStateMachine::ACTION_ACTIVATE_SYNC_TREE: | 655 case SchedulerStateMachine::ACTION_ACTIVATE_SYNC_TREE: |
664 client_->ScheduledActionActivateSyncTree(); | 656 client_->ScheduledActionActivateSyncTree(); |
665 break; | 657 break; |
666 case SchedulerStateMachine::ACTION_DRAW_AND_SWAP_IF_POSSIBLE: | 658 case SchedulerStateMachine::ACTION_DRAW_AND_SWAP_IF_POSSIBLE: |
667 DrawAndSwapIfPossible(); | 659 DrawAndSwapIfPossible(); |
668 break; | 660 break; |
669 case SchedulerStateMachine::ACTION_DRAW_AND_SWAP_FORCED: | 661 case SchedulerStateMachine::ACTION_DRAW_AND_SWAP_FORCED: |
670 client_->ScheduledActionDrawAndSwapForced(); | 662 client_->ScheduledActionDrawAndSwapForced(); |
671 break; | 663 break; |
672 case SchedulerStateMachine::ACTION_DRAW_AND_SWAP_ABORT: | 664 case SchedulerStateMachine::ACTION_DRAW_AND_SWAP_ABORT: |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
772 } | 764 } |
773 | 765 |
774 bool Scheduler::IsBeginMainFrameSentOrStarted() const { | 766 bool Scheduler::IsBeginMainFrameSentOrStarted() const { |
775 return (state_machine_.commit_state() == | 767 return (state_machine_.commit_state() == |
776 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || | 768 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || |
777 state_machine_.commit_state() == | 769 state_machine_.commit_state() == |
778 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); | 770 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); |
779 } | 771 } |
780 | 772 |
781 } // namespace cc | 773 } // namespace cc |
OLD | NEW |