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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 void OnBeginFrameSourcePausedChanged(bool paused) override; | 70 void OnBeginFrameSourcePausedChanged(bool paused) override; |
71 bool OnBeginFrameDerivedImpl(const BeginFrameArgs& args) override; | 71 bool OnBeginFrameDerivedImpl(const BeginFrameArgs& args) override; |
72 | 72 |
73 void OnDrawForCompositorFrameSink(bool resourceless_software_draw); | 73 void OnDrawForCompositorFrameSink(bool resourceless_software_draw); |
74 | 74 |
75 const SchedulerSettings& settings() const { return settings_; } | 75 const SchedulerSettings& settings() const { return settings_; } |
76 | 76 |
77 void SetVisible(bool visible); | 77 void SetVisible(bool visible); |
78 bool visible() { return state_machine_.visible(); } | 78 bool visible() { return state_machine_.visible(); } |
79 void SetCanDraw(bool can_draw); | 79 void SetCanDraw(bool can_draw); |
80 void NotifyReadyToActivate(int source_frame_number); | 80 void NotifyReadyToActivate(); |
81 void NotifyReadyToDraw(); | 81 void NotifyReadyToDraw(); |
82 void SetBeginFrameSource(BeginFrameSource* source); | 82 void SetBeginFrameSource(BeginFrameSource* source); |
83 | 83 |
84 void SetNeedsBeginMainFrame(); | 84 void SetNeedsBeginMainFrame(); |
85 // Requests a single impl frame (after the current frame if there is one | 85 // Requests a single impl frame (after the current frame if there is one |
86 // active). | 86 // active). |
87 void SetNeedsOneBeginImplFrame(); | 87 void SetNeedsOneBeginImplFrame(); |
88 | 88 |
89 void SetNeedsRedraw(); | 89 void SetNeedsRedraw(); |
90 | 90 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 base::CancelableClosure begin_impl_frame_deadline_task_; | 184 base::CancelableClosure begin_impl_frame_deadline_task_; |
185 base::CancelableClosure missed_begin_frame_task_; | 185 base::CancelableClosure missed_begin_frame_task_; |
186 | 186 |
187 SchedulerStateMachine state_machine_; | 187 SchedulerStateMachine state_machine_; |
188 bool inside_process_scheduled_actions_ = false; | 188 bool inside_process_scheduled_actions_ = false; |
189 SchedulerStateMachine::Action inside_action_ = | 189 SchedulerStateMachine::Action inside_action_ = |
190 SchedulerStateMachine::ACTION_NONE; | 190 SchedulerStateMachine::ACTION_NONE; |
191 | 191 |
192 bool stopped_ = false; | 192 bool stopped_ = false; |
193 | 193 |
194 // This is to report Activation (ReadyToActivate signal) time back to Main. | |
195 // A vector of pairs of source_frame_number and timestamp is captured, and | |
196 // sent back in BeginFrameArgs with the next ProxyMain::BeginMainFrame. A | |
197 // vector is needed as there can be multiple ReadyToActivate signals before | |
198 // the next BeginMainFrame. | |
199 std::vector<std::pair<uint32_t, base::TimeTicks>> ready_to_activate_time_; | |
200 | |
201 private: | 194 private: |
202 void ScheduleBeginImplFrameDeadline(); | 195 void ScheduleBeginImplFrameDeadline(); |
203 void ScheduleBeginImplFrameDeadlineIfNeeded(); | 196 void ScheduleBeginImplFrameDeadlineIfNeeded(); |
204 void BeginImplFrameNotExpectedSoon(); | 197 void BeginImplFrameNotExpectedSoon(); |
205 void SetupNextBeginFrameIfNeeded(); | 198 void SetupNextBeginFrameIfNeeded(); |
206 void DrawIfPossible(); | 199 void DrawIfPossible(); |
207 void DrawForced(); | 200 void DrawForced(); |
208 void ProcessScheduledActions(); | 201 void ProcessScheduledActions(); |
209 void UpdateCompositorTimingHistoryRecordingEnabled(); | 202 void UpdateCompositorTimingHistoryRecordingEnabled(); |
210 bool ShouldRecoverMainLatency(const BeginFrameArgs& args, | 203 bool ShouldRecoverMainLatency(const BeginFrameArgs& args, |
(...skipping 20 matching lines...) Expand all Loading... |
231 } | 224 } |
232 | 225 |
233 base::WeakPtrFactory<Scheduler> weak_factory_; | 226 base::WeakPtrFactory<Scheduler> weak_factory_; |
234 | 227 |
235 DISALLOW_COPY_AND_ASSIGN(Scheduler); | 228 DISALLOW_COPY_AND_ASSIGN(Scheduler); |
236 }; | 229 }; |
237 | 230 |
238 } // namespace cc | 231 } // namespace cc |
239 | 232 |
240 #endif // CC_SCHEDULER_SCHEDULER_H_ | 233 #endif // CC_SCHEDULER_SCHEDULER_H_ |
OLD | NEW |