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/logging.h" | 10 #include "base/logging.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 } | 59 } |
60 | 60 |
61 Scheduler::~Scheduler() { | 61 Scheduler::~Scheduler() { |
62 SetBeginFrameSource(nullptr); | 62 SetBeginFrameSource(nullptr); |
63 } | 63 } |
64 | 64 |
65 void Scheduler::Stop() { | 65 void Scheduler::Stop() { |
66 stopped_ = true; | 66 stopped_ = true; |
67 } | 67 } |
68 | 68 |
| 69 void Scheduler::SetNeedsImplSideInvalidation() { |
| 70 state_machine_.SetNeedsImplSideInvalidation(); |
| 71 ProcessScheduledActions(); |
| 72 } |
| 73 |
69 base::TimeTicks Scheduler::Now() const { | 74 base::TimeTicks Scheduler::Now() const { |
70 base::TimeTicks now = base::TimeTicks::Now(); | 75 base::TimeTicks now = base::TimeTicks::Now(); |
71 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("cc.debug.scheduler.now"), | 76 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("cc.debug.scheduler.now"), |
72 "Scheduler::Now", "now", now); | 77 "Scheduler::Now", "now", now); |
73 return now; | 78 return now; |
74 } | 79 } |
75 | 80 |
76 void Scheduler::SetVisible(bool visible) { | 81 void Scheduler::SetVisible(bool visible) { |
77 state_machine_.SetVisible(visible); | 82 state_machine_.SetVisible(visible); |
78 UpdateCompositorTimingHistoryRecordingEnabled(); | 83 UpdateCompositorTimingHistoryRecordingEnabled(); |
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
613 state_machine_.WillCommit(commit_has_no_updates); | 618 state_machine_.WillCommit(commit_has_no_updates); |
614 client_->ScheduledActionCommit(); | 619 client_->ScheduledActionCommit(); |
615 break; | 620 break; |
616 } | 621 } |
617 case SchedulerStateMachine::ACTION_ACTIVATE_SYNC_TREE: | 622 case SchedulerStateMachine::ACTION_ACTIVATE_SYNC_TREE: |
618 compositor_timing_history_->WillActivate(); | 623 compositor_timing_history_->WillActivate(); |
619 state_machine_.WillActivate(); | 624 state_machine_.WillActivate(); |
620 client_->ScheduledActionActivateSyncTree(); | 625 client_->ScheduledActionActivateSyncTree(); |
621 compositor_timing_history_->DidActivate(); | 626 compositor_timing_history_->DidActivate(); |
622 break; | 627 break; |
| 628 case SchedulerStateMachine::ACTION_RUN_IMPL_SIDE_INVALIDATION: |
| 629 state_machine_.WillRunImplSideInvalidation(); |
| 630 client_->ScheduledActionRunImplSideInvalidation(); |
623 case SchedulerStateMachine::ACTION_DRAW_IF_POSSIBLE: | 631 case SchedulerStateMachine::ACTION_DRAW_IF_POSSIBLE: |
624 DrawIfPossible(); | 632 DrawIfPossible(); |
625 break; | 633 break; |
626 case SchedulerStateMachine::ACTION_DRAW_FORCED: | 634 case SchedulerStateMachine::ACTION_DRAW_FORCED: |
627 DrawForced(); | 635 DrawForced(); |
628 break; | 636 break; |
629 case SchedulerStateMachine::ACTION_DRAW_ABORT: { | 637 case SchedulerStateMachine::ACTION_DRAW_ABORT: { |
630 // No action is actually performed, but this allows the state machine to | 638 // No action is actually performed, but this allows the state machine to |
631 // drain the pipeline without actually drawing. | 639 // drain the pipeline without actually drawing. |
632 state_machine_.AbortDraw(); | 640 state_machine_.AbortDraw(); |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
767 } | 775 } |
768 | 776 |
769 bool Scheduler::IsBeginMainFrameSentOrStarted() const { | 777 bool Scheduler::IsBeginMainFrameSentOrStarted() const { |
770 return (state_machine_.begin_main_frame_state() == | 778 return (state_machine_.begin_main_frame_state() == |
771 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_SENT || | 779 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_SENT || |
772 state_machine_.begin_main_frame_state() == | 780 state_machine_.begin_main_frame_state() == |
773 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_STARTED); | 781 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_STARTED); |
774 } | 782 } |
775 | 783 |
776 } // namespace cc | 784 } // namespace cc |
OLD | NEW |