| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "blimp/client/feature/compositor/blimp_layer_tree_settings.h" | 5 #include "blimp/client/feature/compositor/blimp_layer_tree_settings.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 settings->gpu_rasterization_enabled = false; | 60 settings->gpu_rasterization_enabled = false; |
| 61 settings->using_synchronous_renderer_compositor = false; | 61 settings->using_synchronous_renderer_compositor = false; |
| 62 settings->scrollbar_animator = cc::LayerTreeSettings::LINEAR_FADE; | 62 settings->scrollbar_animator = cc::LayerTreeSettings::LINEAR_FADE; |
| 63 settings->scrollbar_fade_delay_ms = 300; | 63 settings->scrollbar_fade_delay_ms = 300; |
| 64 settings->scrollbar_fade_resize_delay_ms = 2000; | 64 settings->scrollbar_fade_resize_delay_ms = 2000; |
| 65 settings->scrollbar_fade_duration_ms = 300; | 65 settings->scrollbar_fade_duration_ms = 300; |
| 66 settings->solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128); | 66 settings->solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128); |
| 67 settings->renderer_settings.highp_threshold_min = 2048; | 67 settings->renderer_settings.highp_threshold_min = 2048; |
| 68 settings->ignore_root_layer_flings = false; | 68 settings->ignore_root_layer_flings = false; |
| 69 bool use_low_memory_policy = base::SysInfo::IsLowEndDevice(); | 69 bool use_low_memory_policy = base::SysInfo::IsLowEndDevice(); |
| 70 settings->renderer_settings.use_rgba_4444_textures = use_low_memory_policy; | |
| 71 if (use_low_memory_policy) { | 70 if (use_low_memory_policy) { |
| 72 // On low-end we want to be very carefull about killing other | 71 // On low-end we want to be very carefull about killing other |
| 73 // apps. So initially we use 50% more memory to avoid flickering | 72 // apps. So initially we use 50% more memory to avoid flickering |
| 74 // or raster-on-demand. | 73 // or raster-on-demand. |
| 75 settings->max_memory_for_prepaint_percentage = 67; | 74 settings->max_memory_for_prepaint_percentage = 67; |
| 75 |
| 76 settings->renderer_settings.preferred_tile_format = cc::RGBA_4444; |
| 76 } else { | 77 } else { |
| 77 // On other devices we have increased memory excessively to avoid | 78 // On other devices we have increased memory excessively to avoid |
| 78 // raster-on-demand already, so now we reserve 50% _only_ to avoid | 79 // raster-on-demand already, so now we reserve 50% _only_ to avoid |
| 79 // raster-on-demand, and use 50% of the memory otherwise. | 80 // raster-on-demand, and use 50% of the memory otherwise. |
| 80 settings->max_memory_for_prepaint_percentage = 50; | 81 settings->max_memory_for_prepaint_percentage = 50; |
| 81 } | 82 } |
| 82 settings->renderer_settings.should_clear_root_render_pass = true; | 83 settings->renderer_settings.should_clear_root_render_pass = true; |
| 83 | 84 |
| 84 // TODO(danakj): Only do this on low end devices. | 85 // TODO(danakj): Only do this on low end devices. |
| 85 settings->create_low_res_tiling = true; | 86 settings->create_low_res_tiling = true; |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 // Ignore what the system said and give all clients the same maximum | 171 // Ignore what the system said and give all clients the same maximum |
| 171 // allocation on desktop platforms. | 172 // allocation on desktop platforms. |
| 172 memory_policy.bytes_limit_when_visible = 512 * 1024 * 1024; | 173 memory_policy.bytes_limit_when_visible = 512 * 1024 * 1024; |
| 173 memory_policy.priority_cutoff_when_visible = | 174 memory_policy.priority_cutoff_when_visible = |
| 174 gpu::MemoryAllocation::CUTOFF_ALLOW_NICE_TO_HAVE; | 175 gpu::MemoryAllocation::CUTOFF_ALLOW_NICE_TO_HAVE; |
| 175 #endif | 176 #endif |
| 176 } | 177 } |
| 177 | 178 |
| 178 } // namespace client | 179 } // namespace client |
| 179 } // namespace blimp | 180 } // namespace blimp |
| OLD | NEW |