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/stack_trace.h" |
10 #include "base/logging.h" | 11 #include "base/logging.h" |
11 #include "base/profiler/scoped_tracker.h" | 12 #include "base/profiler/scoped_tracker.h" |
12 #include "base/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
13 #include "base/trace_event/trace_event.h" | 14 #include "base/trace_event/trace_event.h" |
14 #include "base/trace_event/trace_event_argument.h" | 15 #include "base/trace_event/trace_event_argument.h" |
15 #include "cc/debug/devtools_instrumentation.h" | 16 #include "cc/debug/devtools_instrumentation.h" |
16 #include "cc/debug/traced_value.h" | 17 #include "cc/debug/traced_value.h" |
17 #include "cc/scheduler/delay_based_time_source.h" | 18 #include "cc/scheduler/delay_based_time_source.h" |
18 | 19 |
19 namespace cc { | 20 namespace cc { |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 state_machine_.DidSwapBuffers(); | 220 state_machine_.DidSwapBuffers(); |
220 | 221 |
221 // There is no need to call ProcessScheduledActions here because | 222 // There is no need to call ProcessScheduledActions here because |
222 // swapping should not trigger any new actions. | 223 // swapping should not trigger any new actions. |
223 if (!inside_process_scheduled_actions_) { | 224 if (!inside_process_scheduled_actions_) { |
224 DCHECK_EQ(state_machine_.NextAction(), SchedulerStateMachine::ACTION_NONE); | 225 DCHECK_EQ(state_machine_.NextAction(), SchedulerStateMachine::ACTION_NONE); |
225 } | 226 } |
226 } | 227 } |
227 | 228 |
228 void Scheduler::DidSwapBuffersComplete() { | 229 void Scheduler::DidSwapBuffersComplete() { |
229 DCHECK_GT(state_machine_.pending_swaps(), 0) << AsValue()->ToString(); | 230 DCHECK_GT(state_machine_.pending_swaps(), 0) |
| 231 << AsValue()->ToString() << base::debug::StackTrace().ToString(); |
230 state_machine_.DidSwapBuffersComplete(); | 232 state_machine_.DidSwapBuffersComplete(); |
231 ProcessScheduledActions(); | 233 ProcessScheduledActions(); |
232 } | 234 } |
233 | 235 |
234 void Scheduler::SetImplLatencyTakesPriority(bool impl_latency_takes_priority) { | 236 void Scheduler::SetImplLatencyTakesPriority(bool impl_latency_takes_priority) { |
235 state_machine_.SetImplLatencyTakesPriority(impl_latency_takes_priority); | 237 state_machine_.SetImplLatencyTakesPriority(impl_latency_takes_priority); |
236 ProcessScheduledActions(); | 238 ProcessScheduledActions(); |
237 } | 239 } |
238 | 240 |
239 void Scheduler::NotifyReadyToCommit() { | 241 void Scheduler::NotifyReadyToCommit() { |
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
820 } | 822 } |
821 | 823 |
822 bool Scheduler::IsBeginMainFrameSentOrStarted() const { | 824 bool Scheduler::IsBeginMainFrameSentOrStarted() const { |
823 return (state_machine_.commit_state() == | 825 return (state_machine_.commit_state() == |
824 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || | 826 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || |
825 state_machine_.commit_state() == | 827 state_machine_.commit_state() == |
826 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); | 828 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); |
827 } | 829 } |
828 | 830 |
829 } // namespace cc | 831 } // namespace cc |
OLD | NEW |