Commit 545dd721 authored by danakj@chromium.org's avatar danakj@chromium.org

cc: Prevent checkerboarded animations from timing out during tests.

During tests that verify behaviour with checkerboarding, we need
preductable behaviour. Currently if the test takes too long and
the compositor thread ticks too many times, the checkerboarded
animation will time out and animate+draw. This is unpredictable
flaky behaviour for the tests. So add a setting to disable this
timeout-and-draw behaviour in the scheduler.

R=jamesr
BUG=228998

Review URL: https://chromiumcodereview.appspot.com/13577005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193006 0039d316-1c4b-4281-b951-d872f2087c98
parent 16dc4245
......@@ -6,7 +6,9 @@
namespace cc {
SchedulerSettings::SchedulerSettings() : impl_side_painting(false) {}
SchedulerSettings::SchedulerSettings()
: impl_side_painting(false),
timeout_and_draw_when_animation_checkerboards(true) {}
SchedulerSettings::~SchedulerSettings() {}
......
......@@ -15,6 +15,7 @@ class CC_EXPORT SchedulerSettings {
~SchedulerSettings();
bool impl_side_painting;
bool timeout_and_draw_when_animation_checkerboards;
};
} // namespace cc
......
......@@ -370,7 +370,8 @@ void SchedulerStateMachine::DidDrawIfPossibleCompleted(bool success) {
needs_redraw_ = true;
needs_commit_ = true;
consecutive_failed_draws_++;
if (consecutive_failed_draws_ >=
if (settings_.timeout_and_draw_when_animation_checkerboards &&
consecutive_failed_draws_ >=
maximum_number_of_failed_draws_before_draw_is_forced_) {
consecutive_failed_draws_ = 0;
// We need to force a draw, but it doesn't make sense to do this until
......
......@@ -687,6 +687,12 @@ class LayerTreeHostAnimationTestCheckerboardDoesntStartAnimations
layer_tree_host()->root_layer()->AddChild(content_);
}
virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
// Make sure that drawing many times doesn't cause a checkerboarded
// animation to start so we avoid flake in this test.
settings->timeout_and_draw_when_animation_checkerboards = false;
}
virtual void BeginTest() OVERRIDE {
added_animations_ = 0;
started_times_ = 0;
......
......@@ -36,6 +36,7 @@ LayerTreeSettings::LayerTreeSettings()
use_color_estimator(false),
use_memory_management(true),
prediction_benchmarking(false),
timeout_and_draw_when_animation_checkerboards(true),
minimum_contents_scale(0.0625f),
low_res_contents_scale_factor(0.125f),
top_controls_height(0.f),
......
......@@ -41,6 +41,7 @@ class CC_EXPORT LayerTreeSettings {
bool use_color_estimator;
bool use_memory_management;
bool prediction_benchmarking;
bool timeout_and_draw_when_animation_checkerboards;
float minimum_contents_scale;
float low_res_contents_scale_factor;
float top_controls_height;
......
......@@ -1095,9 +1095,11 @@ void ThreadProxy::InitializeImplOnImplThread(CompletionEvent* completion,
} else {
frame_rate_controller.reset(new FrameRateController(Proxy::ImplThread()));
}
const LayerTreeSettings& settings = layer_tree_host_->settings();
SchedulerSettings scheduler_settings;
scheduler_settings.impl_side_painting =
layer_tree_host_->settings().impl_side_painting;
scheduler_settings.impl_side_painting = settings.impl_side_painting;
scheduler_settings.timeout_and_draw_when_animation_checkerboards =
settings.timeout_and_draw_when_animation_checkerboards;
scheduler_on_impl_thread_ = Scheduler::Create(this,
frame_rate_controller.Pass(),
scheduler_settings);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment