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 ScheduledActionDrawIfPossible() = 0; |
42 virtual DrawResult ScheduledActionDrawAndSwapForced() = 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 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 // Drawing should result in submitting a CompositorFrame to the |
93 void DidSwapBuffersComplete(); | 93 // CompositorFrameSink and then calling this. |
| 94 void DidSubmitCompositorFrame(); |
| 95 // The CompositorFrameSink acks when it is ready for a new frame which |
| 96 // should result in this getting called to unblock the next draw. |
| 97 void DidReceiveCompositorFrameAck(); |
94 | 98 |
95 void SetTreePrioritiesAndScrollState(TreePriority tree_priority, | 99 void SetTreePrioritiesAndScrollState(TreePriority tree_priority, |
96 ScrollHandlerState scroll_handler_state); | 100 ScrollHandlerState scroll_handler_state); |
97 | 101 |
98 void NotifyReadyToCommit(); | 102 void NotifyReadyToCommit(); |
99 void BeginMainFrameAborted(CommitEarlyOutReason reason); | 103 void BeginMainFrameAborted(CommitEarlyOutReason reason); |
100 void DidCommit(); | 104 void DidCommit(); |
101 | 105 |
102 void WillPrepareTiles(); | 106 void WillPrepareTiles(); |
103 void DidPrepareTiles(); | 107 void DidPrepareTiles(); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 bool inside_process_scheduled_actions_; | 171 bool inside_process_scheduled_actions_; |
168 SchedulerStateMachine::Action inside_action_; | 172 SchedulerStateMachine::Action inside_action_; |
169 | 173 |
170 bool stopped_; | 174 bool stopped_; |
171 | 175 |
172 private: | 176 private: |
173 void ScheduleBeginImplFrameDeadline(); | 177 void ScheduleBeginImplFrameDeadline(); |
174 void ScheduleBeginImplFrameDeadlineIfNeeded(); | 178 void ScheduleBeginImplFrameDeadlineIfNeeded(); |
175 void BeginImplFrameNotExpectedSoon(); | 179 void BeginImplFrameNotExpectedSoon(); |
176 void SetupNextBeginFrameIfNeeded(); | 180 void SetupNextBeginFrameIfNeeded(); |
177 void DrawAndSwapIfPossible(); | 181 void DrawIfPossible(); |
178 void DrawAndSwapForced(); | 182 void DrawForced(); |
179 void ProcessScheduledActions(); | 183 void ProcessScheduledActions(); |
180 void UpdateCompositorTimingHistoryRecordingEnabled(); | 184 void UpdateCompositorTimingHistoryRecordingEnabled(); |
181 bool ShouldRecoverMainLatency(const BeginFrameArgs& args, | 185 bool ShouldRecoverMainLatency(const BeginFrameArgs& args, |
182 bool can_activate_before_deadline) const; | 186 bool can_activate_before_deadline) const; |
183 bool ShouldRecoverImplLatency(const BeginFrameArgs& args, | 187 bool ShouldRecoverImplLatency(const BeginFrameArgs& args, |
184 bool can_activate_before_deadline) const; | 188 bool can_activate_before_deadline) const; |
185 bool CanBeginMainFrameAndActivateBeforeDeadline( | 189 bool CanBeginMainFrameAndActivateBeforeDeadline( |
186 const BeginFrameArgs& args, | 190 const BeginFrameArgs& args, |
187 base::TimeDelta bmf_to_activate_estimate) const; | 191 base::TimeDelta bmf_to_activate_estimate) const; |
188 void AdvanceCommitStateIfPossible(); | 192 void AdvanceCommitStateIfPossible(); |
(...skipping 10 matching lines...) Expand all Loading... |
199 } | 203 } |
200 | 204 |
201 base::WeakPtrFactory<Scheduler> weak_factory_; | 205 base::WeakPtrFactory<Scheduler> weak_factory_; |
202 | 206 |
203 DISALLOW_COPY_AND_ASSIGN(Scheduler); | 207 DISALLOW_COPY_AND_ASSIGN(Scheduler); |
204 }; | 208 }; |
205 | 209 |
206 } // namespace cc | 210 } // namespace cc |
207 | 211 |
208 #endif // CC_SCHEDULER_SCHEDULER_H_ | 212 #endif // CC_SCHEDULER_SCHEDULER_H_ |
OLD | NEW |