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 #ifndef CC_SCHEDULER_SCHEDULER_H_ | 5 #ifndef CC_SCHEDULER_SCHEDULER_H_ |
6 #define CC_SCHEDULER_SCHEDULER_H_ | 6 #define CC_SCHEDULER_SCHEDULER_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 ~Scheduler() override; | 65 ~Scheduler() override; |
66 | 66 |
67 // BeginFrameObserverBase | 67 // BeginFrameObserverBase |
68 void OnBeginFrameSourcePausedChanged(bool paused) override; | 68 void OnBeginFrameSourcePausedChanged(bool paused) override; |
69 bool OnBeginFrameDerivedImpl(const BeginFrameArgs& args) override; | 69 bool OnBeginFrameDerivedImpl(const BeginFrameArgs& args) override; |
70 | 70 |
71 void OnDrawForCompositorFrameSink(bool resourceless_software_draw); | 71 void OnDrawForCompositorFrameSink(bool resourceless_software_draw); |
72 | 72 |
73 const SchedulerSettings& settings() const { return settings_; } | 73 const SchedulerSettings& settings() const { return settings_; } |
74 | 74 |
75 void SetEstimatedParentDrawTime(base::TimeDelta draw_time); | |
76 | |
77 void SetVisible(bool visible); | 75 void SetVisible(bool visible); |
78 bool visible() { return state_machine_.visible(); } | 76 bool visible() { return state_machine_.visible(); } |
79 void SetCanDraw(bool can_draw); | 77 void SetCanDraw(bool can_draw); |
80 void NotifyReadyToActivate(); | 78 void NotifyReadyToActivate(); |
81 void NotifyReadyToDraw(); | 79 void NotifyReadyToDraw(); |
82 void SetBeginFrameSource(BeginFrameSource* source); | 80 void SetBeginFrameSource(BeginFrameSource* source); |
83 | 81 |
84 void SetNeedsBeginMainFrame(); | 82 void SetNeedsBeginMainFrame(); |
85 // Requests a single impl frame (after the current frame if there is one | 83 // Requests a single impl frame (after the current frame if there is one |
86 // active). | 84 // active). |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 // Not owned. | 152 // Not owned. |
155 SchedulerClient* client_; | 153 SchedulerClient* client_; |
156 int layer_tree_host_id_; | 154 int layer_tree_host_id_; |
157 base::SingleThreadTaskRunner* task_runner_; | 155 base::SingleThreadTaskRunner* task_runner_; |
158 | 156 |
159 // Not owned. May be null. | 157 // Not owned. May be null. |
160 BeginFrameSource* begin_frame_source_; | 158 BeginFrameSource* begin_frame_source_; |
161 bool observing_begin_frame_source_; | 159 bool observing_begin_frame_source_; |
162 | 160 |
163 std::unique_ptr<CompositorTimingHistory> compositor_timing_history_; | 161 std::unique_ptr<CompositorTimingHistory> compositor_timing_history_; |
164 base::TimeDelta estimated_parent_draw_time_; | |
165 | 162 |
166 std::deque<BeginFrameArgs> begin_retro_frame_args_; | 163 std::deque<BeginFrameArgs> begin_retro_frame_args_; |
167 SchedulerStateMachine::BeginImplFrameDeadlineMode | 164 SchedulerStateMachine::BeginImplFrameDeadlineMode |
168 begin_impl_frame_deadline_mode_; | 165 begin_impl_frame_deadline_mode_; |
169 BeginFrameTracker begin_impl_frame_tracker_; | 166 BeginFrameTracker begin_impl_frame_tracker_; |
170 BeginFrameArgs begin_main_frame_args_; | 167 BeginFrameArgs begin_main_frame_args_; |
171 | 168 |
172 base::Closure begin_retro_frame_closure_; | 169 base::Closure begin_retro_frame_closure_; |
173 base::Closure begin_impl_frame_deadline_closure_; | 170 base::Closure begin_impl_frame_deadline_closure_; |
174 base::CancelableClosure begin_retro_frame_task_; | 171 base::CancelableClosure begin_retro_frame_task_; |
(...skipping 23 matching lines...) Expand all Loading... |
198 void AdvanceCommitStateIfPossible(); | 195 void AdvanceCommitStateIfPossible(); |
199 bool IsBeginMainFrameSentOrStarted() const; | 196 bool IsBeginMainFrameSentOrStarted() const; |
200 void BeginRetroFrame(); | 197 void BeginRetroFrame(); |
201 void BeginImplFrameWithDeadline(const BeginFrameArgs& args); | 198 void BeginImplFrameWithDeadline(const BeginFrameArgs& args); |
202 void BeginImplFrameSynchronous(const BeginFrameArgs& args); | 199 void BeginImplFrameSynchronous(const BeginFrameArgs& args); |
203 void BeginImplFrame(const BeginFrameArgs& args); | 200 void BeginImplFrame(const BeginFrameArgs& args); |
204 void FinishImplFrame(); | 201 void FinishImplFrame(); |
205 void OnBeginImplFrameDeadline(); | 202 void OnBeginImplFrameDeadline(); |
206 void PollToAdvanceCommitState(); | 203 void PollToAdvanceCommitState(); |
207 | 204 |
208 base::TimeDelta EstimatedParentDrawTime() { | |
209 return estimated_parent_draw_time_; | |
210 } | |
211 | |
212 bool IsInsideAction(SchedulerStateMachine::Action action) { | 205 bool IsInsideAction(SchedulerStateMachine::Action action) { |
213 return inside_action_ == action; | 206 return inside_action_ == action; |
214 } | 207 } |
215 | 208 |
216 base::WeakPtrFactory<Scheduler> weak_factory_; | 209 base::WeakPtrFactory<Scheduler> weak_factory_; |
217 | 210 |
218 DISALLOW_COPY_AND_ASSIGN(Scheduler); | 211 DISALLOW_COPY_AND_ASSIGN(Scheduler); |
219 }; | 212 }; |
220 | 213 |
221 } // namespace cc | 214 } // namespace cc |
222 | 215 |
223 #endif // CC_SCHEDULER_SCHEDULER_H_ | 216 #endif // CC_SCHEDULER_SCHEDULER_H_ |
OLD | NEW |