| 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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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) { | 196 void Scheduler::SetMaxSwapsPending(int max) { |
| 197 // TODO(brianderson): Remove all callers of this function. |
| 198 DCHECK_EQ(1, max) << "Surface and CompositorTimingHistory do not support " |
| 199 "multiple pending swaps."; |
| 197 state_machine_.SetMaxSwapsPending(max); | 200 state_machine_.SetMaxSwapsPending(max); |
| 198 } | 201 } |
| 199 | 202 |
| 200 void Scheduler::DidSwapBuffers() { | 203 void Scheduler::DidSwapBuffers() { |
| 201 state_machine_.DidSwapBuffers(); | 204 state_machine_.DidSwapBuffers(); |
| 202 | 205 |
| 203 // There is no need to call ProcessScheduledActions here because | 206 // There is no need to call ProcessScheduledActions here because |
| 204 // swapping should not trigger any new actions. | 207 // swapping should not trigger any new actions. |
| 205 if (!inside_process_scheduled_actions_) { | 208 if (!inside_process_scheduled_actions_) { |
| 206 DCHECK_EQ(state_machine_.NextAction(), SchedulerStateMachine::ACTION_NONE); | 209 DCHECK_EQ(state_machine_.NextAction(), SchedulerStateMachine::ACTION_NONE); |
| (...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 847 } | 850 } |
| 848 | 851 |
| 849 bool Scheduler::IsBeginMainFrameSentOrStarted() const { | 852 bool Scheduler::IsBeginMainFrameSentOrStarted() const { |
| 850 return (state_machine_.begin_main_frame_state() == | 853 return (state_machine_.begin_main_frame_state() == |
| 851 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_SENT || | 854 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_SENT || |
| 852 state_machine_.begin_main_frame_state() == | 855 state_machine_.begin_main_frame_state() == |
| 853 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_STARTED); | 856 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_STARTED); |
| 854 } | 857 } |
| 855 | 858 |
| 856 } // namespace cc | 859 } // namespace cc |
| OLD | NEW |