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 <GLES2/gl2.h> | 7 #include <GLES2/gl2.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <limits> | 9 #include <limits> |
10 | 10 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 low_res_contents_scale_factor(0.25f), | 79 low_res_contents_scale_factor(0.25f), |
80 top_controls_show_threshold(0.5f), | 80 top_controls_show_threshold(0.5f), |
81 top_controls_hide_threshold(0.5f), | 81 top_controls_hide_threshold(0.5f), |
82 background_animation_rate(1.0), | 82 background_animation_rate(1.0), |
83 default_tile_size(gfx::Size(256, 256)), | 83 default_tile_size(gfx::Size(256, 256)), |
84 max_untiled_layer_size(gfx::Size(512, 512)), | 84 max_untiled_layer_size(gfx::Size(512, 512)), |
85 minimum_occlusion_tracking_size(gfx::Size(160, 160)), | 85 minimum_occlusion_tracking_size(gfx::Size(160, 160)), |
86 // 3000 pixels should give sufficient area for prepainting. | 86 // 3000 pixels should give sufficient area for prepainting. |
87 tiling_interest_area_padding(3000), | 87 tiling_interest_area_padding(3000), |
88 skewport_target_time_in_seconds(1.0f), | 88 skewport_target_time_in_seconds(1.0f), |
89 skewport_extrapolation_limit_in_content_pixels(2000), | 89 skewport_extrapolation_limit_in_screen_pixels(2000), |
90 max_memory_for_prepaint_percentage(100), | 90 max_memory_for_prepaint_percentage(100), |
91 use_zero_copy(false), | 91 use_zero_copy(false), |
92 use_partial_raster(false), | 92 use_partial_raster(false), |
93 enable_elastic_overscroll(false), | 93 enable_elastic_overscroll(false), |
94 use_image_texture_targets( | 94 use_image_texture_targets( |
95 static_cast<size_t>(gfx::BufferFormat::LAST) + 1, | 95 static_cast<size_t>(gfx::BufferFormat::LAST) + 1, |
96 GL_TEXTURE_2D), | 96 GL_TEXTURE_2D), |
97 ignore_root_layer_flings(false), | 97 ignore_root_layer_flings(false), |
98 scheduled_raster_task_limit(32), | 98 scheduled_raster_task_limit(32), |
99 use_occlusion_for_tile_prioritization(false), | 99 use_occlusion_for_tile_prioritization(false), |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 top_controls_show_threshold == other.top_controls_show_threshold && | 145 top_controls_show_threshold == other.top_controls_show_threshold && |
146 top_controls_hide_threshold == other.top_controls_hide_threshold && | 146 top_controls_hide_threshold == other.top_controls_hide_threshold && |
147 background_animation_rate == other.background_animation_rate && | 147 background_animation_rate == other.background_animation_rate && |
148 default_tile_size == other.default_tile_size && | 148 default_tile_size == other.default_tile_size && |
149 max_untiled_layer_size == other.max_untiled_layer_size && | 149 max_untiled_layer_size == other.max_untiled_layer_size && |
150 minimum_occlusion_tracking_size == | 150 minimum_occlusion_tracking_size == |
151 other.minimum_occlusion_tracking_size && | 151 other.minimum_occlusion_tracking_size && |
152 tiling_interest_area_padding == other.tiling_interest_area_padding && | 152 tiling_interest_area_padding == other.tiling_interest_area_padding && |
153 skewport_target_time_in_seconds == | 153 skewport_target_time_in_seconds == |
154 other.skewport_target_time_in_seconds && | 154 other.skewport_target_time_in_seconds && |
155 skewport_extrapolation_limit_in_content_pixels == | 155 skewport_extrapolation_limit_in_screen_pixels == |
156 other.skewport_extrapolation_limit_in_content_pixels && | 156 other.skewport_extrapolation_limit_in_screen_pixels && |
157 max_memory_for_prepaint_percentage == | 157 max_memory_for_prepaint_percentage == |
158 other.max_memory_for_prepaint_percentage && | 158 other.max_memory_for_prepaint_percentage && |
159 use_zero_copy == other.use_zero_copy && | 159 use_zero_copy == other.use_zero_copy && |
160 use_partial_raster == other.use_partial_raster && | 160 use_partial_raster == other.use_partial_raster && |
161 enable_elastic_overscroll == other.enable_elastic_overscroll && | 161 enable_elastic_overscroll == other.enable_elastic_overscroll && |
162 use_image_texture_targets == other.use_image_texture_targets && | 162 use_image_texture_targets == other.use_image_texture_targets && |
163 ignore_root_layer_flings == other.ignore_root_layer_flings && | 163 ignore_root_layer_flings == other.ignore_root_layer_flings && |
164 scheduled_raster_task_limit == other.scheduled_raster_task_limit && | 164 scheduled_raster_task_limit == other.scheduled_raster_task_limit && |
165 use_occlusion_for_tile_prioritization == | 165 use_occlusion_for_tile_prioritization == |
166 other.use_occlusion_for_tile_prioritization && | 166 other.use_occlusion_for_tile_prioritization && |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 proto->set_low_res_contents_scale_factor(low_res_contents_scale_factor); | 205 proto->set_low_res_contents_scale_factor(low_res_contents_scale_factor); |
206 proto->set_top_controls_show_threshold(top_controls_show_threshold); | 206 proto->set_top_controls_show_threshold(top_controls_show_threshold); |
207 proto->set_top_controls_hide_threshold(top_controls_hide_threshold); | 207 proto->set_top_controls_hide_threshold(top_controls_hide_threshold); |
208 proto->set_background_animation_rate(background_animation_rate); | 208 proto->set_background_animation_rate(background_animation_rate); |
209 SizeToProto(default_tile_size, proto->mutable_default_tile_size()); | 209 SizeToProto(default_tile_size, proto->mutable_default_tile_size()); |
210 SizeToProto(max_untiled_layer_size, proto->mutable_max_untiled_layer_size()); | 210 SizeToProto(max_untiled_layer_size, proto->mutable_max_untiled_layer_size()); |
211 SizeToProto(minimum_occlusion_tracking_size, | 211 SizeToProto(minimum_occlusion_tracking_size, |
212 proto->mutable_minimum_occlusion_tracking_size()); | 212 proto->mutable_minimum_occlusion_tracking_size()); |
213 proto->set_tiling_interest_area_padding(tiling_interest_area_padding); | 213 proto->set_tiling_interest_area_padding(tiling_interest_area_padding); |
214 proto->set_skewport_target_time_in_seconds(skewport_target_time_in_seconds); | 214 proto->set_skewport_target_time_in_seconds(skewport_target_time_in_seconds); |
215 proto->set_skewport_extrapolation_limit_in_content_pixels( | 215 proto->set_skewport_extrapolation_limit_in_screen_pixels( |
216 skewport_extrapolation_limit_in_content_pixels); | 216 skewport_extrapolation_limit_in_screen_pixels); |
217 proto->set_max_memory_for_prepaint_percentage( | 217 proto->set_max_memory_for_prepaint_percentage( |
218 max_memory_for_prepaint_percentage); | 218 max_memory_for_prepaint_percentage); |
219 proto->set_use_zero_copy(use_zero_copy); | 219 proto->set_use_zero_copy(use_zero_copy); |
220 proto->set_use_partial_raster(use_partial_raster); | 220 proto->set_use_partial_raster(use_partial_raster); |
221 proto->set_enable_elastic_overscroll(enable_elastic_overscroll); | 221 proto->set_enable_elastic_overscroll(enable_elastic_overscroll); |
222 proto->set_ignore_root_layer_flings(ignore_root_layer_flings); | 222 proto->set_ignore_root_layer_flings(ignore_root_layer_flings); |
223 proto->set_scheduled_raster_task_limit(scheduled_raster_task_limit); | 223 proto->set_scheduled_raster_task_limit(scheduled_raster_task_limit); |
224 proto->set_use_occlusion_for_tile_prioritization( | 224 proto->set_use_occlusion_for_tile_prioritization( |
225 use_occlusion_for_tile_prioritization); | 225 use_occlusion_for_tile_prioritization); |
226 proto->set_image_decode_tasks_enabled(image_decode_tasks_enabled); | 226 proto->set_image_decode_tasks_enabled(image_decode_tasks_enabled); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 low_res_contents_scale_factor = proto.low_res_contents_scale_factor(); | 266 low_res_contents_scale_factor = proto.low_res_contents_scale_factor(); |
267 top_controls_show_threshold = proto.top_controls_show_threshold(); | 267 top_controls_show_threshold = proto.top_controls_show_threshold(); |
268 top_controls_hide_threshold = proto.top_controls_hide_threshold(); | 268 top_controls_hide_threshold = proto.top_controls_hide_threshold(); |
269 background_animation_rate = proto.background_animation_rate(); | 269 background_animation_rate = proto.background_animation_rate(); |
270 default_tile_size = ProtoToSize(proto.default_tile_size()); | 270 default_tile_size = ProtoToSize(proto.default_tile_size()); |
271 max_untiled_layer_size = ProtoToSize(proto.max_untiled_layer_size()); | 271 max_untiled_layer_size = ProtoToSize(proto.max_untiled_layer_size()); |
272 minimum_occlusion_tracking_size = | 272 minimum_occlusion_tracking_size = |
273 ProtoToSize(proto.minimum_occlusion_tracking_size()); | 273 ProtoToSize(proto.minimum_occlusion_tracking_size()); |
274 tiling_interest_area_padding = proto.tiling_interest_area_padding(); | 274 tiling_interest_area_padding = proto.tiling_interest_area_padding(); |
275 skewport_target_time_in_seconds = proto.skewport_target_time_in_seconds(); | 275 skewport_target_time_in_seconds = proto.skewport_target_time_in_seconds(); |
276 skewport_extrapolation_limit_in_content_pixels = | 276 skewport_extrapolation_limit_in_screen_pixels = |
277 proto.skewport_extrapolation_limit_in_content_pixels(); | 277 proto.skewport_extrapolation_limit_in_screen_pixels(); |
278 max_memory_for_prepaint_percentage = | 278 max_memory_for_prepaint_percentage = |
279 proto.max_memory_for_prepaint_percentage(); | 279 proto.max_memory_for_prepaint_percentage(); |
280 use_zero_copy = proto.use_zero_copy(); | 280 use_zero_copy = proto.use_zero_copy(); |
281 use_partial_raster = proto.use_partial_raster(); | 281 use_partial_raster = proto.use_partial_raster(); |
282 enable_elastic_overscroll = proto.enable_elastic_overscroll(); | 282 enable_elastic_overscroll = proto.enable_elastic_overscroll(); |
283 // |use_image_texture_targets| contains default values, so clear first. | 283 // |use_image_texture_targets| contains default values, so clear first. |
284 use_image_texture_targets.clear(); | 284 use_image_texture_targets.clear(); |
285 ignore_root_layer_flings = proto.ignore_root_layer_flings(); | 285 ignore_root_layer_flings = proto.ignore_root_layer_flings(); |
286 scheduled_raster_task_limit = proto.scheduled_raster_task_limit(); | 286 scheduled_raster_task_limit = proto.scheduled_raster_task_limit(); |
287 use_occlusion_for_tile_prioritization = | 287 use_occlusion_for_tile_prioritization = |
(...skipping 22 matching lines...) Expand all Loading... |
310 using_synchronous_renderer_compositor; | 310 using_synchronous_renderer_compositor; |
311 scheduler_settings.throttle_frame_production = wait_for_beginframe_interval; | 311 scheduler_settings.throttle_frame_production = wait_for_beginframe_interval; |
312 scheduler_settings.background_frame_interval = | 312 scheduler_settings.background_frame_interval = |
313 base::TimeDelta::FromSecondsD(1.0 / background_animation_rate); | 313 base::TimeDelta::FromSecondsD(1.0 / background_animation_rate); |
314 scheduler_settings.abort_commit_before_output_surface_creation = | 314 scheduler_settings.abort_commit_before_output_surface_creation = |
315 abort_commit_before_output_surface_creation; | 315 abort_commit_before_output_surface_creation; |
316 return scheduler_settings; | 316 return scheduler_settings; |
317 } | 317 } |
318 | 318 |
319 } // namespace cc | 319 } // namespace cc |
OLD | NEW |