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" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
13 #include "cc/base/cc_export.h" | 13 #include "cc/base/cc_export.h" |
14 #include "cc/output/begin_frame_args.h" | 14 #include "cc/output/begin_frame_args.h" |
| 15 #include "cc/scheduler/draw_swap_readback_result.h" |
15 #include "cc/scheduler/scheduler_settings.h" | 16 #include "cc/scheduler/scheduler_settings.h" |
16 | 17 |
17 namespace base { | 18 namespace base { |
18 class Value; | 19 class Value; |
19 } | 20 } |
20 | 21 |
21 namespace cc { | 22 namespace cc { |
22 | 23 |
23 // The SchedulerStateMachine decides how to coordinate main thread activites | 24 // The SchedulerStateMachine decides how to coordinate main thread activites |
24 // like painting/running javascript with rendering and input activities on the | 25 // like painting/running javascript with rendering and input activities on the |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 | 174 |
174 // Indicates whether a redraw is required because we are currently rendering | 175 // Indicates whether a redraw is required because we are currently rendering |
175 // with a low resolution or checkerboarded tile. | 176 // with a low resolution or checkerboarded tile. |
176 void SetSwapUsedIncompleteTile(bool used_incomplete_tile); | 177 void SetSwapUsedIncompleteTile(bool used_incomplete_tile); |
177 | 178 |
178 // Indicates whether to prioritize animation smoothness over new content | 179 // Indicates whether to prioritize animation smoothness over new content |
179 // activation. | 180 // activation. |
180 void SetSmoothnessTakesPriority(bool smoothness_takes_priority); | 181 void SetSmoothnessTakesPriority(bool smoothness_takes_priority); |
181 | 182 |
182 // Indicates whether ACTION_DRAW_AND_SWAP_IF_POSSIBLE drew to the screen. | 183 // Indicates whether ACTION_DRAW_AND_SWAP_IF_POSSIBLE drew to the screen. |
183 void DidDrawIfPossibleCompleted(bool success); | 184 void DidDrawIfPossibleCompleted(DrawSwapReadbackResult::DrawResult result); |
184 | 185 |
185 // Indicates that a new commit flow needs to be performed, either to pull | 186 // Indicates that a new commit flow needs to be performed, either to pull |
186 // updates from the main thread to the impl, or to push deltas from the impl | 187 // updates from the main thread to the impl, or to push deltas from the impl |
187 // thread to main. | 188 // thread to main. |
188 void SetNeedsCommit(); | 189 void SetNeedsCommit(); |
189 | 190 |
190 // As SetNeedsCommit(), but ensures the BeginMainFrame will be sent even | 191 // As SetNeedsCommit(), but ensures the BeginMainFrame will be sent even |
191 // if we are not visible. After this call we expect to go through | 192 // if we are not visible. After this call we expect to go through |
192 // the forced commit flow and then return to waiting for a non-forced | 193 // the forced commit flow and then return to waiting for a non-forced |
193 // BeginMainFrame to finish. | 194 // BeginMainFrame to finish. |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 int current_frame_number_; | 281 int current_frame_number_; |
281 int last_frame_number_swap_performed_; | 282 int last_frame_number_swap_performed_; |
282 int last_frame_number_begin_main_frame_sent_; | 283 int last_frame_number_begin_main_frame_sent_; |
283 int last_frame_number_update_visible_tiles_was_called_; | 284 int last_frame_number_update_visible_tiles_was_called_; |
284 | 285 |
285 // manage_tiles_funnel_ is "filled" each time ManageTiles is called | 286 // manage_tiles_funnel_ is "filled" each time ManageTiles is called |
286 // and "drained" on each BeginImplFrame. If the funnel gets too full, | 287 // and "drained" on each BeginImplFrame. If the funnel gets too full, |
287 // we start throttling ACTION_MANAGE_TILES such that we average one | 288 // we start throttling ACTION_MANAGE_TILES such that we average one |
288 // ManageTile per BeginImplFrame. | 289 // ManageTile per BeginImplFrame. |
289 int manage_tiles_funnel_; | 290 int manage_tiles_funnel_; |
290 int consecutive_failed_draws_; | 291 int consecutive_checkerboard_animations_; |
291 bool needs_redraw_; | 292 bool needs_redraw_; |
292 bool needs_manage_tiles_; | 293 bool needs_manage_tiles_; |
293 bool swap_used_incomplete_tile_; | 294 bool swap_used_incomplete_tile_; |
294 bool needs_commit_; | 295 bool needs_commit_; |
295 bool main_thread_needs_layer_textures_; | 296 bool main_thread_needs_layer_textures_; |
296 bool inside_poll_for_anticipated_draw_triggers_; | 297 bool inside_poll_for_anticipated_draw_triggers_; |
297 bool visible_; | 298 bool visible_; |
298 bool can_start_; | 299 bool can_start_; |
299 bool can_draw_; | 300 bool can_draw_; |
300 bool has_pending_tree_; | 301 bool has_pending_tree_; |
301 bool pending_tree_is_ready_for_activation_; | 302 bool pending_tree_is_ready_for_activation_; |
302 bool active_tree_needs_first_draw_; | 303 bool active_tree_needs_first_draw_; |
303 bool draw_if_possible_failed_; | 304 bool draw_if_possible_failed_; |
304 bool did_create_and_initialize_first_output_surface_; | 305 bool did_create_and_initialize_first_output_surface_; |
305 bool smoothness_takes_priority_; | 306 bool smoothness_takes_priority_; |
306 bool skip_begin_main_frame_to_reduce_latency_; | 307 bool skip_begin_main_frame_to_reduce_latency_; |
307 | 308 |
308 private: | 309 private: |
309 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); | 310 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); |
310 }; | 311 }; |
311 | 312 |
312 } // namespace cc | 313 } // namespace cc |
313 | 314 |
314 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ | 315 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ |
OLD | NEW |