Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Side by Side Diff: cc/scheduler/scheduler_state_machine.cc

Issue 13577005: cc: Prevent checkerboarded animations from timing out during tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/scheduler/scheduler_settings.cc ('k') | cc/trees/layer_tree_host_unittest_animation.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « cc/scheduler/scheduler_settings.cc ('k') | cc/trees/layer_tree_host_unittest_animation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698