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

Side by Side Diff: content/renderer/gpu/render_widget_compositor.cc

Issue 2380963002: Use hide_scrollbars setting for Android WebView. (Closed)
Patch Set: Add dependency to patch fixing frame scrolling. 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 | « android_webview/native/aw_settings.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "content/renderer/gpu/render_widget_compositor.h" 5 #include "content/renderer/gpu/render_widget_compositor.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <limits> 8 #include <limits>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 377
378 #if defined(OS_ANDROID) 378 #if defined(OS_ANDROID)
379 bool using_synchronous_compositor = 379 bool using_synchronous_compositor =
380 GetContentClient()->UsingSynchronousCompositing(); 380 GetContentClient()->UsingSynchronousCompositing();
381 381
382 // We can't use GPU rasterization on low-end devices, because the Ganesh 382 // We can't use GPU rasterization on low-end devices, because the Ganesh
383 // cache would consume too much memory. 383 // cache would consume too much memory.
384 if (base::SysInfo::IsLowEndDevice()) 384 if (base::SysInfo::IsLowEndDevice())
385 settings.gpu_rasterization_enabled = false; 385 settings.gpu_rasterization_enabled = false;
386 settings.using_synchronous_renderer_compositor = using_synchronous_compositor; 386 settings.using_synchronous_renderer_compositor = using_synchronous_compositor;
387 if (using_synchronous_compositor) { 387 settings.scrollbar_animator = cc::LayerTreeSettings::LINEAR_FADE;
388 // Android WebView uses system scrollbars, so make ours invisible. 388 settings.scrollbar_fade_delay_ms = 300;
389 settings.scrollbar_animator = cc::LayerTreeSettings::NO_ANIMATOR; 389 settings.scrollbar_fade_resize_delay_ms = 2000;
390 settings.solid_color_scrollbar_color = SK_ColorTRANSPARENT; 390 settings.scrollbar_fade_duration_ms = 300;
391 } else { 391 settings.solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128);
392 settings.scrollbar_animator = cc::LayerTreeSettings::LINEAR_FADE;
393 settings.scrollbar_fade_delay_ms = 300;
394 settings.scrollbar_fade_resize_delay_ms = 2000;
395 settings.scrollbar_fade_duration_ms = 300;
396 settings.solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128);
397 }
398 settings.renderer_settings.highp_threshold_min = 2048; 392 settings.renderer_settings.highp_threshold_min = 2048;
399 // Android WebView handles root layer flings itself. 393 // Android WebView handles root layer flings itself.
400 settings.ignore_root_layer_flings = using_synchronous_compositor; 394 settings.ignore_root_layer_flings = using_synchronous_compositor;
401 // Memory policy on Android WebView does not depend on whether device is 395 // Memory policy on Android WebView does not depend on whether device is
402 // low end, so always use default policy. 396 // low end, so always use default policy.
403 bool use_low_memory_policy = 397 bool use_low_memory_policy =
404 base::SysInfo::IsLowEndDevice() && !using_synchronous_compositor; 398 base::SysInfo::IsLowEndDevice() && !using_synchronous_compositor;
405 if (use_low_memory_policy) { 399 if (use_low_memory_policy) {
406 // On low-end we want to be very carefull about killing other 400 // On low-end we want to be very carefull about killing other
407 // apps. So initially we use 50% more memory to avoid flickering 401 // apps. So initially we use 50% more memory to avoid flickering
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after
1120 float device_scale) { 1114 float device_scale) {
1121 layer_tree_host_->GetLayerTree()->SetPaintedDeviceScaleFactor(device_scale); 1115 layer_tree_host_->GetLayerTree()->SetPaintedDeviceScaleFactor(device_scale);
1122 } 1116 }
1123 1117
1124 void RenderWidgetCompositor::SetDeviceColorSpace( 1118 void RenderWidgetCompositor::SetDeviceColorSpace(
1125 const gfx::ColorSpace& color_space) { 1119 const gfx::ColorSpace& color_space) {
1126 layer_tree_host_->GetLayerTree()->SetDeviceColorSpace(color_space); 1120 layer_tree_host_->GetLayerTree()->SetDeviceColorSpace(color_space);
1127 } 1121 }
1128 1122
1129 } // namespace content 1123 } // namespace content
OLDNEW
« no previous file with comments | « android_webview/native/aw_settings.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698