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_STATE_MACHINE_H_ | 5 #ifndef CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ |
6 #define CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ | 6 #define CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
138 void OnBeginImplFrameIdle(); | 138 void OnBeginImplFrameIdle(); |
139 BeginImplFrameState begin_impl_frame_state() const { | 139 BeginImplFrameState begin_impl_frame_state() const { |
140 return begin_impl_frame_state_; | 140 return begin_impl_frame_state_; |
141 } | 141 } |
142 BeginImplFrameDeadlineMode CurrentBeginImplFrameDeadlineMode() const; | 142 BeginImplFrameDeadlineMode CurrentBeginImplFrameDeadlineMode() const; |
143 | 143 |
144 // If the main thread didn't manage to produce a new frame in time for the | 144 // If the main thread didn't manage to produce a new frame in time for the |
145 // impl thread to draw, it is in a high latency mode. | 145 // impl thread to draw, it is in a high latency mode. |
146 bool MainThreadIsInHighLatencyMode() const; | 146 bool MainThreadIsInHighLatencyMode() const; |
147 | 147 |
148 bool SwapThrottled() const { return pending_swaps_ >= max_pending_swaps_; } | |
sunnyps
2015/07/08 22:37:13
nit: This does not follow the naming convention fo
brianderson
2015/07/09 01:28:11
Done.
| |
149 | |
148 // Indicates whether the LayerTreeHostImpl is visible. | 150 // Indicates whether the LayerTreeHostImpl is visible. |
149 void SetVisible(bool visible); | 151 void SetVisible(bool visible); |
150 bool visible() const { return visible_; } | 152 bool visible() const { return visible_; } |
151 | 153 |
152 // Indicates that a redraw is required, either due to the impl tree changing | 154 // Indicates that a redraw is required, either due to the impl tree changing |
153 // or the screen being damaged and simply needing redisplay. | 155 // or the screen being damaged and simply needing redisplay. |
154 void SetNeedsRedraw(); | 156 void SetNeedsRedraw(); |
155 bool needs_redraw() const { return needs_redraw_; } | 157 bool needs_redraw() const { return needs_redraw_; } |
156 | 158 |
157 void SetNeedsAnimate(); | 159 void SetNeedsAnimate(); |
(...skipping 30 matching lines...) Expand all Loading... | |
188 return impl_latency_takes_priority_; | 190 return impl_latency_takes_priority_; |
189 } | 191 } |
190 | 192 |
191 // Indicates whether ACTION_DRAW_AND_SWAP_IF_POSSIBLE drew to the screen. | 193 // Indicates whether ACTION_DRAW_AND_SWAP_IF_POSSIBLE drew to the screen. |
192 void DidDrawIfPossibleCompleted(DrawResult result); | 194 void DidDrawIfPossibleCompleted(DrawResult result); |
193 | 195 |
194 // Indicates that a new commit flow needs to be performed, either to pull | 196 // Indicates that a new commit flow needs to be performed, either to pull |
195 // updates from the main thread to the impl, or to push deltas from the impl | 197 // updates from the main thread to the impl, or to push deltas from the impl |
196 // thread to main. | 198 // thread to main. |
197 void SetNeedsCommit(); | 199 void SetNeedsCommit(); |
200 bool needs_commit() const { return needs_commit_; } | |
198 | 201 |
199 // Call this only in response to receiving an ACTION_SEND_BEGIN_MAIN_FRAME | 202 // Call this only in response to receiving an ACTION_SEND_BEGIN_MAIN_FRAME |
200 // from NextAction. | 203 // from NextAction. |
201 // Indicates that all painting is complete. | 204 // Indicates that all painting is complete. |
202 void NotifyReadyToCommit(); | 205 void NotifyReadyToCommit(); |
203 | 206 |
204 // Call this only in response to receiving an ACTION_SEND_BEGIN_MAIN_FRAME | 207 // Call this only in response to receiving an ACTION_SEND_BEGIN_MAIN_FRAME |
205 // from NextAction if the client rejects the BeginMainFrame message. | 208 // from NextAction if the client rejects the BeginMainFrame message. |
206 void BeginMainFrameAborted(CommitEarlyOutReason reason); | 209 void BeginMainFrameAborted(CommitEarlyOutReason reason); |
207 | 210 |
208 // Set that we can create the first OutputSurface and start the scheduler. | 211 // Set that we can create the first OutputSurface and start the scheduler. |
209 void SetCanStart() { can_start_ = true; } | 212 void SetCanStart() { can_start_ = true; } |
210 // Allow access of the can_start_ state in tests. | 213 // Allow access of the can_start_ state in tests. |
211 bool CanStartForTesting() const { return can_start_; } | 214 bool CanStartForTesting() const { return can_start_; } |
212 | 215 |
216 // Indicates production should be skipped to recover latency. | |
213 void SetSkipNextBeginMainFrameToReduceLatency(); | 217 void SetSkipNextBeginMainFrameToReduceLatency(); |
214 | 218 |
215 // Indicates whether drawing would, at this time, make sense. | 219 // Indicates whether drawing would, at this time, make sense. |
216 // CanDraw can be used to suppress flashes or checkerboarding | 220 // CanDraw can be used to suppress flashes or checkerboarding |
217 // when such behavior would be undesirable. | 221 // when such behavior would be undesirable. |
218 void SetCanDraw(bool can); | 222 void SetCanDraw(bool can); |
219 | 223 |
220 // Indicates that scheduled BeginMainFrame is started. | 224 // Indicates that scheduled BeginMainFrame is started. |
221 void NotifyBeginMainFrameStarted(); | 225 void NotifyBeginMainFrameStarted(); |
222 | 226 |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
325 bool needs_commit_; | 329 bool needs_commit_; |
326 bool visible_; | 330 bool visible_; |
327 bool can_start_; | 331 bool can_start_; |
328 bool can_draw_; | 332 bool can_draw_; |
329 bool has_pending_tree_; | 333 bool has_pending_tree_; |
330 bool pending_tree_is_ready_for_activation_; | 334 bool pending_tree_is_ready_for_activation_; |
331 bool active_tree_needs_first_draw_; | 335 bool active_tree_needs_first_draw_; |
332 bool did_create_and_initialize_first_output_surface_; | 336 bool did_create_and_initialize_first_output_surface_; |
333 bool impl_latency_takes_priority_; | 337 bool impl_latency_takes_priority_; |
334 bool skip_next_begin_main_frame_to_reduce_latency_; | 338 bool skip_next_begin_main_frame_to_reduce_latency_; |
335 bool skip_begin_main_frame_to_reduce_latency_; | |
336 bool continuous_painting_; | 339 bool continuous_painting_; |
337 bool children_need_begin_frames_; | 340 bool children_need_begin_frames_; |
338 bool defer_commits_; | 341 bool defer_commits_; |
339 bool video_needs_begin_frames_; | 342 bool video_needs_begin_frames_; |
340 bool last_commit_had_no_updates_; | 343 bool last_commit_had_no_updates_; |
341 bool wait_for_active_tree_ready_to_draw_; | 344 bool wait_for_active_tree_ready_to_draw_; |
342 bool did_request_swap_in_last_frame_; | 345 bool did_request_swap_in_last_frame_; |
343 bool did_perform_swap_in_last_draw_; | 346 bool did_perform_swap_in_last_draw_; |
344 | 347 |
345 private: | 348 private: |
346 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); | 349 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); |
347 }; | 350 }; |
348 | 351 |
349 } // namespace cc | 352 } // namespace cc |
350 | 353 |
351 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ | 354 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ |
OLD | NEW |