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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 // swap when there is not damage, for example. | 172 // swap when there is not damage, for example. |
173 void DidSwapBuffers(); | 173 void DidSwapBuffers(); |
174 | 174 |
175 // Indicates whether a redraw is required because we are currently rendering | 175 // Indicates whether a redraw is required because we are currently rendering |
176 // with a low resolution or checkerboarded tile. | 176 // with a low resolution or checkerboarded tile. |
177 void SetSwapUsedIncompleteTile(bool used_incomplete_tile); | 177 void SetSwapUsedIncompleteTile(bool used_incomplete_tile); |
178 | 178 |
179 // Notification from the OutputSurface that a swap has been consumed. | 179 // Notification from the OutputSurface that a swap has been consumed. |
180 void DidSwapBuffersComplete(); | 180 void DidSwapBuffersComplete(); |
181 | 181 |
| 182 int pending_swaps() const { return pending_swaps_; } |
| 183 |
182 // Indicates whether to prioritize impl thread latency (i.e., animation | 184 // Indicates whether to prioritize impl thread latency (i.e., animation |
183 // smoothness) over new content activation. | 185 // smoothness) over new content activation. |
184 void SetImplLatencyTakesPriority(bool impl_latency_takes_priority); | 186 void SetImplLatencyTakesPriority(bool impl_latency_takes_priority); |
185 bool impl_latency_takes_priority() const { | 187 bool impl_latency_takes_priority() const { |
186 return impl_latency_takes_priority_; | 188 return impl_latency_takes_priority_; |
187 } | 189 } |
188 | 190 |
189 // 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. |
190 void DidDrawIfPossibleCompleted(DrawResult result); | 192 void DidDrawIfPossibleCompleted(DrawResult result); |
191 | 193 |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 bool invalidate_output_surface_funnel_; | 315 bool invalidate_output_surface_funnel_; |
314 // prepare_tiles_funnel_ is "filled" each time PrepareTiles is called | 316 // prepare_tiles_funnel_ is "filled" each time PrepareTiles is called |
315 // and "drained" on each BeginImplFrame. If the funnel gets too full, | 317 // and "drained" on each BeginImplFrame. If the funnel gets too full, |
316 // we start throttling ACTION_PREPARE_TILES such that we average one | 318 // we start throttling ACTION_PREPARE_TILES such that we average one |
317 // PrepareTiles per BeginImplFrame. | 319 // PrepareTiles per BeginImplFrame. |
318 int prepare_tiles_funnel_; | 320 int prepare_tiles_funnel_; |
319 | 321 |
320 int consecutive_checkerboard_animations_; | 322 int consecutive_checkerboard_animations_; |
321 int max_pending_swaps_; | 323 int max_pending_swaps_; |
322 int pending_swaps_; | 324 int pending_swaps_; |
| 325 int swaps_with_current_output_surface_; |
323 bool needs_redraw_; | 326 bool needs_redraw_; |
324 bool needs_animate_; | 327 bool needs_animate_; |
325 bool needs_prepare_tiles_; | 328 bool needs_prepare_tiles_; |
326 bool needs_commit_; | 329 bool needs_commit_; |
327 bool visible_; | 330 bool visible_; |
328 bool can_start_; | 331 bool can_start_; |
329 bool can_draw_; | 332 bool can_draw_; |
330 bool has_pending_tree_; | 333 bool has_pending_tree_; |
331 bool pending_tree_is_ready_for_activation_; | 334 bool pending_tree_is_ready_for_activation_; |
332 bool active_tree_needs_first_draw_; | 335 bool active_tree_needs_first_draw_; |
(...skipping 10 matching lines...) Expand all Loading... |
343 bool did_request_swap_in_last_frame_; | 346 bool did_request_swap_in_last_frame_; |
344 bool did_perform_swap_in_last_draw_; | 347 bool did_perform_swap_in_last_draw_; |
345 | 348 |
346 private: | 349 private: |
347 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); | 350 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); |
348 }; | 351 }; |
349 | 352 |
350 } // namespace cc | 353 } // namespace cc |
351 | 354 |
352 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ | 355 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ |
OLD | NEW |