Enable gaia services for enterprise autotests.
[chromium-blink-merge.git] / cc / scheduler / scheduler_settings.cc
blobea714e34b0dbae4fd3fc49fc0c874f758e739add
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "cc/scheduler/scheduler_settings.h"
7 #include "base/debug/trace_event_argument.h"
8 #include "cc/trees/layer_tree_settings.h"
10 namespace cc {
12 SchedulerSettings::SchedulerSettings()
13 : begin_frame_scheduling_enabled(true),
14 main_frame_before_draw_enabled(true),
15 main_frame_before_activation_enabled(false),
16 impl_side_painting(false),
17 timeout_and_draw_when_animation_checkerboards(true),
18 maximum_number_of_failed_draws_before_draw_is_forced_(3),
19 using_synchronous_renderer_compositor(false),
20 throttle_frame_production(true) {
23 SchedulerSettings::SchedulerSettings(const LayerTreeSettings& settings)
24 : begin_frame_scheduling_enabled(settings.begin_frame_scheduling_enabled),
25 main_frame_before_draw_enabled(settings.main_frame_before_draw_enabled),
26 main_frame_before_activation_enabled(
27 settings.main_frame_before_activation_enabled),
28 impl_side_painting(settings.impl_side_painting),
29 timeout_and_draw_when_animation_checkerboards(
30 settings.timeout_and_draw_when_animation_checkerboards),
31 maximum_number_of_failed_draws_before_draw_is_forced_(
32 settings.maximum_number_of_failed_draws_before_draw_is_forced_),
33 using_synchronous_renderer_compositor(
34 settings.using_synchronous_renderer_compositor),
35 throttle_frame_production(settings.throttle_frame_production) {
38 SchedulerSettings::~SchedulerSettings() {}
40 scoped_refptr<base::debug::ConvertableToTraceFormat>
41 SchedulerSettings::AsValue() const {
42 scoped_refptr<base::debug::TracedValue> state =
43 new base::debug::TracedValue();
44 state->SetBoolean("begin_frame_scheduling_enabled",
45 begin_frame_scheduling_enabled);
46 state->SetBoolean("main_frame_before_draw_enabled",
47 main_frame_before_draw_enabled);
48 state->SetBoolean("main_frame_before_activation_enabled",
49 main_frame_before_activation_enabled);
50 state->SetBoolean("impl_side_painting", impl_side_painting);
51 state->SetBoolean("timeout_and_draw_when_animation_checkerboards",
52 timeout_and_draw_when_animation_checkerboards);
53 state->SetInteger("maximum_number_of_failed_draws_before_draw_is_forced_",
54 maximum_number_of_failed_draws_before_draw_is_forced_);
55 state->SetBoolean("using_synchronous_renderer_compositor",
56 using_synchronous_renderer_compositor);
57 state->SetBoolean("throttle_frame_production", throttle_frame_production);
58 return state;
61 } // namespace cc