| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 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 | 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/trees/layer_tree_settings.h" | 5 #include "cc/trees/layer_tree_settings.h" |
| 6 | 6 |
| 7 #include "cc/proto/gfx_conversions.h" | 7 #include "cc/proto/gfx_conversions.h" |
| 8 #include "cc/proto/layer_tree_settings.pb.h" | 8 #include "cc/proto/layer_tree_settings.pb.h" |
| 9 #include "third_party/khronos/GLES2/gl2.h" | 9 #include "third_party/khronos/GLES2/gl2.h" |
| 10 | 10 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 case proto::LayerTreeSettings_ScrollbarAnimator_UNKNOWN: | 40 case proto::LayerTreeSettings_ScrollbarAnimator_UNKNOWN: |
| 41 NOTREACHED() << "proto::LayerTreeSettings_ScrollbarAnimator_UNKNOWN"; | 41 NOTREACHED() << "proto::LayerTreeSettings_ScrollbarAnimator_UNKNOWN"; |
| 42 return LayerTreeSettings::ScrollbarAnimator::NO_ANIMATOR; | 42 return LayerTreeSettings::ScrollbarAnimator::NO_ANIMATOR; |
| 43 } | 43 } |
| 44 return LayerTreeSettings::ScrollbarAnimator::NO_ANIMATOR; | 44 return LayerTreeSettings::ScrollbarAnimator::NO_ANIMATOR; |
| 45 } | 45 } |
| 46 | 46 |
| 47 } // namespace | 47 } // namespace |
| 48 | 48 |
| 49 LayerTreeSettings::LayerTreeSettings() | 49 LayerTreeSettings::LayerTreeSettings() |
| 50 : default_tile_size(gfx::Size(256, 256)), | 50 : minimum_occlusion_tracking_size(gfx::Size(160, 160)), |
| 51 max_untiled_layer_size(gfx::Size(512, 512)), | |
| 52 minimum_occlusion_tracking_size(gfx::Size(160, 160)), | |
| 53 use_image_texture_targets( | 51 use_image_texture_targets( |
| 54 static_cast<size_t>(gfx::BufferFormat::LAST) + 1, | 52 static_cast<size_t>(gfx::BufferFormat::LAST) + 1, |
| 55 GL_TEXTURE_2D), | 53 GL_TEXTURE_2D), |
| 56 memory_policy_(64 * 1024 * 1024, | 54 memory_policy_(64 * 1024 * 1024, |
| 57 gpu::MemoryAllocation::CUTOFF_ALLOW_EVERYTHING, | 55 gpu::MemoryAllocation::CUTOFF_ALLOW_EVERYTHING, |
| 58 ManagedMemoryPolicy::kDefaultNumResourcesLimit) {} | 56 ManagedMemoryPolicy::kDefaultNumResourcesLimit) {} |
| 59 | 57 |
| 60 LayerTreeSettings::LayerTreeSettings(const LayerTreeSettings& other) = default; | 58 LayerTreeSettings::LayerTreeSettings(const LayerTreeSettings& other) = default; |
| 61 LayerTreeSettings::~LayerTreeSettings() = default; | 59 LayerTreeSettings::~LayerTreeSettings() = default; |
| 62 | 60 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 87 other.timeout_and_draw_when_animation_checkerboards && | 85 other.timeout_and_draw_when_animation_checkerboards && |
| 88 layer_transforms_should_scale_layer_contents == | 86 layer_transforms_should_scale_layer_contents == |
| 89 other.layer_transforms_should_scale_layer_contents && | 87 other.layer_transforms_should_scale_layer_contents && |
| 90 layers_always_allowed_lcd_text == | 88 layers_always_allowed_lcd_text == |
| 91 other.layers_always_allowed_lcd_text && | 89 other.layers_always_allowed_lcd_text && |
| 92 minimum_contents_scale == other.minimum_contents_scale && | 90 minimum_contents_scale == other.minimum_contents_scale && |
| 93 low_res_contents_scale_factor == other.low_res_contents_scale_factor && | 91 low_res_contents_scale_factor == other.low_res_contents_scale_factor && |
| 94 top_controls_show_threshold == other.top_controls_show_threshold && | 92 top_controls_show_threshold == other.top_controls_show_threshold && |
| 95 top_controls_hide_threshold == other.top_controls_hide_threshold && | 93 top_controls_hide_threshold == other.top_controls_hide_threshold && |
| 96 background_animation_rate == other.background_animation_rate && | 94 background_animation_rate == other.background_animation_rate && |
| 97 default_tile_size == other.default_tile_size && | 95 use_viewport_for_tile_size == other.use_viewport_for_tile_size && |
| 98 max_untiled_layer_size == other.max_untiled_layer_size && | |
| 99 minimum_occlusion_tracking_size == | 96 minimum_occlusion_tracking_size == |
| 100 other.minimum_occlusion_tracking_size && | 97 other.minimum_occlusion_tracking_size && |
| 101 tiling_interest_area_padding == other.tiling_interest_area_padding && | 98 tiling_interest_area_padding == other.tiling_interest_area_padding && |
| 102 skewport_target_time_in_seconds == | 99 skewport_target_time_in_seconds == |
| 103 other.skewport_target_time_in_seconds && | 100 other.skewport_target_time_in_seconds && |
| 104 skewport_extrapolation_limit_in_screen_pixels == | 101 skewport_extrapolation_limit_in_screen_pixels == |
| 105 other.skewport_extrapolation_limit_in_screen_pixels && | 102 other.skewport_extrapolation_limit_in_screen_pixels && |
| 106 max_memory_for_prepaint_percentage == | 103 max_memory_for_prepaint_percentage == |
| 107 other.max_memory_for_prepaint_percentage && | 104 other.max_memory_for_prepaint_percentage && |
| 108 use_zero_copy == other.use_zero_copy && | 105 use_zero_copy == other.use_zero_copy && |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 proto->set_timeout_and_draw_when_animation_checkerboards( | 146 proto->set_timeout_and_draw_when_animation_checkerboards( |
| 150 timeout_and_draw_when_animation_checkerboards); | 147 timeout_and_draw_when_animation_checkerboards); |
| 151 proto->set_layer_transforms_should_scale_layer_contents( | 148 proto->set_layer_transforms_should_scale_layer_contents( |
| 152 layer_transforms_should_scale_layer_contents); | 149 layer_transforms_should_scale_layer_contents); |
| 153 proto->set_layers_always_allowed_lcd_text(layers_always_allowed_lcd_text); | 150 proto->set_layers_always_allowed_lcd_text(layers_always_allowed_lcd_text); |
| 154 proto->set_minimum_contents_scale(minimum_contents_scale); | 151 proto->set_minimum_contents_scale(minimum_contents_scale); |
| 155 proto->set_low_res_contents_scale_factor(low_res_contents_scale_factor); | 152 proto->set_low_res_contents_scale_factor(low_res_contents_scale_factor); |
| 156 proto->set_top_controls_show_threshold(top_controls_show_threshold); | 153 proto->set_top_controls_show_threshold(top_controls_show_threshold); |
| 157 proto->set_top_controls_hide_threshold(top_controls_hide_threshold); | 154 proto->set_top_controls_hide_threshold(top_controls_hide_threshold); |
| 158 proto->set_background_animation_rate(background_animation_rate); | 155 proto->set_background_animation_rate(background_animation_rate); |
| 159 SizeToProto(default_tile_size, proto->mutable_default_tile_size()); | 156 proto->set_use_viewport_for_tile_size(use_viewport_for_tile_size); |
| 160 SizeToProto(max_untiled_layer_size, proto->mutable_max_untiled_layer_size()); | |
| 161 SizeToProto(minimum_occlusion_tracking_size, | 157 SizeToProto(minimum_occlusion_tracking_size, |
| 162 proto->mutable_minimum_occlusion_tracking_size()); | 158 proto->mutable_minimum_occlusion_tracking_size()); |
| 163 proto->set_tiling_interest_area_padding(tiling_interest_area_padding); | 159 proto->set_tiling_interest_area_padding(tiling_interest_area_padding); |
| 164 proto->set_skewport_target_time_in_seconds(skewport_target_time_in_seconds); | 160 proto->set_skewport_target_time_in_seconds(skewport_target_time_in_seconds); |
| 165 proto->set_skewport_extrapolation_limit_in_screen_pixels( | 161 proto->set_skewport_extrapolation_limit_in_screen_pixels( |
| 166 skewport_extrapolation_limit_in_screen_pixels); | 162 skewport_extrapolation_limit_in_screen_pixels); |
| 167 proto->set_max_memory_for_prepaint_percentage( | 163 proto->set_max_memory_for_prepaint_percentage( |
| 168 max_memory_for_prepaint_percentage); | 164 max_memory_for_prepaint_percentage); |
| 169 proto->set_use_zero_copy(use_zero_copy); | 165 proto->set_use_zero_copy(use_zero_copy); |
| 170 proto->set_use_partial_raster(use_partial_raster); | 166 proto->set_use_partial_raster(use_partial_raster); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 timeout_and_draw_when_animation_checkerboards = | 206 timeout_and_draw_when_animation_checkerboards = |
| 211 proto.timeout_and_draw_when_animation_checkerboards(); | 207 proto.timeout_and_draw_when_animation_checkerboards(); |
| 212 layer_transforms_should_scale_layer_contents = | 208 layer_transforms_should_scale_layer_contents = |
| 213 proto.layer_transforms_should_scale_layer_contents(); | 209 proto.layer_transforms_should_scale_layer_contents(); |
| 214 layers_always_allowed_lcd_text = proto.layers_always_allowed_lcd_text(); | 210 layers_always_allowed_lcd_text = proto.layers_always_allowed_lcd_text(); |
| 215 minimum_contents_scale = proto.minimum_contents_scale(); | 211 minimum_contents_scale = proto.minimum_contents_scale(); |
| 216 low_res_contents_scale_factor = proto.low_res_contents_scale_factor(); | 212 low_res_contents_scale_factor = proto.low_res_contents_scale_factor(); |
| 217 top_controls_show_threshold = proto.top_controls_show_threshold(); | 213 top_controls_show_threshold = proto.top_controls_show_threshold(); |
| 218 top_controls_hide_threshold = proto.top_controls_hide_threshold(); | 214 top_controls_hide_threshold = proto.top_controls_hide_threshold(); |
| 219 background_animation_rate = proto.background_animation_rate(); | 215 background_animation_rate = proto.background_animation_rate(); |
| 220 default_tile_size = ProtoToSize(proto.default_tile_size()); | 216 use_viewport_for_tile_size = proto.use_viewport_for_tile_size(); |
| 221 max_untiled_layer_size = ProtoToSize(proto.max_untiled_layer_size()); | |
| 222 minimum_occlusion_tracking_size = | 217 minimum_occlusion_tracking_size = |
| 223 ProtoToSize(proto.minimum_occlusion_tracking_size()); | 218 ProtoToSize(proto.minimum_occlusion_tracking_size()); |
| 224 tiling_interest_area_padding = proto.tiling_interest_area_padding(); | 219 tiling_interest_area_padding = proto.tiling_interest_area_padding(); |
| 225 skewport_target_time_in_seconds = proto.skewport_target_time_in_seconds(); | 220 skewport_target_time_in_seconds = proto.skewport_target_time_in_seconds(); |
| 226 skewport_extrapolation_limit_in_screen_pixels = | 221 skewport_extrapolation_limit_in_screen_pixels = |
| 227 proto.skewport_extrapolation_limit_in_screen_pixels(); | 222 proto.skewport_extrapolation_limit_in_screen_pixels(); |
| 228 max_memory_for_prepaint_percentage = | 223 max_memory_for_prepaint_percentage = |
| 229 proto.max_memory_for_prepaint_percentage(); | 224 proto.max_memory_for_prepaint_percentage(); |
| 230 use_zero_copy = proto.use_zero_copy(); | 225 use_zero_copy = proto.use_zero_copy(); |
| 231 use_partial_raster = proto.use_partial_raster(); | 226 use_partial_raster = proto.use_partial_raster(); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 259 using_synchronous_renderer_compositor; | 254 using_synchronous_renderer_compositor; |
| 260 scheduler_settings.throttle_frame_production = wait_for_beginframe_interval; | 255 scheduler_settings.throttle_frame_production = wait_for_beginframe_interval; |
| 261 scheduler_settings.background_frame_interval = | 256 scheduler_settings.background_frame_interval = |
| 262 base::TimeDelta::FromSecondsD(1.0 / background_animation_rate); | 257 base::TimeDelta::FromSecondsD(1.0 / background_animation_rate); |
| 263 scheduler_settings.abort_commit_before_output_surface_creation = | 258 scheduler_settings.abort_commit_before_output_surface_creation = |
| 264 abort_commit_before_output_surface_creation; | 259 abort_commit_before_output_surface_creation; |
| 265 return scheduler_settings; | 260 return scheduler_settings; |
| 266 } | 261 } |
| 267 | 262 |
| 268 } // namespace cc | 263 } // namespace cc |
| OLD | NEW |