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 30 matching lines...) Expand all Loading... | |
41 virtual DrawResult ScheduledActionDrawIfPossible() = 0; | 41 virtual DrawResult ScheduledActionDrawIfPossible() = 0; |
42 virtual DrawResult ScheduledActionDrawForced() = 0; | 42 virtual DrawResult ScheduledActionDrawForced() = 0; |
43 virtual void ScheduledActionCommit() = 0; | 43 virtual void ScheduledActionCommit() = 0; |
44 virtual void ScheduledActionActivateSyncTree() = 0; | 44 virtual void ScheduledActionActivateSyncTree() = 0; |
45 virtual void ScheduledActionBeginCompositorFrameSinkCreation() = 0; | 45 virtual void ScheduledActionBeginCompositorFrameSinkCreation() = 0; |
46 virtual void ScheduledActionPrepareTiles() = 0; | 46 virtual void ScheduledActionPrepareTiles() = 0; |
47 virtual void ScheduledActionInvalidateCompositorFrameSink() = 0; | 47 virtual void ScheduledActionInvalidateCompositorFrameSink() = 0; |
48 virtual void ScheduledActionPerformImplSideInvalidation() = 0; | 48 virtual void ScheduledActionPerformImplSideInvalidation() = 0; |
49 virtual void DidFinishImplFrame() = 0; | 49 virtual void DidFinishImplFrame() = 0; |
50 virtual void SendBeginMainFrameNotExpectedSoon() = 0; | 50 virtual void SendBeginMainFrameNotExpectedSoon() = 0; |
51 virtual int SyncTreeSourceFrameNumber() = 0; | |
51 | 52 |
52 protected: | 53 protected: |
53 virtual ~SchedulerClient() {} | 54 virtual ~SchedulerClient() {} |
54 }; | 55 }; |
55 | 56 |
56 class CC_EXPORT Scheduler : public BeginFrameObserverBase { | 57 class CC_EXPORT Scheduler : public BeginFrameObserverBase { |
57 public: | 58 public: |
58 Scheduler(SchedulerClient* client, | 59 Scheduler(SchedulerClient* client, |
59 const SchedulerSettings& scheduler_settings, | 60 const SchedulerSettings& scheduler_settings, |
60 int layer_tree_host_id, | 61 int layer_tree_host_id, |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
178 base::Closure begin_impl_frame_deadline_closure_; | 179 base::Closure begin_impl_frame_deadline_closure_; |
179 base::CancelableClosure begin_impl_frame_deadline_task_; | 180 base::CancelableClosure begin_impl_frame_deadline_task_; |
180 base::CancelableClosure missed_begin_frame_task_; | 181 base::CancelableClosure missed_begin_frame_task_; |
181 | 182 |
182 SchedulerStateMachine state_machine_; | 183 SchedulerStateMachine state_machine_; |
183 bool inside_process_scheduled_actions_; | 184 bool inside_process_scheduled_actions_; |
184 SchedulerStateMachine::Action inside_action_; | 185 SchedulerStateMachine::Action inside_action_; |
185 | 186 |
186 bool stopped_; | 187 bool stopped_; |
187 | 188 |
189 std::vector<std::pair<uint32_t, base::TimeTicks>> ready_to_activate_time_; | |
vmpstr
2017/04/05 19:11:33
nit: can you put a comment about what this pair re
panicker
2017/04/08 00:29:06
Done.
| |
190 | |
188 private: | 191 private: |
189 void ScheduleBeginImplFrameDeadline(); | 192 void ScheduleBeginImplFrameDeadline(); |
190 void ScheduleBeginImplFrameDeadlineIfNeeded(); | 193 void ScheduleBeginImplFrameDeadlineIfNeeded(); |
191 void BeginImplFrameNotExpectedSoon(); | 194 void BeginImplFrameNotExpectedSoon(); |
192 void SetupNextBeginFrameIfNeeded(); | 195 void SetupNextBeginFrameIfNeeded(); |
193 void DrawIfPossible(); | 196 void DrawIfPossible(); |
194 void DrawForced(); | 197 void DrawForced(); |
195 void ProcessScheduledActions(); | 198 void ProcessScheduledActions(); |
196 void UpdateCompositorTimingHistoryRecordingEnabled(); | 199 void UpdateCompositorTimingHistoryRecordingEnabled(); |
197 bool ShouldRecoverMainLatency(const BeginFrameArgs& args, | 200 bool ShouldRecoverMainLatency(const BeginFrameArgs& args, |
(...skipping 20 matching lines...) Expand all Loading... | |
218 } | 221 } |
219 | 222 |
220 base::WeakPtrFactory<Scheduler> weak_factory_; | 223 base::WeakPtrFactory<Scheduler> weak_factory_; |
221 | 224 |
222 DISALLOW_COPY_AND_ASSIGN(Scheduler); | 225 DISALLOW_COPY_AND_ASSIGN(Scheduler); |
223 }; | 226 }; |
224 | 227 |
225 } // namespace cc | 228 } // namespace cc |
226 | 229 |
227 #endif // CC_SCHEDULER_SCHEDULER_H_ | 230 #endif // CC_SCHEDULER_SCHEDULER_H_ |
OLD | NEW |