| 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 void ScheduledActionBeginMainFrameNotExpectedUntil( |
| 52 base::TimeTicks time) = 0; |
| 51 | 53 |
| 52 protected: | 54 protected: |
| 53 virtual ~SchedulerClient() {} | 55 virtual ~SchedulerClient() {} |
| 54 }; | 56 }; |
| 55 | 57 |
| 56 class CC_EXPORT Scheduler : public BeginFrameObserverBase { | 58 class CC_EXPORT Scheduler : public BeginFrameObserverBase { |
| 57 public: | 59 public: |
| 58 Scheduler(SchedulerClient* client, | 60 Scheduler(SchedulerClient* client, |
| 59 const SchedulerSettings& scheduler_settings, | 61 const SchedulerSettings& scheduler_settings, |
| 60 int layer_tree_host_id, | 62 int layer_tree_host_id, |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 bool inside_process_scheduled_actions_ = false; | 192 bool inside_process_scheduled_actions_ = false; |
| 191 SchedulerStateMachine::Action inside_action_ = | 193 SchedulerStateMachine::Action inside_action_ = |
| 192 SchedulerStateMachine::ACTION_NONE; | 194 SchedulerStateMachine::ACTION_NONE; |
| 193 | 195 |
| 194 bool stopped_ = false; | 196 bool stopped_ = false; |
| 195 | 197 |
| 196 private: | 198 private: |
| 197 void ScheduleBeginImplFrameDeadline(); | 199 void ScheduleBeginImplFrameDeadline(); |
| 198 void ScheduleBeginImplFrameDeadlineIfNeeded(); | 200 void ScheduleBeginImplFrameDeadlineIfNeeded(); |
| 199 void BeginImplFrameNotExpectedSoon(); | 201 void BeginImplFrameNotExpectedSoon(); |
| 202 void BeginMainFrameNotExpectedUntil(base::TimeTicks time); |
| 200 void SetupNextBeginFrameIfNeeded(); | 203 void SetupNextBeginFrameIfNeeded(); |
| 201 void StartObservingBeginFrameSource(); | 204 void StartObservingBeginFrameSource(); |
| 202 void StopObservingBeginFrameSource(); | 205 void StopObservingBeginFrameSource(); |
| 203 void DrawIfPossible(); | 206 void DrawIfPossible(); |
| 204 void DrawForced(); | 207 void DrawForced(); |
| 205 void ProcessScheduledActions(); | 208 void ProcessScheduledActions(); |
| 206 void UpdateCompositorTimingHistoryRecordingEnabled(); | 209 void UpdateCompositorTimingHistoryRecordingEnabled(); |
| 207 bool ShouldRecoverMainLatency(const BeginFrameArgs& args, | 210 bool ShouldRecoverMainLatency(const BeginFrameArgs& args, |
| 208 bool can_activate_before_deadline) const; | 211 bool can_activate_before_deadline) const; |
| 209 bool ShouldRecoverImplLatency(const BeginFrameArgs& args, | 212 bool ShouldRecoverImplLatency(const BeginFrameArgs& args, |
| (...skipping 19 matching lines...) Expand all Loading... |
| 229 } | 232 } |
| 230 | 233 |
| 231 base::WeakPtrFactory<Scheduler> weak_factory_; | 234 base::WeakPtrFactory<Scheduler> weak_factory_; |
| 232 | 235 |
| 233 DISALLOW_COPY_AND_ASSIGN(Scheduler); | 236 DISALLOW_COPY_AND_ASSIGN(Scheduler); |
| 234 }; | 237 }; |
| 235 | 238 |
| 236 } // namespace cc | 239 } // namespace cc |
| 237 | 240 |
| 238 #endif // CC_SCHEDULER_SCHEDULER_H_ | 241 #endif // CC_SCHEDULER_SCHEDULER_H_ |
| OLD | NEW |