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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 state_machine_.SetNeedsAnimate(); | 186 state_machine_.SetNeedsAnimate(); |
187 ProcessScheduledActions(); | 187 ProcessScheduledActions(); |
188 } | 188 } |
189 | 189 |
190 void Scheduler::SetNeedsPrepareTiles() { | 190 void Scheduler::SetNeedsPrepareTiles() { |
191 DCHECK(!IsInsideAction(SchedulerStateMachine::ACTION_PREPARE_TILES)); | 191 DCHECK(!IsInsideAction(SchedulerStateMachine::ACTION_PREPARE_TILES)); |
192 state_machine_.SetNeedsPrepareTiles(); | 192 state_machine_.SetNeedsPrepareTiles(); |
193 ProcessScheduledActions(); | 193 ProcessScheduledActions(); |
194 } | 194 } |
195 | 195 |
196 void Scheduler::SetMaxSwapsPending(int max) { | |
197 state_machine_.SetMaxSwapsPending(max); | |
198 } | |
199 | |
200 void Scheduler::DidSwapBuffers() { | 196 void Scheduler::DidSwapBuffers() { |
201 state_machine_.DidSwapBuffers(); | 197 state_machine_.DidSwapBuffers(); |
202 | 198 |
203 // There is no need to call ProcessScheduledActions here because | 199 // There is no need to call ProcessScheduledActions here because |
204 // swapping should not trigger any new actions. | 200 // swapping should not trigger any new actions. |
205 if (!inside_process_scheduled_actions_) { | 201 if (!inside_process_scheduled_actions_) { |
206 DCHECK_EQ(state_machine_.NextAction(), SchedulerStateMachine::ACTION_NONE); | 202 DCHECK_EQ(state_machine_.NextAction(), SchedulerStateMachine::ACTION_NONE); |
207 } | 203 } |
208 } | 204 } |
209 | 205 |
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
847 } | 843 } |
848 | 844 |
849 bool Scheduler::IsBeginMainFrameSentOrStarted() const { | 845 bool Scheduler::IsBeginMainFrameSentOrStarted() const { |
850 return (state_machine_.begin_main_frame_state() == | 846 return (state_machine_.begin_main_frame_state() == |
851 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_SENT || | 847 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_SENT || |
852 state_machine_.begin_main_frame_state() == | 848 state_machine_.begin_main_frame_state() == |
853 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_STARTED); | 849 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_STARTED); |
854 } | 850 } |
855 | 851 |
856 } // namespace cc | 852 } // namespace cc |
OLD | NEW |