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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
169 | 169 |
170 // Indicates that a redraw is required, either due to the impl tree changing | 170 // Indicates that a redraw is required, either due to the impl tree changing |
171 // or the screen being damaged and simply needing redisplay. | 171 // or the screen being damaged and simply needing redisplay. |
172 void SetNeedsRedraw(); | 172 void SetNeedsRedraw(); |
173 bool needs_redraw() const { return needs_redraw_; } | 173 bool needs_redraw() const { return needs_redraw_; } |
174 | 174 |
175 // Indicates that manage-tiles is required. This guarantees another | 175 // Indicates that manage-tiles is required. This guarantees another |
176 // ManageTiles will occur shortly (even if no redraw is required). | 176 // ManageTiles will occur shortly (even if no redraw is required). |
177 void SetNeedsManageTiles(); | 177 void SetNeedsManageTiles(); |
178 | 178 |
179 // Sets how many swaps can be pending to the OutputSurface. | |
180 void SetMaxSwapsPending(int max); | |
181 | |
182 // If the scheduler attempted to draw and swap, this provides feedback | |
183 // regarding whether or not the swap actually occured. We might skip the | |
184 // swap when there is not damage, for example. | |
Sami
2014/04/08 13:42:19
Not directly related to this patch, but I always w
| |
185 void DidSwapBuffers(); | |
186 | |
179 // Indicates whether a redraw is required because we are currently rendering | 187 // Indicates whether a redraw is required because we are currently rendering |
180 // with a low resolution or checkerboarded tile. | 188 // with a low resolution or checkerboarded tile. |
181 void SetSwapUsedIncompleteTile(bool used_incomplete_tile); | 189 void SetSwapUsedIncompleteTile(bool used_incomplete_tile); |
182 | 190 |
191 // Notification from the OutputSurface that a swap has been consumed. | |
192 void OnSwapBuffersComplete(); | |
Sami
2014/04/08 13:42:19
bikeshed: DidSwapBuffersComplete to match the sche
| |
193 | |
183 // Indicates whether to prioritize animation smoothness over new content | 194 // Indicates whether to prioritize animation smoothness over new content |
184 // activation. | 195 // activation. |
185 void SetSmoothnessTakesPriority(bool smoothness_takes_priority); | 196 void SetSmoothnessTakesPriority(bool smoothness_takes_priority); |
186 bool smoothness_takes_priority() const { return smoothness_takes_priority_; } | 197 bool smoothness_takes_priority() const { return smoothness_takes_priority_; } |
187 | 198 |
188 // Indicates whether ACTION_DRAW_AND_SWAP_IF_POSSIBLE drew to the screen. | 199 // Indicates whether ACTION_DRAW_AND_SWAP_IF_POSSIBLE drew to the screen. |
189 void DidDrawIfPossibleCompleted(DrawSwapReadbackResult::DrawResult result); | 200 void DidDrawIfPossibleCompleted(DrawSwapReadbackResult::DrawResult result); |
190 | 201 |
191 // Indicates that a new commit flow needs to be performed, either to pull | 202 // Indicates that a new commit flow needs to be performed, either to pull |
192 // updates from the main thread to the impl, or to push deltas from the impl | 203 // updates from the main thread to the impl, or to push deltas from the impl |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
295 int last_frame_number_swap_performed_; | 306 int last_frame_number_swap_performed_; |
296 int last_frame_number_begin_main_frame_sent_; | 307 int last_frame_number_begin_main_frame_sent_; |
297 int last_frame_number_update_visible_tiles_was_called_; | 308 int last_frame_number_update_visible_tiles_was_called_; |
298 | 309 |
299 // manage_tiles_funnel_ is "filled" each time ManageTiles is called | 310 // manage_tiles_funnel_ is "filled" each time ManageTiles is called |
300 // and "drained" on each BeginImplFrame. If the funnel gets too full, | 311 // and "drained" on each BeginImplFrame. If the funnel gets too full, |
301 // we start throttling ACTION_MANAGE_TILES such that we average one | 312 // we start throttling ACTION_MANAGE_TILES such that we average one |
302 // ManageTile per BeginImplFrame. | 313 // ManageTile per BeginImplFrame. |
303 int manage_tiles_funnel_; | 314 int manage_tiles_funnel_; |
304 int consecutive_checkerboard_animations_; | 315 int consecutive_checkerboard_animations_; |
316 int max_pending_swaps_; | |
317 int pending_swaps_; | |
305 bool needs_redraw_; | 318 bool needs_redraw_; |
306 bool needs_manage_tiles_; | 319 bool needs_manage_tiles_; |
307 bool swap_used_incomplete_tile_; | 320 bool swap_used_incomplete_tile_; |
308 bool needs_commit_; | 321 bool needs_commit_; |
309 bool main_thread_needs_layer_textures_; | 322 bool main_thread_needs_layer_textures_; |
310 bool inside_poll_for_anticipated_draw_triggers_; | 323 bool inside_poll_for_anticipated_draw_triggers_; |
311 bool visible_; | 324 bool visible_; |
312 bool can_start_; | 325 bool can_start_; |
313 bool can_draw_; | 326 bool can_draw_; |
314 bool has_pending_tree_; | 327 bool has_pending_tree_; |
315 bool pending_tree_is_ready_for_activation_; | 328 bool pending_tree_is_ready_for_activation_; |
316 bool active_tree_needs_first_draw_; | 329 bool active_tree_needs_first_draw_; |
317 bool draw_if_possible_failed_; | 330 bool draw_if_possible_failed_; |
318 bool did_create_and_initialize_first_output_surface_; | 331 bool did_create_and_initialize_first_output_surface_; |
319 bool smoothness_takes_priority_; | 332 bool smoothness_takes_priority_; |
320 bool skip_next_begin_main_frame_to_reduce_latency_; | 333 bool skip_next_begin_main_frame_to_reduce_latency_; |
321 bool skip_begin_main_frame_to_reduce_latency_; | 334 bool skip_begin_main_frame_to_reduce_latency_; |
322 bool continuous_painting_; | 335 bool continuous_painting_; |
323 bool needs_back_to_back_readback_; | 336 bool needs_back_to_back_readback_; |
324 | 337 |
325 private: | 338 private: |
326 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); | 339 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); |
327 }; | 340 }; |
328 | 341 |
329 } // namespace cc | 342 } // namespace cc |
330 | 343 |
331 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ | 344 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ |
OLD | NEW |