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 #include "cc/scheduler/scheduler_state_machine.h" | 5 #include "cc/scheduler/scheduler_state_machine.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
9 | 9 |
10 namespace cc { | 10 namespace cc { |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 void SchedulerStateMachine::SetNeedsForcedRedraw() { | 363 void SchedulerStateMachine::SetNeedsForcedRedraw() { |
364 needs_forced_redraw_ = true; | 364 needs_forced_redraw_ = true; |
365 } | 365 } |
366 | 366 |
367 void SchedulerStateMachine::DidDrawIfPossibleCompleted(bool success) { | 367 void SchedulerStateMachine::DidDrawIfPossibleCompleted(bool success) { |
368 draw_if_possible_failed_ = !success; | 368 draw_if_possible_failed_ = !success; |
369 if (draw_if_possible_failed_) { | 369 if (draw_if_possible_failed_) { |
370 needs_redraw_ = true; | 370 needs_redraw_ = true; |
371 needs_commit_ = true; | 371 needs_commit_ = true; |
372 consecutive_failed_draws_++; | 372 consecutive_failed_draws_++; |
373 if (consecutive_failed_draws_ >= | 373 if (settings_.timeout_and_draw_when_animation_checkerboards && |
| 374 consecutive_failed_draws_ >= |
374 maximum_number_of_failed_draws_before_draw_is_forced_) { | 375 maximum_number_of_failed_draws_before_draw_is_forced_) { |
375 consecutive_failed_draws_ = 0; | 376 consecutive_failed_draws_ = 0; |
376 // We need to force a draw, but it doesn't make sense to do this until | 377 // We need to force a draw, but it doesn't make sense to do this until |
377 // we've committed and have new textures. | 378 // we've committed and have new textures. |
378 needs_forced_redraw_after_next_commit_ = true; | 379 needs_forced_redraw_after_next_commit_ = true; |
379 } | 380 } |
380 } else { | 381 } else { |
381 consecutive_failed_draws_ = 0; | 382 consecutive_failed_draws_ = 0; |
382 } | 383 } |
383 } | 384 } |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 output_surface_state_ = OUTPUT_SURFACE_ACTIVE; | 425 output_surface_state_ = OUTPUT_SURFACE_ACTIVE; |
425 SetNeedsCommit(); | 426 SetNeedsCommit(); |
426 } | 427 } |
427 | 428 |
428 void SchedulerStateMachine::SetMaximumNumberOfFailedDrawsBeforeDrawIsForced( | 429 void SchedulerStateMachine::SetMaximumNumberOfFailedDrawsBeforeDrawIsForced( |
429 int num_draws) { | 430 int num_draws) { |
430 maximum_number_of_failed_draws_before_draw_is_forced_ = num_draws; | 431 maximum_number_of_failed_draws_before_draw_is_forced_ = num_draws; |
431 } | 432 } |
432 | 433 |
433 } // namespace cc | 434 } // namespace cc |
OLD | NEW |