Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(867)

Side by Side Diff: blimp/client/support/compositor/blimp_layer_tree_settings.cc

Issue 2421913002: Change Aura overlay scrollbars from solid color to painted scrollbars. (Closed)
Patch Set: Rebase Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | cc/layers/scrollbar_layer_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/support/compositor/blimp_layer_tree_settings.h" 5 #include "blimp/client/support/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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 settings->initial_debug_state.show_property_changed_rects = false; 54 settings->initial_debug_state.show_property_changed_rects = false;
55 settings->initial_debug_state.show_surface_damage_rects = false; 55 settings->initial_debug_state.show_surface_damage_rects = false;
56 settings->initial_debug_state.show_screen_space_rects = false; 56 settings->initial_debug_state.show_screen_space_rects = false;
57 settings->initial_debug_state.SetRecordRenderingStats(false); 57 settings->initial_debug_state.SetRecordRenderingStats(false);
58 58
59 #if defined(OS_ANDROID) 59 #if defined(OS_ANDROID)
60 if (base::SysInfo::IsLowEndDevice()) 60 if (base::SysInfo::IsLowEndDevice())
61 settings->gpu_rasterization_enabled = false; 61 settings->gpu_rasterization_enabled = false;
62 settings->using_synchronous_renderer_compositor = false; 62 settings->using_synchronous_renderer_compositor = false;
63 settings->scrollbar_animator = cc::LayerTreeSettings::LINEAR_FADE; 63 settings->scrollbar_animator = cc::LayerTreeSettings::LINEAR_FADE;
64 settings->scrollbar_fade_delay_ms = 300; 64 settings->scrollbar_fade_delay = base::TimeDelta::FromMilliseconds(300);
65 settings->scrollbar_fade_resize_delay_ms = 2000; 65 settings->scrollbar_fade_resize_delay = base::TimeDelta::FromSeconds(2);
66 settings->scrollbar_fade_duration_ms = 300; 66 settings->scrollbar_fade_duration = base::TimeDelta::FromMilliseconds(300);
67 settings->solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128); 67 settings->solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128);
68 settings->renderer_settings.highp_threshold_min = 2048; 68 settings->renderer_settings.highp_threshold_min = 2048;
69 settings->ignore_root_layer_flings = false; 69 settings->ignore_root_layer_flings = false;
70 bool use_low_memory_policy = base::SysInfo::IsLowEndDevice(); 70 bool use_low_memory_policy = base::SysInfo::IsLowEndDevice();
71 if (use_low_memory_policy) { 71 if (use_low_memory_policy) {
72 // On low-end we want to be very carefull about killing other 72 // On low-end we want to be very carefull about killing other
73 // apps. So initially we use 50% more memory to avoid flickering 73 // apps. So initially we use 50% more memory to avoid flickering
74 // or raster-on-demand. 74 // or raster-on-demand.
75 settings->max_memory_for_prepaint_percentage = 67; 75 settings->max_memory_for_prepaint_percentage = 67;
76 76
77 settings->renderer_settings.preferred_tile_format = cc::RGBA_4444; 77 settings->renderer_settings.preferred_tile_format = cc::RGBA_4444;
78 } else { 78 } else {
79 // On other devices we have increased memory excessively to avoid 79 // On other devices we have increased memory excessively to avoid
80 // raster-on-demand already, so now we reserve 50% _only_ to avoid 80 // raster-on-demand already, so now we reserve 50% _only_ to avoid
81 // raster-on-demand, and use 50% of the memory otherwise. 81 // raster-on-demand, and use 50% of the memory otherwise.
82 settings->max_memory_for_prepaint_percentage = 50; 82 settings->max_memory_for_prepaint_percentage = 50;
83 } 83 }
84 settings->renderer_settings.should_clear_root_render_pass = true; 84 settings->renderer_settings.should_clear_root_render_pass = true;
85 85
86 // TODO(danakj): Only do this on low end devices. 86 // TODO(danakj): Only do this on low end devices.
87 settings->create_low_res_tiling = true; 87 settings->create_low_res_tiling = true;
88 88
89 #elif !defined(OS_MACOSX) 89 #elif !defined(OS_MACOSX)
90 settings->scrollbar_animator = cc::LayerTreeSettings::LINEAR_FADE; 90 settings->scrollbar_animator = cc::LayerTreeSettings::LINEAR_FADE;
91 settings->solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128); 91 settings->solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128);
92 settings->scrollbar_fade_delay_ms = 500; 92 settings->scrollbar_fade_delay = base::TimeDelta::FromMilliseconds(500);
93 settings->scrollbar_fade_resize_delay_ms = 500; 93 settings->scrollbar_fade_resize_delay =
94 settings->scrollbar_fade_duration_ms = 300; 94 base::TimeDelta::FromMilliseconds(500);
95 settings->scrollbar_fade_duration = base::TimeDelta::FromMilliseconds(300);
95 96
96 // When pinching in, only show the pinch-viewport overlay scrollbars if the 97 // When pinching in, only show the pinch-viewport overlay scrollbars if the
97 // page scale is at least some threshold away from the minimum. i.e. don't 98 // page scale is at least some threshold away from the minimum. i.e. don't
98 // show the pinch scrollbars when at minimum scale. 99 // show the pinch scrollbars when at minimum scale.
99 // TODO(dtrainor): Update this since https://crrev.com/1267603004 landed. 100 // TODO(dtrainor): Update this since https://crrev.com/1267603004 landed.
100 // settings->scrollbar_show_scale_threshold = 1.05f; 101 // settings->scrollbar_show_scale_threshold = 1.05f;
101 #endif 102 #endif
102 103
103 // Set the gpu memory policy. 104 // Set the gpu memory policy.
104 cc::ManagedMemoryPolicy& memory_policy = settings->gpu_memory_policy; 105 cc::ManagedMemoryPolicy& memory_policy = settings->gpu_memory_policy;
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 } 211 }
211 #endif 212 #endif
212 settings->default_tile_size.SetSize(default_tile_size, default_tile_size); 213 settings->default_tile_size.SetSize(default_tile_size, default_tile_size);
213 214
214 settings->renderer_settings.buffer_to_texture_target_map = 215 settings->renderer_settings.buffer_to_texture_target_map =
215 BlimpGpuMemoryBufferManager::GetDefaultBufferToTextureTargetMap(); 216 BlimpGpuMemoryBufferManager::GetDefaultBufferToTextureTargetMap();
216 } 217 }
217 218
218 } // namespace client 219 } // namespace client
219 } // namespace blimp 220 } // namespace blimp
OLDNEW
« no previous file with comments | « no previous file | cc/layers/scrollbar_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698