OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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_settings.h" | 5 #include "cc/scheduler/scheduler_settings.h" |
6 | 6 |
7 #include "base/debug/trace_event_argument.h" | |
8 #include "cc/trees/layer_tree_settings.h" | 7 #include "cc/trees/layer_tree_settings.h" |
9 | 8 |
10 namespace cc { | 9 namespace cc { |
11 | 10 |
12 SchedulerSettings::SchedulerSettings() | 11 SchedulerSettings::SchedulerSettings() |
13 : begin_frame_scheduling_enabled(true), | 12 : begin_frame_scheduling_enabled(true), |
14 main_frame_before_draw_enabled(true), | 13 main_frame_before_draw_enabled(true), |
15 main_frame_before_activation_enabled(false), | 14 main_frame_before_activation_enabled(false), |
16 impl_side_painting(false), | 15 impl_side_painting(false), |
17 timeout_and_draw_when_animation_checkerboards(true), | 16 timeout_and_draw_when_animation_checkerboards(true), |
(...skipping 12 matching lines...) Expand all Loading... |
30 settings.timeout_and_draw_when_animation_checkerboards), | 29 settings.timeout_and_draw_when_animation_checkerboards), |
31 maximum_number_of_failed_draws_before_draw_is_forced_( | 30 maximum_number_of_failed_draws_before_draw_is_forced_( |
32 settings.maximum_number_of_failed_draws_before_draw_is_forced_), | 31 settings.maximum_number_of_failed_draws_before_draw_is_forced_), |
33 using_synchronous_renderer_compositor( | 32 using_synchronous_renderer_compositor( |
34 settings.using_synchronous_renderer_compositor), | 33 settings.using_synchronous_renderer_compositor), |
35 throttle_frame_production(settings.throttle_frame_production) { | 34 throttle_frame_production(settings.throttle_frame_production) { |
36 } | 35 } |
37 | 36 |
38 SchedulerSettings::~SchedulerSettings() {} | 37 SchedulerSettings::~SchedulerSettings() {} |
39 | 38 |
40 scoped_refptr<base::debug::ConvertableToTraceFormat> | 39 scoped_ptr<base::Value> SchedulerSettings::AsValue() const { |
41 SchedulerSettings::AsValue() const { | 40 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue); |
42 scoped_refptr<base::debug::TracedValue> state = | |
43 new base::debug::TracedValue(); | |
44 state->SetBoolean("begin_frame_scheduling_enabled", | 41 state->SetBoolean("begin_frame_scheduling_enabled", |
45 begin_frame_scheduling_enabled); | 42 begin_frame_scheduling_enabled); |
46 state->SetBoolean("main_frame_before_draw_enabled", | 43 state->SetBoolean("main_frame_before_draw_enabled", |
47 main_frame_before_draw_enabled); | 44 main_frame_before_draw_enabled); |
48 state->SetBoolean("main_frame_before_activation_enabled", | 45 state->SetBoolean("main_frame_before_activation_enabled", |
49 main_frame_before_activation_enabled); | 46 main_frame_before_activation_enabled); |
50 state->SetBoolean("impl_side_painting", impl_side_painting); | 47 state->SetBoolean("impl_side_painting", impl_side_painting); |
51 state->SetBoolean("timeout_and_draw_when_animation_checkerboards", | 48 state->SetBoolean("timeout_and_draw_when_animation_checkerboards", |
52 timeout_and_draw_when_animation_checkerboards); | 49 timeout_and_draw_when_animation_checkerboards); |
53 state->SetInteger("maximum_number_of_failed_draws_before_draw_is_forced_", | 50 state->SetInteger("maximum_number_of_failed_draws_before_draw_is_forced_", |
54 maximum_number_of_failed_draws_before_draw_is_forced_); | 51 maximum_number_of_failed_draws_before_draw_is_forced_); |
55 state->SetBoolean("using_synchronous_renderer_compositor", | 52 state->SetBoolean("using_synchronous_renderer_compositor", |
56 using_synchronous_renderer_compositor); | 53 using_synchronous_renderer_compositor); |
57 state->SetBoolean("throttle_frame_production", throttle_frame_production); | 54 state->SetBoolean("throttle_frame_production", throttle_frame_production); |
58 return state; | 55 return state.PassAs<base::Value>(); |
59 } | 56 } |
60 | 57 |
61 } // namespace cc | 58 } // namespace cc |
OLD | NEW |