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 <string> | 9 #include <string> |
10 | 10 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
92 void SetNeedsRedraw(); | 92 void SetNeedsRedraw(); |
93 | 93 |
94 void SetNeedsAnimate(); | 94 void SetNeedsAnimate(); |
95 | 95 |
96 void SetNeedsPrepareTiles(); | 96 void SetNeedsPrepareTiles(); |
97 | 97 |
98 void SetMaxSwapsPending(int max); | 98 void SetMaxSwapsPending(int max); |
99 void DidSwapBuffers(); | 99 void DidSwapBuffers(); |
100 void DidSwapBuffersComplete(); | 100 void DidSwapBuffersComplete(); |
101 | 101 |
102 void SetImplLatencyTakesPriority(bool impl_latency_takes_priority); | 102 void SetSmoothnessMode(bool smoothness_takes_priority, |
Sami
2015/11/06 11:54:42
nit: some of the (test) call sites might read a bi
brianderson
2015/11/12 20:22:04
That sounds good. I might call the second one SetS
| |
103 bool scroll_affects_scroll_handler); | |
103 | 104 |
104 void NotifyReadyToCommit(); | 105 void NotifyReadyToCommit(); |
105 void BeginMainFrameAborted(CommitEarlyOutReason reason); | 106 void BeginMainFrameAborted(CommitEarlyOutReason reason); |
106 void DidCommit(); | 107 void DidCommit(); |
107 | 108 |
108 void WillPrepareTiles(); | 109 void WillPrepareTiles(); |
109 void DidPrepareTiles(); | 110 void DidPrepareTiles(); |
110 void DidLoseOutputSurface(); | 111 void DidLoseOutputSurface(); |
111 void DidCreateAndInitializeOutputSurface(); | 112 void DidCreateAndInitializeOutputSurface(); |
112 | 113 |
113 // Tests do not want to shut down until all possible BeginMainFrames have | 114 // Tests do not want to shut down until all possible BeginMainFrames have |
114 // occured to prevent flakiness. | 115 // occured to prevent flakiness. |
115 bool MainFrameForTestingWillHappen() const { | 116 bool MainFrameForTestingWillHappen() const { |
116 return state_machine_.CommitPending() || | 117 return state_machine_.CommitPending() || |
117 state_machine_.CouldSendBeginMainFrame(); | 118 state_machine_.CouldSendBeginMainFrame(); |
118 } | 119 } |
119 | 120 |
120 bool CommitPending() const { return state_machine_.CommitPending(); } | 121 bool CommitPending() const { return state_machine_.CommitPending(); } |
121 bool RedrawPending() const { return state_machine_.RedrawPending(); } | 122 bool RedrawPending() const { return state_machine_.RedrawPending(); } |
122 bool PrepareTilesPending() const { | 123 bool PrepareTilesPending() const { |
123 return state_machine_.PrepareTilesPending(); | 124 return state_machine_.PrepareTilesPending(); |
124 } | 125 } |
125 bool BeginImplFrameDeadlinePending() const { | 126 bool BeginImplFrameDeadlinePending() const { |
126 return !begin_impl_frame_deadline_task_.IsCancelled(); | 127 return !begin_impl_frame_deadline_task_.IsCancelled(); |
127 } | 128 } |
128 bool ImplLatencyTakesPriority() const { | 129 bool ImplLatencyTakesPriority() const { |
129 return state_machine_.impl_latency_takes_priority(); | 130 return state_machine_.ImplLatencyTakesPriority(); |
130 } | 131 } |
131 | 132 |
132 // Pass in a main_thread_start_time of base::TimeTicks() if it is not | 133 // Pass in a main_thread_start_time of base::TimeTicks() if it is not |
133 // known or not trustworthy (e.g. blink is running on a remote channel) | 134 // known or not trustworthy (e.g. blink is running on a remote channel) |
134 // to signal that the start time isn't known and should not be used for | 135 // to signal that the start time isn't known and should not be used for |
135 // scheduling or statistics purposes. | 136 // scheduling or statistics purposes. |
136 void NotifyBeginMainFrameStarted(base::TimeTicks main_thread_start_time); | 137 void NotifyBeginMainFrameStarted(base::TimeTicks main_thread_start_time); |
137 | 138 |
138 base::TimeTicks LastBeginImplFrameTime(); | 139 base::TimeTicks LastBeginImplFrameTime(); |
139 | 140 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
194 | 195 |
195 private: | 196 private: |
196 void ScheduleBeginImplFrameDeadline(); | 197 void ScheduleBeginImplFrameDeadline(); |
197 void ScheduleBeginImplFrameDeadlineIfNeeded(); | 198 void ScheduleBeginImplFrameDeadlineIfNeeded(); |
198 void SetupNextBeginFrameIfNeeded(); | 199 void SetupNextBeginFrameIfNeeded(); |
199 void PostBeginRetroFrameIfNeeded(); | 200 void PostBeginRetroFrameIfNeeded(); |
200 void DrawAndSwapIfPossible(); | 201 void DrawAndSwapIfPossible(); |
201 void DrawAndSwapForced(); | 202 void DrawAndSwapForced(); |
202 void ProcessScheduledActions(); | 203 void ProcessScheduledActions(); |
203 void UpdateCompositorTimingHistoryRecordingEnabled(); | 204 void UpdateCompositorTimingHistoryRecordingEnabled(); |
204 bool ShouldRecoverMainLatency(const BeginFrameArgs& args) const; | 205 bool ShouldRecoverMainLatency(const BeginFrameArgs& args, |
205 bool ShouldRecoverImplLatency(const BeginFrameArgs& args) const; | 206 bool can_activate_before_deadline) const; |
206 bool CanCommitAndActivateBeforeDeadline(const BeginFrameArgs& args) const; | 207 bool ShouldRecoverImplLatency(const BeginFrameArgs& args, |
208 bool can_activate_before_deadline) const; | |
209 bool CanCommitAndActivateBeforeDeadline( | |
210 const BeginFrameArgs& args, | |
211 base::TimeDelta bmf_to_activate_estimate) const; | |
207 void AdvanceCommitStateIfPossible(); | 212 void AdvanceCommitStateIfPossible(); |
208 bool IsBeginMainFrameSentOrStarted() const; | 213 bool IsBeginMainFrameSentOrStarted() const; |
209 void BeginRetroFrame(); | 214 void BeginRetroFrame(); |
210 void BeginImplFrameWithDeadline(const BeginFrameArgs& args); | 215 void BeginImplFrameWithDeadline(const BeginFrameArgs& args); |
211 void BeginImplFrameSynchronous(const BeginFrameArgs& args); | 216 void BeginImplFrameSynchronous(const BeginFrameArgs& args); |
212 void BeginImplFrame(const BeginFrameArgs& args); | 217 void BeginImplFrame(const BeginFrameArgs& args); |
213 void FinishImplFrame(); | 218 void FinishImplFrame(); |
214 void OnBeginImplFrameDeadline(); | 219 void OnBeginImplFrameDeadline(); |
215 void PollToAdvanceCommitState(); | 220 void PollToAdvanceCommitState(); |
216 | 221 |
(...skipping 14 matching lines...) Expand all Loading... | |
231 } | 236 } |
232 | 237 |
233 base::WeakPtrFactory<Scheduler> weak_factory_; | 238 base::WeakPtrFactory<Scheduler> weak_factory_; |
234 | 239 |
235 DISALLOW_COPY_AND_ASSIGN(Scheduler); | 240 DISALLOW_COPY_AND_ASSIGN(Scheduler); |
236 }; | 241 }; |
237 | 242 |
238 } // namespace cc | 243 } // namespace cc |
239 | 244 |
240 #endif // CC_SCHEDULER_SCHEDULER_H_ | 245 #endif // CC_SCHEDULER_SCHEDULER_H_ |
OLD | NEW |