Chromium Code Reviews| 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 20 matching lines...) Expand all Loading... | |
| 31 | 31 |
| 32 namespace cc { | 32 namespace cc { |
| 33 | 33 |
| 34 class CompositorTimingHistory; | 34 class CompositorTimingHistory; |
| 35 | 35 |
| 36 class SchedulerClient { | 36 class SchedulerClient { |
| 37 public: | 37 public: |
| 38 virtual void WillBeginImplFrame(const BeginFrameArgs& args) = 0; | 38 virtual void WillBeginImplFrame(const BeginFrameArgs& args) = 0; |
| 39 virtual void ScheduledActionSendBeginMainFrame( | 39 virtual void ScheduledActionSendBeginMainFrame( |
| 40 const BeginFrameArgs& args) = 0; | 40 const BeginFrameArgs& args) = 0; |
| 41 virtual DrawResult ScheduledActionDrawAndSwapIfPossible() = 0; | 41 virtual DrawResult ScheduledActionSubmitCompositorFrameIfPossible() = 0; |
| 42 virtual DrawResult ScheduledActionDrawAndSwapForced() = 0; | 42 virtual DrawResult ScheduledActionSubmitCompositorFrameForced() = 0; |
|
sunnyps
2016/10/11 18:32:48
I'd prefer these to be called ScheduledActionDraw
danakj
2016/10/13 23:50:22
Done.
| |
| 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 DidFinishImplFrame() = 0; | 48 virtual void DidFinishImplFrame() = 0; |
| 49 virtual void SendBeginMainFrameNotExpectedSoon() = 0; | 49 virtual void SendBeginMainFrameNotExpectedSoon() = 0; |
| 50 | 50 |
| 51 protected: | 51 protected: |
| 52 virtual ~SchedulerClient() {} | 52 virtual ~SchedulerClient() {} |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 82 | 82 |
| 83 void SetNeedsBeginMainFrame(); | 83 void SetNeedsBeginMainFrame(); |
| 84 // Requests a single impl frame (after the current frame if there is one | 84 // Requests a single impl frame (after the current frame if there is one |
| 85 // active). | 85 // active). |
| 86 void SetNeedsOneBeginImplFrame(); | 86 void SetNeedsOneBeginImplFrame(); |
| 87 | 87 |
| 88 void SetNeedsRedraw(); | 88 void SetNeedsRedraw(); |
| 89 | 89 |
| 90 void SetNeedsPrepareTiles(); | 90 void SetNeedsPrepareTiles(); |
| 91 | 91 |
| 92 void DidSwapBuffers(); | 92 void DidSubmitCompositorFrame(); |
| 93 void DidSwapBuffersComplete(); | 93 void DidReceiveCompositorFrameAck(); |
| 94 | 94 |
| 95 void SetTreePrioritiesAndScrollState(TreePriority tree_priority, | 95 void SetTreePrioritiesAndScrollState(TreePriority tree_priority, |
| 96 ScrollHandlerState scroll_handler_state); | 96 ScrollHandlerState scroll_handler_state); |
| 97 | 97 |
| 98 void NotifyReadyToCommit(); | 98 void NotifyReadyToCommit(); |
| 99 void BeginMainFrameAborted(CommitEarlyOutReason reason); | 99 void BeginMainFrameAborted(CommitEarlyOutReason reason); |
| 100 void DidCommit(); | 100 void DidCommit(); |
| 101 | 101 |
| 102 void WillPrepareTiles(); | 102 void WillPrepareTiles(); |
| 103 void DidPrepareTiles(); | 103 void DidPrepareTiles(); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 167 bool inside_process_scheduled_actions_; | 167 bool inside_process_scheduled_actions_; |
| 168 SchedulerStateMachine::Action inside_action_; | 168 SchedulerStateMachine::Action inside_action_; |
| 169 | 169 |
| 170 bool stopped_; | 170 bool stopped_; |
| 171 | 171 |
| 172 private: | 172 private: |
| 173 void ScheduleBeginImplFrameDeadline(); | 173 void ScheduleBeginImplFrameDeadline(); |
| 174 void ScheduleBeginImplFrameDeadlineIfNeeded(); | 174 void ScheduleBeginImplFrameDeadlineIfNeeded(); |
| 175 void BeginImplFrameNotExpectedSoon(); | 175 void BeginImplFrameNotExpectedSoon(); |
| 176 void SetupNextBeginFrameIfNeeded(); | 176 void SetupNextBeginFrameIfNeeded(); |
| 177 void DrawAndSwapIfPossible(); | 177 void SubmitCompositorFrameIfPossible(); |
| 178 void DrawAndSwapForced(); | 178 void SubmitCompositorFrameForced(); |
| 179 void ProcessScheduledActions(); | 179 void ProcessScheduledActions(); |
| 180 void UpdateCompositorTimingHistoryRecordingEnabled(); | 180 void UpdateCompositorTimingHistoryRecordingEnabled(); |
| 181 bool ShouldRecoverMainLatency(const BeginFrameArgs& args, | 181 bool ShouldRecoverMainLatency(const BeginFrameArgs& args, |
| 182 bool can_activate_before_deadline) const; | 182 bool can_activate_before_deadline) const; |
| 183 bool ShouldRecoverImplLatency(const BeginFrameArgs& args, | 183 bool ShouldRecoverImplLatency(const BeginFrameArgs& args, |
| 184 bool can_activate_before_deadline) const; | 184 bool can_activate_before_deadline) const; |
| 185 bool CanBeginMainFrameAndActivateBeforeDeadline( | 185 bool CanBeginMainFrameAndActivateBeforeDeadline( |
| 186 const BeginFrameArgs& args, | 186 const BeginFrameArgs& args, |
| 187 base::TimeDelta bmf_to_activate_estimate) const; | 187 base::TimeDelta bmf_to_activate_estimate) const; |
| 188 void AdvanceCommitStateIfPossible(); | 188 void AdvanceCommitStateIfPossible(); |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 199 } | 199 } |
| 200 | 200 |
| 201 base::WeakPtrFactory<Scheduler> weak_factory_; | 201 base::WeakPtrFactory<Scheduler> weak_factory_; |
| 202 | 202 |
| 203 DISALLOW_COPY_AND_ASSIGN(Scheduler); | 203 DISALLOW_COPY_AND_ASSIGN(Scheduler); |
| 204 }; | 204 }; |
| 205 | 205 |
| 206 } // namespace cc | 206 } // namespace cc |
| 207 | 207 |
| 208 #endif // CC_SCHEDULER_SCHEDULER_H_ | 208 #endif // CC_SCHEDULER_SCHEDULER_H_ |
| OLD | NEW |