Chromium Code Reviews| 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 "third_party/khronos/GLES2/gl2.h" | 8 #include "third_party/khronos/GLES2/gl2.h" |
| 9 | 9 |
| 10 namespace cc { | 10 namespace cc { |
| 11 | 11 |
| 12 LayerTreeSettings::LayerTreeSettings() | 12 LayerTreeSettings::LayerTreeSettings() |
| 13 : default_tile_size(gfx::Size(256, 256)), | 13 : default_tile_size(gfx::Size(256, 256)), |
| 14 max_untiled_layer_size(gfx::Size(512, 512)), | 14 max_untiled_layer_size(gfx::Size(512, 512)), |
| 15 minimum_occlusion_tracking_size(gfx::Size(160, 160)), | 15 minimum_occlusion_tracking_size(gfx::Size(160, 160)), |
| 16 memory_policy_(64 * 1024 * 1024, | 16 gpu_memory_policy(64 * 1024 * 1024, |
| 17 gpu::MemoryAllocation::CUTOFF_ALLOW_EVERYTHING, | 17 gpu::MemoryAllocation::CUTOFF_ALLOW_EVERYTHING, |
| 18 ManagedMemoryPolicy::kDefaultNumResourcesLimit) {} | 18 ManagedMemoryPolicy::kDefaultNumResourcesLimit), |
| 19 // These limits inherited from CompositorOutputSurface without | |
|
enne (OOO)
2016/09/09 22:46:16
I don't know that this comment makes sense given t
danakj
2016/09/09 22:55:43
ok it was more for blame breadcrumbs but if u dont
| |
| 20 // explanation. | |
| 21 software_memory_policy(128 * 1024 * 1024, | |
| 22 gpu::MemoryAllocation::CUTOFF_ALLOW_NICE_TO_HAVE, | |
| 23 ManagedMemoryPolicy::kDefaultNumResourcesLimit) {} | |
| 19 | 24 |
| 20 LayerTreeSettings::LayerTreeSettings(const LayerTreeSettings& other) = default; | 25 LayerTreeSettings::LayerTreeSettings(const LayerTreeSettings& other) = default; |
| 21 LayerTreeSettings::~LayerTreeSettings() = default; | 26 LayerTreeSettings::~LayerTreeSettings() = default; |
| 22 | 27 |
| 23 bool LayerTreeSettings::operator==(const LayerTreeSettings& other) const { | 28 bool LayerTreeSettings::operator==(const LayerTreeSettings& other) const { |
| 24 return renderer_settings == other.renderer_settings && | 29 return renderer_settings == other.renderer_settings && |
| 25 single_thread_proxy_scheduler == other.single_thread_proxy_scheduler && | 30 single_thread_proxy_scheduler == other.single_thread_proxy_scheduler && |
| 26 use_external_begin_frame_source == | 31 use_external_begin_frame_source == |
| 27 other.use_external_begin_frame_source && | 32 other.use_external_begin_frame_source && |
| 28 main_frame_before_activation_enabled == | 33 main_frame_before_activation_enabled == |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 72 scheduled_raster_task_limit == other.scheduled_raster_task_limit && | 77 scheduled_raster_task_limit == other.scheduled_raster_task_limit && |
| 73 use_occlusion_for_tile_prioritization == | 78 use_occlusion_for_tile_prioritization == |
| 74 other.use_occlusion_for_tile_prioritization && | 79 other.use_occlusion_for_tile_prioritization && |
| 75 verify_clip_tree_calculations == other.verify_clip_tree_calculations && | 80 verify_clip_tree_calculations == other.verify_clip_tree_calculations && |
| 76 verify_transform_tree_calculations == | 81 verify_transform_tree_calculations == |
| 77 other.verify_transform_tree_calculations && | 82 other.verify_transform_tree_calculations && |
| 78 image_decode_tasks_enabled == other.image_decode_tasks_enabled && | 83 image_decode_tasks_enabled == other.image_decode_tasks_enabled && |
| 79 wait_for_beginframe_interval == other.wait_for_beginframe_interval && | 84 wait_for_beginframe_interval == other.wait_for_beginframe_interval && |
| 80 max_staging_buffer_usage_in_bytes == | 85 max_staging_buffer_usage_in_bytes == |
| 81 other.max_staging_buffer_usage_in_bytes && | 86 other.max_staging_buffer_usage_in_bytes && |
| 82 memory_policy_ == other.memory_policy_ && | 87 gpu_memory_policy == other.gpu_memory_policy && |
| 88 software_memory_policy == other.software_memory_policy && | |
| 83 LayerTreeDebugState::Equal(initial_debug_state, | 89 LayerTreeDebugState::Equal(initial_debug_state, |
| 84 other.initial_debug_state) && | 90 other.initial_debug_state) && |
| 85 use_cached_picture_raster == other.use_cached_picture_raster; | 91 use_cached_picture_raster == other.use_cached_picture_raster; |
| 86 } | 92 } |
| 87 | 93 |
| 88 SchedulerSettings LayerTreeSettings::ToSchedulerSettings() const { | 94 SchedulerSettings LayerTreeSettings::ToSchedulerSettings() const { |
| 89 SchedulerSettings scheduler_settings; | 95 SchedulerSettings scheduler_settings; |
| 90 scheduler_settings.use_external_begin_frame_source = | 96 scheduler_settings.use_external_begin_frame_source = |
| 91 use_external_begin_frame_source; | 97 use_external_begin_frame_source; |
| 92 scheduler_settings.main_frame_before_activation_enabled = | 98 scheduler_settings.main_frame_before_activation_enabled = |
| 93 main_frame_before_activation_enabled; | 99 main_frame_before_activation_enabled; |
| 94 scheduler_settings.timeout_and_draw_when_animation_checkerboards = | 100 scheduler_settings.timeout_and_draw_when_animation_checkerboards = |
| 95 timeout_and_draw_when_animation_checkerboards; | 101 timeout_and_draw_when_animation_checkerboards; |
| 96 scheduler_settings.using_synchronous_renderer_compositor = | 102 scheduler_settings.using_synchronous_renderer_compositor = |
| 97 using_synchronous_renderer_compositor; | 103 using_synchronous_renderer_compositor; |
| 98 scheduler_settings.throttle_frame_production = wait_for_beginframe_interval; | 104 scheduler_settings.throttle_frame_production = wait_for_beginframe_interval; |
| 99 scheduler_settings.background_frame_interval = | 105 scheduler_settings.background_frame_interval = |
| 100 base::TimeDelta::FromSecondsD(1.0 / background_animation_rate); | 106 base::TimeDelta::FromSecondsD(1.0 / background_animation_rate); |
| 101 scheduler_settings.abort_commit_before_output_surface_creation = | 107 scheduler_settings.abort_commit_before_output_surface_creation = |
| 102 abort_commit_before_output_surface_creation; | 108 abort_commit_before_output_surface_creation; |
| 103 return scheduler_settings; | 109 return scheduler_settings; |
| 104 } | 110 } |
| 105 | 111 |
| 106 } // namespace cc | 112 } // namespace cc |
| OLD | NEW |