[email protected] | ff762fb | 2012-12-12 19:18:37 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
[email protected] | 556fd29 | 2013-03-18 08:03:04 | [diff] [blame] | 5 | #include "cc/trees/layer_tree_settings.h" |
[email protected] | ff762fb | 2012-12-12 19:18:37 | [diff] [blame] | 6 | |
dongseong.hwang | 72183b0 | 2014-12-08 10:41:55 | [diff] [blame] | 7 | #include <GLES2/gl2.h> |
avi | 02a4d17 | 2015-12-21 06:14:36 | [diff] [blame] | 8 | #include <stddef.h> |
[email protected] | ff762fb | 2012-12-12 19:18:37 | [diff] [blame] | 9 | #include <limits> |
| 10 | |
| 11 | #include "base/command_line.h" |
| 12 | #include "base/logging.h" |
[email protected] | 8e61d4b | 2013-06-10 22:11:48 | [diff] [blame] | 13 | #include "base/strings/string_number_conversions.h" |
nyquist | 2fe752c | 2015-12-10 20:12:51 | [diff] [blame] | 14 | #include "cc/proto/gfx_conversions.h" |
| 15 | #include "cc/proto/gpu_conversions.h" |
| 16 | #include "cc/proto/layer_tree_settings.pb.h" |
jie.a.chen | 0ffadce3 | 2015-08-07 12:59:23 | [diff] [blame] | 17 | #include "ui/gfx/buffer_types.h" |
[email protected] | ff762fb | 2012-12-12 19:18:37 | [diff] [blame] | 18 | |
| 19 | namespace cc { |
| 20 | |
nyquist | 2fe752c | 2015-12-10 20:12:51 | [diff] [blame] | 21 | namespace { |
| 22 | |
| 23 | proto::LayerTreeSettings_ScrollbarAnimator |
| 24 | LayerTreeSettingsScrollbarAnimatorToProto( |
| 25 | const LayerTreeSettings::ScrollbarAnimator& animator) { |
| 26 | switch (animator) { |
| 27 | case LayerTreeSettings::ScrollbarAnimator::NO_ANIMATOR: |
| 28 | return proto::LayerTreeSettings_ScrollbarAnimator_NO_ANIMATOR; |
| 29 | case LayerTreeSettings::ScrollbarAnimator::LINEAR_FADE: |
| 30 | return proto::LayerTreeSettings_ScrollbarAnimator_LINEAR_FADE; |
| 31 | case LayerTreeSettings::ScrollbarAnimator::THINNING: |
| 32 | return proto::LayerTreeSettings_ScrollbarAnimator_THINNING; |
| 33 | } |
| 34 | NOTREACHED() << "proto::LayerTreeSettings_ScrollbarAnimator_UNKNOWN"; |
| 35 | return proto::LayerTreeSettings_ScrollbarAnimator_UNKNOWN; |
| 36 | } |
| 37 | |
| 38 | LayerTreeSettings::ScrollbarAnimator |
| 39 | LayerTreeSettingsScrollbarAnimatorFromProto( |
| 40 | const proto::LayerTreeSettings_ScrollbarAnimator& animator) { |
| 41 | switch (animator) { |
| 42 | case proto::LayerTreeSettings_ScrollbarAnimator_NO_ANIMATOR: |
| 43 | return LayerTreeSettings::ScrollbarAnimator::NO_ANIMATOR; |
| 44 | case proto::LayerTreeSettings_ScrollbarAnimator_LINEAR_FADE: |
| 45 | return LayerTreeSettings::ScrollbarAnimator::LINEAR_FADE; |
| 46 | case proto::LayerTreeSettings_ScrollbarAnimator_THINNING: |
| 47 | return LayerTreeSettings::ScrollbarAnimator::THINNING; |
| 48 | case proto::LayerTreeSettings_ScrollbarAnimator_UNKNOWN: |
| 49 | NOTREACHED() << "proto::LayerTreeSettings_ScrollbarAnimator_UNKNOWN"; |
| 50 | return LayerTreeSettings::ScrollbarAnimator::NO_ANIMATOR; |
| 51 | } |
| 52 | return LayerTreeSettings::ScrollbarAnimator::NO_ANIMATOR; |
| 53 | } |
| 54 | |
| 55 | } // namespace |
| 56 | |
[email protected] | ff762fb | 2012-12-12 19:18:37 | [diff] [blame] | 57 | LayerTreeSettings::LayerTreeSettings() |
danakj | 1359752 | 2015-06-20 05:01:17 | [diff] [blame] | 58 | : single_thread_proxy_scheduler(true), |
simonhong | 2880b8e | 2014-11-11 23:25:36 | [diff] [blame] | 59 | use_external_begin_frame_source(false), |
[email protected] | 0c7a561 | 2014-03-12 21:58:22 | [diff] [blame] | 60 | main_frame_before_activation_enabled(false), |
[email protected] | c8cbae7 | 2013-05-23 10:45:03 | [diff] [blame] | 61 | using_synchronous_renderer_compositor(false), |
[email protected] | 8e0176d | 2013-03-21 03:14:52 | [diff] [blame] | 62 | accelerated_animation_enabled(true), |
[email protected] | 8e0176d | 2013-03-21 03:14:52 | [diff] [blame] | 63 | can_use_lcd_text(true), |
hendrikw | cb14368 | 2014-09-25 18:03:01 | [diff] [blame] | 64 | use_distance_field_text(false), |
[email protected] | 7e03a26 | 2014-05-01 20:26:24 | [diff] [blame] | 65 | gpu_rasterization_enabled(false), |
| 66 | gpu_rasterization_forced(false), |
senorblanco | b60ba95 | 2015-01-27 19:12:36 | [diff] [blame] | 67 | gpu_rasterization_msaa_sample_count(0), |
hendrikw | 59d44948 | 2015-04-04 00:44:32 | [diff] [blame] | 68 | gpu_rasterization_skewport_target_time_in_seconds(0.2f), |
danakj | 0755155 | 2014-09-11 19:59:27 | [diff] [blame] | 69 | create_low_res_tiling(false), |
ericrk | 7c03099 | 2015-02-20 01:39:38 | [diff] [blame] | 70 | scrollbar_animator(NO_ANIMATOR), |
[email protected] | 930ff43b | 2014-05-02 05:24:00 | [diff] [blame] | 71 | scrollbar_fade_delay_ms(0), |
sataya.m | 07f11a8 | 2014-10-07 14:29:18 | [diff] [blame] | 72 | scrollbar_fade_resize_delay_ms(0), |
[email protected] | 930ff43b | 2014-05-02 05:24:00 | [diff] [blame] | 73 | scrollbar_fade_duration_ms(0), |
[email protected] | 8e0176d | 2013-03-21 03:14:52 | [diff] [blame] | 74 | solid_color_scrollbar_color(SK_ColorWHITE), |
[email protected] | 545dd721 | 2013-04-09 04:37:35 | [diff] [blame] | 75 | timeout_and_draw_when_animation_checkerboards(true), |
[email protected] | 35a99a1 | 2013-05-09 23:52:29 | [diff] [blame] | 76 | layer_transforms_should_scale_layer_contents(false), |
danakj | 3f76ace | 2014-11-18 16:56:00 | [diff] [blame] | 77 | layers_always_allowed_lcd_text(false), |
[email protected] | 8e0176d | 2013-03-21 03:14:52 | [diff] [blame] | 78 | minimum_contents_scale(0.0625f), |
[email protected] | ce07b78 | 2013-10-02 00:54:50 | [diff] [blame] | 79 | low_res_contents_scale_factor(0.25f), |
[email protected] | 8e0176d | 2013-03-21 03:14:52 | [diff] [blame] | 80 | top_controls_show_threshold(0.5f), |
| 81 | top_controls_hide_threshold(0.5f), |
mithro | 719bf679 | 2014-11-10 15:36:47 | [diff] [blame] | 82 | background_animation_rate(1.0), |
[email protected] | 8e0176d | 2013-03-21 03:14:52 | [diff] [blame] | 83 | default_tile_size(gfx::Size(256, 256)), |
| 84 | max_untiled_layer_size(gfx::Size(512, 512)), |
| 85 | minimum_occlusion_tracking_size(gfx::Size(160, 160)), |
vmpstr | 6c0087b | 2015-07-21 18:32:36 | [diff] [blame] | 86 | // 3000 pixels should give sufficient area for prepainting. |
| 87 | tiling_interest_area_padding(3000), |
vmpstr | abd4d0ce3 | 2014-12-09 20:24:38 | [diff] [blame] | 88 | skewport_target_time_in_seconds(1.0f), |
[email protected] | 42f14bf | 2014-02-13 16:55:42 | [diff] [blame] | 89 | skewport_extrapolation_limit_in_content_pixels(2000), |
[email protected] | 25489c0 | 2014-02-13 23:18:41 | [diff] [blame] | 90 | max_memory_for_prepaint_percentage(100), |
enne | 9276180 | 2016-01-06 19:18:40 | [diff] [blame] | 91 | strict_layer_property_change_checking(false), |
[email protected] | 2cccfef | 2014-05-01 06:05:16 | [diff] [blame] | 92 | use_zero_copy(false), |
ericrk | 1d17f75 | 2015-10-20 03:03:07 | [diff] [blame] | 93 | use_partial_raster(false), |
ccameron | a764475 | 2014-12-30 01:16:31 | [diff] [blame] | 94 | enable_elastic_overscroll(false), |
jie.a.chen | 0ffadce3 | 2015-08-07 12:59:23 | [diff] [blame] | 95 | use_image_texture_targets( |
| 96 | static_cast<size_t>(gfx::BufferFormat::LAST) + 1, |
| 97 | GL_TEXTURE_2D), |
[email protected] | 27a41fe | 2013-09-19 05:05:14 | [diff] [blame] | 98 | ignore_root_layer_flings(false), |
enne | 06a2caf | 2014-10-23 20:34:26 | [diff] [blame] | 99 | scheduled_raster_task_limit(32), |
[email protected] | 8a59280 | 2014-07-02 07:31:33 | [diff] [blame] | 100 | use_occlusion_for_tile_prioritization(false), |
reveman | 34b7a152 | 2015-03-23 20:27:47 | [diff] [blame] | 101 | verify_property_trees(false), |
ajuma | b6adea9 | 2015-12-06 17:19:15 | [diff] [blame] | 102 | use_property_trees(true), |
vmpstr | dfd2286 | 2015-09-25 17:42:41 | [diff] [blame] | 103 | image_decode_tasks_enabled(false), |
loyso | 13efd628 | 2016-01-06 23:56:02 | [diff] [blame] | 104 | use_compositor_animation_timelines(true), |
reveman | 91d2327 | 2015-08-20 13:41:38 | [diff] [blame] | 105 | wait_for_beginframe_interval(true), |
sohan.jyoti | 127a06b4 | 2015-10-05 08:23:34 | [diff] [blame] | 106 | max_staging_buffer_usage_in_bytes(32 * 1024 * 1024), |
| 107 | memory_policy_(64 * 1024 * 1024, |
| 108 | gpu::MemoryAllocation::CUTOFF_ALLOW_EVERYTHING, |
| 109 | ManagedMemoryPolicy::kDefaultNumResourcesLimit) {} |
[email protected] | ff762fb | 2012-12-12 19:18:37 | [diff] [blame] | 110 | |
[email protected] | 8e0176d | 2013-03-21 03:14:52 | [diff] [blame] | 111 | LayerTreeSettings::~LayerTreeSettings() {} |
[email protected] | ff762fb | 2012-12-12 19:18:37 | [diff] [blame] | 112 | |
nyquist | 2fe752c | 2015-12-10 20:12:51 | [diff] [blame] | 113 | bool LayerTreeSettings::operator==(const LayerTreeSettings& other) const { |
| 114 | return renderer_settings == other.renderer_settings && |
| 115 | single_thread_proxy_scheduler == other.single_thread_proxy_scheduler && |
| 116 | use_external_begin_frame_source == |
| 117 | other.use_external_begin_frame_source && |
| 118 | main_frame_before_activation_enabled == |
| 119 | other.main_frame_before_activation_enabled && |
| 120 | using_synchronous_renderer_compositor == |
| 121 | other.using_synchronous_renderer_compositor && |
| 122 | accelerated_animation_enabled == other.accelerated_animation_enabled && |
| 123 | can_use_lcd_text == other.can_use_lcd_text && |
| 124 | use_distance_field_text == other.use_distance_field_text && |
| 125 | gpu_rasterization_enabled == other.gpu_rasterization_enabled && |
| 126 | gpu_rasterization_forced == other.gpu_rasterization_forced && |
| 127 | gpu_rasterization_msaa_sample_count == |
| 128 | other.gpu_rasterization_msaa_sample_count && |
| 129 | create_low_res_tiling == other.create_low_res_tiling && |
| 130 | scrollbar_animator == other.scrollbar_animator && |
| 131 | scrollbar_fade_delay_ms == other.scrollbar_fade_delay_ms && |
| 132 | scrollbar_fade_resize_delay_ms == |
| 133 | other.scrollbar_fade_resize_delay_ms && |
| 134 | scrollbar_fade_duration_ms == other.scrollbar_fade_duration_ms && |
| 135 | solid_color_scrollbar_color == other.solid_color_scrollbar_color && |
| 136 | timeout_and_draw_when_animation_checkerboards == |
| 137 | other.timeout_and_draw_when_animation_checkerboards && |
| 138 | layer_transforms_should_scale_layer_contents == |
| 139 | other.layer_transforms_should_scale_layer_contents && |
| 140 | layers_always_allowed_lcd_text == |
| 141 | other.layers_always_allowed_lcd_text && |
| 142 | minimum_contents_scale == other.minimum_contents_scale && |
| 143 | low_res_contents_scale_factor == other.low_res_contents_scale_factor && |
| 144 | top_controls_show_threshold == other.top_controls_show_threshold && |
| 145 | top_controls_hide_threshold == other.top_controls_hide_threshold && |
| 146 | background_animation_rate == other.background_animation_rate && |
| 147 | default_tile_size == other.default_tile_size && |
| 148 | max_untiled_layer_size == other.max_untiled_layer_size && |
| 149 | minimum_occlusion_tracking_size == |
| 150 | other.minimum_occlusion_tracking_size && |
| 151 | tiling_interest_area_padding == other.tiling_interest_area_padding && |
| 152 | skewport_target_time_in_seconds == |
| 153 | other.skewport_target_time_in_seconds && |
| 154 | skewport_extrapolation_limit_in_content_pixels == |
| 155 | other.skewport_extrapolation_limit_in_content_pixels && |
| 156 | max_memory_for_prepaint_percentage == |
| 157 | other.max_memory_for_prepaint_percentage && |
| 158 | strict_layer_property_change_checking == |
| 159 | other.strict_layer_property_change_checking && |
| 160 | use_zero_copy == other.use_zero_copy && |
| 161 | use_partial_raster == other.use_partial_raster && |
| 162 | enable_elastic_overscroll == other.enable_elastic_overscroll && |
| 163 | use_image_texture_targets == other.use_image_texture_targets && |
| 164 | ignore_root_layer_flings == other.ignore_root_layer_flings && |
| 165 | scheduled_raster_task_limit == other.scheduled_raster_task_limit && |
| 166 | use_occlusion_for_tile_prioritization == |
| 167 | other.use_occlusion_for_tile_prioritization && |
| 168 | verify_property_trees == other.verify_property_trees && |
| 169 | use_property_trees == other.use_property_trees && |
| 170 | image_decode_tasks_enabled == other.image_decode_tasks_enabled && |
| 171 | use_compositor_animation_timelines == |
| 172 | other.use_compositor_animation_timelines && |
| 173 | wait_for_beginframe_interval == other.wait_for_beginframe_interval && |
| 174 | max_staging_buffer_usage_in_bytes == |
| 175 | other.max_staging_buffer_usage_in_bytes && |
| 176 | memory_policy_ == other.memory_policy_ && |
| 177 | LayerTreeDebugState::Equal(initial_debug_state, |
| 178 | other.initial_debug_state); |
| 179 | } |
| 180 | |
| 181 | void LayerTreeSettings::ToProtobuf(proto::LayerTreeSettings* proto) const { |
| 182 | renderer_settings.ToProtobuf(proto->mutable_renderer_settings()); |
| 183 | proto->set_single_thread_proxy_scheduler(single_thread_proxy_scheduler); |
| 184 | proto->set_use_external_begin_frame_source(use_external_begin_frame_source); |
| 185 | proto->set_main_frame_before_activation_enabled( |
| 186 | main_frame_before_activation_enabled); |
| 187 | proto->set_using_synchronous_renderer_compositor( |
| 188 | using_synchronous_renderer_compositor); |
| 189 | proto->set_accelerated_animation_enabled(accelerated_animation_enabled); |
| 190 | proto->set_can_use_lcd_text(can_use_lcd_text); |
| 191 | proto->set_use_distance_field_text(use_distance_field_text); |
| 192 | proto->set_gpu_rasterization_enabled(gpu_rasterization_enabled); |
| 193 | proto->set_gpu_rasterization_forced(gpu_rasterization_forced); |
| 194 | proto->set_gpu_rasterization_msaa_sample_count( |
| 195 | gpu_rasterization_msaa_sample_count); |
| 196 | proto->set_create_low_res_tiling(create_low_res_tiling); |
| 197 | proto->set_scrollbar_animator( |
| 198 | LayerTreeSettingsScrollbarAnimatorToProto(scrollbar_animator)); |
| 199 | proto->set_scrollbar_fade_delay_ms(scrollbar_fade_delay_ms); |
| 200 | proto->set_scrollbar_fade_resize_delay_ms(scrollbar_fade_resize_delay_ms); |
| 201 | proto->set_scrollbar_fade_duration_ms(scrollbar_fade_duration_ms); |
| 202 | proto->set_solid_color_scrollbar_color(solid_color_scrollbar_color); |
| 203 | proto->set_timeout_and_draw_when_animation_checkerboards( |
| 204 | timeout_and_draw_when_animation_checkerboards); |
| 205 | proto->set_layer_transforms_should_scale_layer_contents( |
| 206 | layer_transforms_should_scale_layer_contents); |
| 207 | proto->set_layers_always_allowed_lcd_text(layers_always_allowed_lcd_text); |
| 208 | proto->set_minimum_contents_scale(minimum_contents_scale); |
| 209 | proto->set_low_res_contents_scale_factor(low_res_contents_scale_factor); |
| 210 | proto->set_top_controls_show_threshold(top_controls_show_threshold); |
| 211 | proto->set_top_controls_hide_threshold(top_controls_hide_threshold); |
| 212 | proto->set_background_animation_rate(background_animation_rate); |
| 213 | SizeToProto(default_tile_size, proto->mutable_default_tile_size()); |
| 214 | SizeToProto(max_untiled_layer_size, proto->mutable_max_untiled_layer_size()); |
| 215 | SizeToProto(minimum_occlusion_tracking_size, |
| 216 | proto->mutable_minimum_occlusion_tracking_size()); |
| 217 | proto->set_tiling_interest_area_padding(tiling_interest_area_padding); |
| 218 | proto->set_skewport_target_time_in_seconds(skewport_target_time_in_seconds); |
| 219 | proto->set_skewport_extrapolation_limit_in_content_pixels( |
| 220 | skewport_extrapolation_limit_in_content_pixels); |
| 221 | proto->set_max_memory_for_prepaint_percentage( |
| 222 | max_memory_for_prepaint_percentage); |
| 223 | proto->set_strict_layer_property_change_checking( |
| 224 | strict_layer_property_change_checking); |
| 225 | proto->set_use_zero_copy(use_zero_copy); |
| 226 | proto->set_use_partial_raster(use_partial_raster); |
| 227 | proto->set_enable_elastic_overscroll(enable_elastic_overscroll); |
| 228 | proto->set_ignore_root_layer_flings(ignore_root_layer_flings); |
| 229 | proto->set_scheduled_raster_task_limit(scheduled_raster_task_limit); |
| 230 | proto->set_use_occlusion_for_tile_prioritization( |
| 231 | use_occlusion_for_tile_prioritization); |
| 232 | proto->set_verify_property_trees(verify_property_trees); |
| 233 | proto->set_use_property_trees(use_property_trees); |
| 234 | proto->set_image_decode_tasks_enabled(image_decode_tasks_enabled); |
| 235 | proto->set_use_compositor_animation_timelines( |
| 236 | use_compositor_animation_timelines); |
| 237 | proto->set_wait_for_beginframe_interval(wait_for_beginframe_interval); |
| 238 | proto->set_max_staging_buffer_usage_in_bytes( |
| 239 | max_staging_buffer_usage_in_bytes); |
| 240 | memory_policy_.ToProtobuf(proto->mutable_memory_policy()); |
| 241 | initial_debug_state.ToProtobuf(proto->mutable_initial_debug_state()); |
| 242 | |
| 243 | for (unsigned u : use_image_texture_targets) |
| 244 | proto->add_use_image_texture_targets(u); |
| 245 | } |
| 246 | |
| 247 | void LayerTreeSettings::FromProtobuf(const proto::LayerTreeSettings& proto) { |
| 248 | renderer_settings.FromProtobuf(proto.renderer_settings()); |
| 249 | single_thread_proxy_scheduler = proto.single_thread_proxy_scheduler(); |
| 250 | use_external_begin_frame_source = proto.use_external_begin_frame_source(); |
| 251 | main_frame_before_activation_enabled = |
| 252 | proto.main_frame_before_activation_enabled(); |
| 253 | using_synchronous_renderer_compositor = |
| 254 | proto.using_synchronous_renderer_compositor(); |
| 255 | accelerated_animation_enabled = proto.accelerated_animation_enabled(); |
| 256 | can_use_lcd_text = proto.can_use_lcd_text(); |
| 257 | use_distance_field_text = proto.use_distance_field_text(); |
| 258 | gpu_rasterization_enabled = proto.gpu_rasterization_enabled(); |
| 259 | gpu_rasterization_forced = proto.gpu_rasterization_forced(); |
| 260 | gpu_rasterization_msaa_sample_count = |
| 261 | proto.gpu_rasterization_msaa_sample_count(); |
| 262 | create_low_res_tiling = proto.create_low_res_tiling(); |
| 263 | scrollbar_animator = |
| 264 | LayerTreeSettingsScrollbarAnimatorFromProto(proto.scrollbar_animator()); |
| 265 | scrollbar_fade_delay_ms = proto.scrollbar_fade_delay_ms(); |
| 266 | scrollbar_fade_resize_delay_ms = proto.scrollbar_fade_resize_delay_ms(); |
| 267 | scrollbar_fade_duration_ms = proto.scrollbar_fade_duration_ms(); |
| 268 | solid_color_scrollbar_color = proto.solid_color_scrollbar_color(); |
| 269 | timeout_and_draw_when_animation_checkerboards = |
| 270 | proto.timeout_and_draw_when_animation_checkerboards(); |
| 271 | layer_transforms_should_scale_layer_contents = |
| 272 | proto.layer_transforms_should_scale_layer_contents(); |
| 273 | layers_always_allowed_lcd_text = proto.layers_always_allowed_lcd_text(); |
| 274 | minimum_contents_scale = proto.minimum_contents_scale(); |
| 275 | low_res_contents_scale_factor = proto.low_res_contents_scale_factor(); |
| 276 | top_controls_show_threshold = proto.top_controls_show_threshold(); |
| 277 | top_controls_hide_threshold = proto.top_controls_hide_threshold(); |
| 278 | background_animation_rate = proto.background_animation_rate(); |
| 279 | default_tile_size = ProtoToSize(proto.default_tile_size()); |
| 280 | max_untiled_layer_size = ProtoToSize(proto.max_untiled_layer_size()); |
| 281 | minimum_occlusion_tracking_size = |
| 282 | ProtoToSize(proto.minimum_occlusion_tracking_size()); |
| 283 | tiling_interest_area_padding = proto.tiling_interest_area_padding(); |
| 284 | skewport_target_time_in_seconds = proto.skewport_target_time_in_seconds(); |
| 285 | skewport_extrapolation_limit_in_content_pixels = |
| 286 | proto.skewport_extrapolation_limit_in_content_pixels(); |
| 287 | max_memory_for_prepaint_percentage = |
| 288 | proto.max_memory_for_prepaint_percentage(); |
| 289 | strict_layer_property_change_checking = |
| 290 | proto.strict_layer_property_change_checking(); |
| 291 | use_zero_copy = proto.use_zero_copy(); |
| 292 | use_partial_raster = proto.use_partial_raster(); |
| 293 | enable_elastic_overscroll = proto.enable_elastic_overscroll(); |
| 294 | // |use_image_texture_targets| contains default values, so clear first. |
| 295 | use_image_texture_targets.clear(); |
| 296 | ignore_root_layer_flings = proto.ignore_root_layer_flings(); |
| 297 | scheduled_raster_task_limit = proto.scheduled_raster_task_limit(); |
| 298 | use_occlusion_for_tile_prioritization = |
| 299 | proto.use_occlusion_for_tile_prioritization(); |
| 300 | verify_property_trees = proto.verify_property_trees(); |
| 301 | use_property_trees = proto.use_property_trees(); |
| 302 | image_decode_tasks_enabled = proto.image_decode_tasks_enabled(); |
| 303 | use_compositor_animation_timelines = |
| 304 | proto.use_compositor_animation_timelines(); |
| 305 | wait_for_beginframe_interval = proto.wait_for_beginframe_interval(); |
| 306 | max_staging_buffer_usage_in_bytes = proto.max_staging_buffer_usage_in_bytes(); |
| 307 | memory_policy_.FromProtobuf(proto.memory_policy()); |
| 308 | initial_debug_state.FromProtobuf(proto.initial_debug_state()); |
| 309 | |
| 310 | for (int i = 0; i < proto.use_image_texture_targets_size(); ++i) |
| 311 | use_image_texture_targets.push_back(proto.use_image_texture_targets(i)); |
| 312 | } |
| 313 | |
jamesr | 6f64ab7 | 2015-03-18 20:29:03 | [diff] [blame] | 314 | SchedulerSettings LayerTreeSettings::ToSchedulerSettings() const { |
| 315 | SchedulerSettings scheduler_settings; |
| 316 | scheduler_settings.use_external_begin_frame_source = |
| 317 | use_external_begin_frame_source; |
| 318 | scheduler_settings.main_frame_before_activation_enabled = |
| 319 | main_frame_before_activation_enabled; |
jamesr | 6f64ab7 | 2015-03-18 20:29:03 | [diff] [blame] | 320 | scheduler_settings.timeout_and_draw_when_animation_checkerboards = |
| 321 | timeout_and_draw_when_animation_checkerboards; |
jamesr | 6f64ab7 | 2015-03-18 20:29:03 | [diff] [blame] | 322 | scheduler_settings.using_synchronous_renderer_compositor = |
| 323 | using_synchronous_renderer_compositor; |
jincheol.jo | 5899bd55 | 2015-07-15 02:06:46 | [diff] [blame] | 324 | scheduler_settings.throttle_frame_production = wait_for_beginframe_interval; |
jamesr | 6f64ab7 | 2015-03-18 20:29:03 | [diff] [blame] | 325 | scheduler_settings.background_frame_interval = |
| 326 | base::TimeDelta::FromSecondsD(1.0 / background_animation_rate); |
| 327 | return scheduler_settings; |
| 328 | } |
| 329 | |
[email protected] | ff762fb | 2012-12-12 19:18:37 | [diff] [blame] | 330 | } // namespace cc |