Fix chronic presubmit warnings/errors.
[chromium-blink-merge.git] / cc / scheduler / scheduler_settings.cc
blobab9add087bd9f32bca15c18081d18688ac1d4d9c
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_activation_enabled(false),
15 impl_side_painting(false),
16 timeout_and_draw_when_animation_checkerboards(true),
17 maximum_number_of_failed_draws_before_draw_is_forced_(3),
18 using_synchronous_renderer_compositor(false),
19 throttle_frame_production(true),
20 disable_hi_res_timer_tasks_on_battery(false) {
23 SchedulerSettings::SchedulerSettings(const LayerTreeSettings& settings)
24 : begin_frame_scheduling_enabled(settings.begin_frame_scheduling_enabled),
25 main_frame_before_activation_enabled(
26 settings.main_frame_before_activation_enabled),
27 impl_side_painting(settings.impl_side_painting),
28 timeout_and_draw_when_animation_checkerboards(
29 settings.timeout_and_draw_when_animation_checkerboards),
30 maximum_number_of_failed_draws_before_draw_is_forced_(
31 settings.maximum_number_of_failed_draws_before_draw_is_forced_),
32 using_synchronous_renderer_compositor(
33 settings.using_synchronous_renderer_compositor),
34 throttle_frame_production(settings.throttle_frame_production),
35 disable_hi_res_timer_tasks_on_battery(
36 settings.disable_hi_res_timer_tasks_on_battery) {
39 SchedulerSettings::~SchedulerSettings() {}
41 scoped_refptr<base::debug::ConvertableToTraceFormat>
42 SchedulerSettings::AsValue() const {
43 scoped_refptr<base::debug::TracedValue> state =
44 new base::debug::TracedValue();
45 state->SetBoolean("begin_frame_scheduling_enabled",
46 begin_frame_scheduling_enabled);
47 state->SetBoolean("main_frame_before_activation_enabled",
48 main_frame_before_activation_enabled);
49 state->SetBoolean("impl_side_painting", impl_side_painting);
50 state->SetBoolean("timeout_and_draw_when_animation_checkerboards",
51 timeout_and_draw_when_animation_checkerboards);
52 state->SetInteger("maximum_number_of_failed_draws_before_draw_is_forced_",
53 maximum_number_of_failed_draws_before_draw_is_forced_);
54 state->SetBoolean("using_synchronous_renderer_compositor",
55 using_synchronous_renderer_compositor);
56 state->SetBoolean("throttle_frame_production", throttle_frame_production);
57 state->SetBoolean("disable_hi_res_timer_tasks_on_battery",
58 disable_hi_res_timer_tasks_on_battery);
59 return state;
62 } // namespace cc