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/compositor/blimp_layer_tree_settings.h" | 5 #include "blimp/client/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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 settings->gpu_rasterization_enabled = false; | 59 settings->gpu_rasterization_enabled = false; |
60 settings->using_synchronous_renderer_compositor = false; | 60 settings->using_synchronous_renderer_compositor = false; |
61 settings->scrollbar_animator = cc::LayerTreeSettings::LINEAR_FADE; | 61 settings->scrollbar_animator = cc::LayerTreeSettings::LINEAR_FADE; |
62 settings->scrollbar_fade_delay_ms = 300; | 62 settings->scrollbar_fade_delay_ms = 300; |
63 settings->scrollbar_fade_resize_delay_ms = 2000; | 63 settings->scrollbar_fade_resize_delay_ms = 2000; |
64 settings->scrollbar_fade_duration_ms = 300; | 64 settings->scrollbar_fade_duration_ms = 300; |
65 settings->solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128); | 65 settings->solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128); |
66 settings->renderer_settings.highp_threshold_min = 2048; | 66 settings->renderer_settings.highp_threshold_min = 2048; |
67 settings->ignore_root_layer_flings = false; | 67 settings->ignore_root_layer_flings = false; |
68 bool use_low_memory_policy = base::SysInfo::IsLowEndDevice(); | 68 bool use_low_memory_policy = base::SysInfo::IsLowEndDevice(); |
69 settings->renderer_settings.use_rgba_4444_textures = use_low_memory_policy; | |
70 if (use_low_memory_policy) { | 69 if (use_low_memory_policy) { |
71 // On low-end we want to be very carefull about killing other | 70 // On low-end we want to be very carefull about killing other |
72 // apps. So initially we use 50% more memory to avoid flickering | 71 // apps. So initially we use 50% more memory to avoid flickering |
73 // or raster-on-demand. | 72 // or raster-on-demand. |
74 settings->max_memory_for_prepaint_percentage = 67; | 73 settings->max_memory_for_prepaint_percentage = 67; |
| 74 |
| 75 settings->renderer_settings.preferred_tile_format = cc::RGBA_4444; |
75 } else { | 76 } else { |
76 // On other devices we have increased memory excessively to avoid | 77 // On other devices we have increased memory excessively to avoid |
77 // raster-on-demand already, so now we reserve 50% _only_ to avoid | 78 // raster-on-demand already, so now we reserve 50% _only_ to avoid |
78 // raster-on-demand, and use 50% of the memory otherwise. | 79 // raster-on-demand, and use 50% of the memory otherwise. |
79 settings->max_memory_for_prepaint_percentage = 50; | 80 settings->max_memory_for_prepaint_percentage = 50; |
80 } | 81 } |
81 settings->renderer_settings.should_clear_root_render_pass = true; | 82 settings->renderer_settings.should_clear_root_render_pass = true; |
82 | 83 |
83 // TODO(danakj): Only do this on low end devices. | 84 // TODO(danakj): Only do this on low end devices. |
84 settings->create_low_res_tiling = true; | 85 settings->create_low_res_tiling = true; |
(...skipping 14 matching lines...) Expand all Loading... |
99 // show the pinch scrollbars when at minimum scale. | 100 // show the pinch scrollbars when at minimum scale. |
100 // TODO(dtrainor): Update this since https://crrev.com/1267603004 landed. | 101 // TODO(dtrainor): Update this since https://crrev.com/1267603004 landed. |
101 // settings->scrollbar_show_scale_threshold = 1.05f; | 102 // settings->scrollbar_show_scale_threshold = 1.05f; |
102 #endif | 103 #endif |
103 | 104 |
104 // Blimp always uses new cc::AnimationHost system. | 105 // Blimp always uses new cc::AnimationHost system. |
105 settings->use_compositor_animation_timelines = true; | 106 settings->use_compositor_animation_timelines = true; |
106 } | 107 } |
107 | 108 |
108 } // namespace blimp | 109 } // namespace blimp |
OLD | NEW |