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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 // with a low resolution or checkerboarded tile. | 186 // with a low resolution or checkerboarded tile. |
187 void SetSwapUsedIncompleteTile(bool used_incomplete_tile); | 187 void SetSwapUsedIncompleteTile(bool used_incomplete_tile); |
188 | 188 |
189 // Notification from the OutputSurface that a swap has been consumed. | 189 // Notification from the OutputSurface that a swap has been consumed. |
190 void DidSwapBuffersComplete(); | 190 void DidSwapBuffersComplete(); |
191 | 191 |
192 int pending_swaps() const { return pending_swaps_; } | 192 int pending_swaps() const { return pending_swaps_; } |
193 | 193 |
194 // Indicates whether to prioritize impl thread latency (i.e., animation | 194 // Indicates whether to prioritize impl thread latency (i.e., animation |
195 // smoothness) over new content activation. | 195 // smoothness) over new content activation. |
196 void SetImplLatencyTakesPriority(bool impl_latency_takes_priority); | 196 void SetSmoothnessMode(bool smoothness_takes_priority, |
197 bool impl_latency_takes_priority() const { | 197 bool scroll_affects_scroll_handler); |
198 return impl_latency_takes_priority_; | 198 |
199 } | 199 // Indicates if the main thread will likely respond within 1 vsync. |
| 200 void SetMainThreadIsFast(bool is_fast); |
| 201 |
| 202 // A function of SetSmoothnessMode and SetMainThreadIsFast. |
| 203 bool ImplLatencyTakesPriority() const; |
200 | 204 |
201 // Indicates whether ACTION_DRAW_AND_SWAP_IF_POSSIBLE drew to the screen. | 205 // Indicates whether ACTION_DRAW_AND_SWAP_IF_POSSIBLE drew to the screen. |
202 void DidDrawIfPossibleCompleted(DrawResult result); | 206 void DidDrawIfPossibleCompleted(DrawResult result); |
203 | 207 |
204 // Indicates that a new begin main frame flow needs to be performed, either | 208 // Indicates that a new begin main frame flow needs to be performed, either |
205 // to pull updates from the main thread to the impl, or to push deltas from | 209 // to pull updates from the main thread to the impl, or to push deltas from |
206 // the impl thread to main. | 210 // the impl thread to main. |
207 void SetNeedsBeginMainFrame(); | 211 void SetNeedsBeginMainFrame(); |
208 bool needs_begin_main_frame() const { return needs_begin_main_frame_; } | 212 bool needs_begin_main_frame() const { return needs_begin_main_frame_; } |
209 | 213 |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 bool needs_animate_; | 325 bool needs_animate_; |
322 bool needs_prepare_tiles_; | 326 bool needs_prepare_tiles_; |
323 bool needs_begin_main_frame_; | 327 bool needs_begin_main_frame_; |
324 bool visible_; | 328 bool visible_; |
325 bool resourceless_draw_; | 329 bool resourceless_draw_; |
326 bool can_draw_; | 330 bool can_draw_; |
327 bool has_pending_tree_; | 331 bool has_pending_tree_; |
328 bool pending_tree_is_ready_for_activation_; | 332 bool pending_tree_is_ready_for_activation_; |
329 bool active_tree_needs_first_draw_; | 333 bool active_tree_needs_first_draw_; |
330 bool did_create_and_initialize_first_output_surface_; | 334 bool did_create_and_initialize_first_output_surface_; |
331 bool impl_latency_takes_priority_; | 335 bool smoothness_takes_priority_; |
| 336 bool scroll_affects_scroll_handler_; |
| 337 bool main_thread_is_fast_; |
332 bool main_thread_missed_last_deadline_; | 338 bool main_thread_missed_last_deadline_; |
333 bool skip_next_begin_main_frame_to_reduce_latency_; | 339 bool skip_next_begin_main_frame_to_reduce_latency_; |
334 bool children_need_begin_frames_; | 340 bool children_need_begin_frames_; |
335 bool defer_commits_; | 341 bool defer_commits_; |
336 bool video_needs_begin_frames_; | 342 bool video_needs_begin_frames_; |
337 bool last_commit_had_no_updates_; | 343 bool last_commit_had_no_updates_; |
338 bool wait_for_ready_to_draw_; | 344 bool wait_for_ready_to_draw_; |
339 bool did_request_swap_in_last_frame_; | 345 bool did_request_swap_in_last_frame_; |
340 bool did_perform_swap_in_last_draw_; | 346 bool did_perform_swap_in_last_draw_; |
341 | 347 |
342 private: | 348 private: |
343 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); | 349 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); |
344 }; | 350 }; |
345 | 351 |
346 } // namespace cc | 352 } // namespace cc |
347 | 353 |
348 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ | 354 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ |
OLD | NEW |