Chromium Code Reviews| 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 161 | 161 |
| 162 // Indicates that a redraw is required, either due to the impl tree changing | 162 // Indicates that a redraw is required, either due to the impl tree changing |
| 163 // or the screen being damaged and simply needing redisplay. | 163 // or the screen being damaged and simply needing redisplay. |
| 164 void SetNeedsRedraw(); | 164 void SetNeedsRedraw(); |
| 165 bool needs_redraw() const { return needs_redraw_; } | 165 bool needs_redraw() const { return needs_redraw_; } |
| 166 | 166 |
| 167 // Indicates that manage-tiles is required. This guarantees another | 167 // Indicates that manage-tiles is required. This guarantees another |
| 168 // ManageTiles will occur shortly (even if no redraw is required). | 168 // ManageTiles will occur shortly (even if no redraw is required). |
| 169 void SetNeedsManageTiles(); | 169 void SetNeedsManageTiles(); |
| 170 | 170 |
| 171 // Sets how many swaps can be pending to the OutputSurface. | |
| 172 void SetMaxSwapsPending(int max); | |
| 173 | |
| 174 // If the scheduler attempted to draw and swap, this provides feedback | |
| 175 // regarding whether or not the swap actually occured. We might skip the | |
|
danakj
2014/04/11 15:12:28
This overlaps with the DrawSwapReadbackResult::did
brianderson
2014/04/11 20:49:40
Hmm, I was under the impression DrawSwapReadbackRe
danakj
2014/04/14 18:14:50
The did_swap result is being dropped right now in
| |
| 176 // swap when there is not damage, for example. | |
| 177 void DidSwapBuffers(); | |
| 178 | |
| 171 // Indicates whether a redraw is required because we are currently rendering | 179 // Indicates whether a redraw is required because we are currently rendering |
| 172 // with a low resolution or checkerboarded tile. | 180 // with a low resolution or checkerboarded tile. |
| 173 void SetSwapUsedIncompleteTile(bool used_incomplete_tile); | 181 void SetSwapUsedIncompleteTile(bool used_incomplete_tile); |
| 174 | 182 |
| 183 // Notification from the OutputSurface that a swap has been consumed. | |
| 184 void DidSwapBuffersComplete(); | |
| 185 | |
| 175 // Indicates whether to prioritize animation smoothness over new content | 186 // Indicates whether to prioritize animation smoothness over new content |
| 176 // activation. | 187 // activation. |
| 177 void SetSmoothnessTakesPriority(bool smoothness_takes_priority); | 188 void SetSmoothnessTakesPriority(bool smoothness_takes_priority); |
| 178 bool smoothness_takes_priority() const { return smoothness_takes_priority_; } | 189 bool smoothness_takes_priority() const { return smoothness_takes_priority_; } |
| 179 | 190 |
| 180 // Indicates whether ACTION_DRAW_AND_SWAP_IF_POSSIBLE drew to the screen. | 191 // Indicates whether ACTION_DRAW_AND_SWAP_IF_POSSIBLE drew to the screen. |
| 181 void DidDrawIfPossibleCompleted(DrawSwapReadbackResult::DrawResult result); | 192 void DidDrawIfPossibleCompleted(DrawSwapReadbackResult::DrawResult result); |
| 182 | 193 |
| 183 // Indicates that a new commit flow needs to be performed, either to pull | 194 // Indicates that a new commit flow needs to be performed, either to pull |
| 184 // updates from the main thread to the impl, or to push deltas from the impl | 195 // updates from the main thread to the impl, or to push deltas from the impl |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 278 int last_frame_number_swap_performed_; | 289 int last_frame_number_swap_performed_; |
| 279 int last_frame_number_begin_main_frame_sent_; | 290 int last_frame_number_begin_main_frame_sent_; |
| 280 int last_frame_number_update_visible_tiles_was_called_; | 291 int last_frame_number_update_visible_tiles_was_called_; |
| 281 | 292 |
| 282 // manage_tiles_funnel_ is "filled" each time ManageTiles is called | 293 // manage_tiles_funnel_ is "filled" each time ManageTiles is called |
| 283 // and "drained" on each BeginImplFrame. If the funnel gets too full, | 294 // and "drained" on each BeginImplFrame. If the funnel gets too full, |
| 284 // we start throttling ACTION_MANAGE_TILES such that we average one | 295 // we start throttling ACTION_MANAGE_TILES such that we average one |
| 285 // ManageTile per BeginImplFrame. | 296 // ManageTile per BeginImplFrame. |
| 286 int manage_tiles_funnel_; | 297 int manage_tiles_funnel_; |
| 287 int consecutive_checkerboard_animations_; | 298 int consecutive_checkerboard_animations_; |
| 299 int max_pending_swaps_; | |
| 300 int pending_swaps_; | |
| 288 bool needs_redraw_; | 301 bool needs_redraw_; |
| 289 bool needs_manage_tiles_; | 302 bool needs_manage_tiles_; |
| 290 bool swap_used_incomplete_tile_; | 303 bool swap_used_incomplete_tile_; |
| 291 bool needs_commit_; | 304 bool needs_commit_; |
| 292 bool inside_poll_for_anticipated_draw_triggers_; | 305 bool inside_poll_for_anticipated_draw_triggers_; |
| 293 bool visible_; | 306 bool visible_; |
| 294 bool can_start_; | 307 bool can_start_; |
| 295 bool can_draw_; | 308 bool can_draw_; |
| 296 bool has_pending_tree_; | 309 bool has_pending_tree_; |
| 297 bool pending_tree_is_ready_for_activation_; | 310 bool pending_tree_is_ready_for_activation_; |
| 298 bool active_tree_needs_first_draw_; | 311 bool active_tree_needs_first_draw_; |
| 299 bool draw_if_possible_failed_; | 312 bool draw_if_possible_failed_; |
| 300 bool did_create_and_initialize_first_output_surface_; | 313 bool did_create_and_initialize_first_output_surface_; |
| 301 bool smoothness_takes_priority_; | 314 bool smoothness_takes_priority_; |
| 302 bool skip_next_begin_main_frame_to_reduce_latency_; | 315 bool skip_next_begin_main_frame_to_reduce_latency_; |
| 303 bool skip_begin_main_frame_to_reduce_latency_; | 316 bool skip_begin_main_frame_to_reduce_latency_; |
| 304 bool continuous_painting_; | 317 bool continuous_painting_; |
| 305 bool needs_back_to_back_readback_; | 318 bool needs_back_to_back_readback_; |
| 306 | 319 |
| 307 private: | 320 private: |
| 308 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); | 321 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); |
| 309 }; | 322 }; |
| 310 | 323 |
| 311 } // namespace cc | 324 } // namespace cc |
| 312 | 325 |
| 313 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ | 326 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ |
| OLD | NEW |