| 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 base::TimeTicks ready_to_activate_time_; |
| 190 int ready_to_activate_source_frame_number_; |
| 191 |
| 188 private: | 192 private: |
| 189 void ScheduleBeginImplFrameDeadline(); | 193 void ScheduleBeginImplFrameDeadline(); |
| 190 void ScheduleBeginImplFrameDeadlineIfNeeded(); | 194 void ScheduleBeginImplFrameDeadlineIfNeeded(); |
| 191 void BeginImplFrameNotExpectedSoon(); | 195 void BeginImplFrameNotExpectedSoon(); |
| 192 void SetupNextBeginFrameIfNeeded(); | 196 void SetupNextBeginFrameIfNeeded(); |
| 193 void DrawIfPossible(); | 197 void DrawIfPossible(); |
| 194 void DrawForced(); | 198 void DrawForced(); |
| 195 void ProcessScheduledActions(); | 199 void ProcessScheduledActions(); |
| 196 void UpdateCompositorTimingHistoryRecordingEnabled(); | 200 void UpdateCompositorTimingHistoryRecordingEnabled(); |
| 197 bool ShouldRecoverMainLatency(const BeginFrameArgs& args, | 201 bool ShouldRecoverMainLatency(const BeginFrameArgs& args, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 218 } | 222 } |
| 219 | 223 |
| 220 base::WeakPtrFactory<Scheduler> weak_factory_; | 224 base::WeakPtrFactory<Scheduler> weak_factory_; |
| 221 | 225 |
| 222 DISALLOW_COPY_AND_ASSIGN(Scheduler); | 226 DISALLOW_COPY_AND_ASSIGN(Scheduler); |
| 223 }; | 227 }; |
| 224 | 228 |
| 225 } // namespace cc | 229 } // namespace cc |
| 226 | 230 |
| 227 #endif // CC_SCHEDULER_SCHEDULER_H_ | 231 #endif // CC_SCHEDULER_SCHEDULER_H_ |
| OLD | NEW |