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/logging.h" | 10 #include "base/logging.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 layer_tree_host_id_(layer_tree_host_id), | 79 layer_tree_host_id_(layer_tree_host_id), |
80 impl_task_runner_(impl_task_runner), | 80 impl_task_runner_(impl_task_runner), |
81 vsync_interval_(BeginFrameArgs::DefaultInterval()), | 81 vsync_interval_(BeginFrameArgs::DefaultInterval()), |
82 last_set_needs_begin_frame_(false), | 82 last_set_needs_begin_frame_(false), |
83 begin_unthrottled_frame_posted_(false), | 83 begin_unthrottled_frame_posted_(false), |
84 begin_retro_frame_posted_(false), | 84 begin_retro_frame_posted_(false), |
85 state_machine_(scheduler_settings), | 85 state_machine_(scheduler_settings), |
86 inside_process_scheduled_actions_(false), | 86 inside_process_scheduled_actions_(false), |
87 inside_action_(SchedulerStateMachine::ACTION_NONE), | 87 inside_action_(SchedulerStateMachine::ACTION_NONE), |
88 weak_factory_(this) { | 88 weak_factory_(this) { |
| 89 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("cc.debug.scheduler"), |
| 90 "Scheduler::Scheduler", |
| 91 "settings", |
| 92 ToTrace(settings_)); |
89 DCHECK(client_); | 93 DCHECK(client_); |
90 DCHECK(!state_machine_.BeginFrameNeeded()); | 94 DCHECK(!state_machine_.BeginFrameNeeded()); |
91 if (settings_.main_frame_before_activation_enabled) { | 95 if (settings_.main_frame_before_activation_enabled) { |
92 DCHECK(settings_.main_frame_before_draw_enabled); | 96 DCHECK(settings_.main_frame_before_draw_enabled); |
93 } | 97 } |
94 | 98 |
95 begin_retro_frame_closure_ = | 99 begin_retro_frame_closure_ = |
96 base::Bind(&Scheduler::BeginRetroFrame, weak_factory_.GetWeakPtr()); | 100 base::Bind(&Scheduler::BeginRetroFrame, weak_factory_.GetWeakPtr()); |
97 begin_unthrottled_frame_closure_ = | 101 begin_unthrottled_frame_closure_ = |
98 base::Bind(&Scheduler::BeginUnthrottledFrame, weak_factory_.GetWeakPtr()); | 102 base::Bind(&Scheduler::BeginUnthrottledFrame, weak_factory_.GetWeakPtr()); |
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
750 } | 754 } |
751 | 755 |
752 bool Scheduler::IsBeginMainFrameSentOrStarted() const { | 756 bool Scheduler::IsBeginMainFrameSentOrStarted() const { |
753 return (state_machine_.commit_state() == | 757 return (state_machine_.commit_state() == |
754 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || | 758 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || |
755 state_machine_.commit_state() == | 759 state_machine_.commit_state() == |
756 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); | 760 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); |
757 } | 761 } |
758 | 762 |
759 } // namespace cc | 763 } // namespace cc |
OLD | NEW |