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

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

Issue 1236643003: [Android] Suppress overscroll for unscrollable axes in the browser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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
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 <limits> 7 #include <limits>
8 #include <string> 8 #include <string>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 225
226 // For web contents, layer transforms should scale up the contents of layers 226 // For web contents, layer transforms should scale up the contents of layers
227 // to keep content always crisp when possible. 227 // to keep content always crisp when possible.
228 settings.layer_transforms_should_scale_layer_contents = true; 228 settings.layer_transforms_should_scale_layer_contents = true;
229 229
230 settings.renderer_settings.disable_gpu_vsync = 230 settings.renderer_settings.disable_gpu_vsync =
231 cmd->HasSwitch(switches::kDisableGpuVsync); 231 cmd->HasSwitch(switches::kDisableGpuVsync);
232 settings.main_frame_before_activation_enabled = 232 settings.main_frame_before_activation_enabled =
233 cmd->HasSwitch(cc::switches::kEnableMainFrameBeforeActivation) && 233 cmd->HasSwitch(cc::switches::kEnableMainFrameBeforeActivation) &&
234 !cmd->HasSwitch(cc::switches::kDisableMainFrameBeforeActivation); 234 !cmd->HasSwitch(cc::switches::kDisableMainFrameBeforeActivation);
235 settings.report_overscroll_only_for_scrollable_axes =
236 !compositor_deps_->IsElasticOverscrollEnabled();
237 settings.accelerated_animation_enabled = 235 settings.accelerated_animation_enabled =
238 !cmd->HasSwitch(cc::switches::kDisableThreadedAnimation); 236 !cmd->HasSwitch(cc::switches::kDisableThreadedAnimation);
239 const std::string slimming_group = 237 const std::string slimming_group =
240 base::FieldTrialList::FindFullName("SlimmingPaint"); 238 base::FieldTrialList::FindFullName("SlimmingPaint");
241 settings.use_display_lists = 239 settings.use_display_lists =
242 (cmd->HasSwitch(switches::kEnableSlimmingPaint) || 240 (cmd->HasSwitch(switches::kEnableSlimmingPaint) ||
243 !cmd->HasSwitch(switches::kDisableSlimmingPaint)) && 241 !cmd->HasSwitch(switches::kDisableSlimmingPaint)) &&
244 (slimming_group != "DisableSlimmingPaint"); 242 (slimming_group != "DisableSlimmingPaint");
245 if (cmd->HasSwitch(switches::kEnableCompositorAnimationTimelines)) { 243 if (cmd->HasSwitch(switches::kEnableCompositorAnimationTimelines)) {
246 settings.use_compositor_animation_timelines = true; 244 settings.use_compositor_animation_timelines = true;
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 SynchronousCompositorFactory* synchronous_compositor_factory = 390 SynchronousCompositorFactory* synchronous_compositor_factory =
393 SynchronousCompositorFactory::GetInstance(); 391 SynchronousCompositorFactory::GetInstance();
394 392
395 // We can't use GPU rasterization on low-end devices, because the Ganesh 393 // We can't use GPU rasterization on low-end devices, because the Ganesh
396 // cache would consume too much memory. 394 // cache would consume too much memory.
397 if (base::SysInfo::IsLowEndDevice()) 395 if (base::SysInfo::IsLowEndDevice())
398 settings.gpu_rasterization_enabled = false; 396 settings.gpu_rasterization_enabled = false;
399 settings.using_synchronous_renderer_compositor = 397 settings.using_synchronous_renderer_compositor =
400 synchronous_compositor_factory; 398 synchronous_compositor_factory;
401 settings.record_full_layer = widget_->DoesRecordFullLayer(); 399 settings.record_full_layer = widget_->DoesRecordFullLayer();
402 settings.report_overscroll_only_for_scrollable_axes =
403 !synchronous_compositor_factory;
404 settings.max_partial_texture_updates = 0; 400 settings.max_partial_texture_updates = 0;
405 if (synchronous_compositor_factory) { 401 if (synchronous_compositor_factory) {
406 // Android WebView uses system scrollbars, so make ours invisible. 402 // Android WebView uses system scrollbars, so make ours invisible.
407 settings.scrollbar_animator = cc::LayerTreeSettings::NO_ANIMATOR; 403 settings.scrollbar_animator = cc::LayerTreeSettings::NO_ANIMATOR;
408 settings.solid_color_scrollbar_color = SK_ColorTRANSPARENT; 404 settings.solid_color_scrollbar_color = SK_ColorTRANSPARENT;
409 } else { 405 } else {
410 settings.scrollbar_animator = cc::LayerTreeSettings::LINEAR_FADE; 406 settings.scrollbar_animator = cc::LayerTreeSettings::LINEAR_FADE;
411 settings.scrollbar_fade_delay_ms = 300; 407 settings.scrollbar_fade_delay_ms = 300;
412 settings.scrollbar_fade_resize_delay_ms = 2000; 408 settings.scrollbar_fade_resize_delay_ms = 2000;
413 settings.scrollbar_fade_duration_ms = 300; 409 settings.scrollbar_fade_duration_ms = 300;
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after
1037 return; 1033 return;
1038 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); 1034 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM();
1039 } 1035 }
1040 1036
1041 void RenderWidgetCompositor::SetSurfaceIdNamespace( 1037 void RenderWidgetCompositor::SetSurfaceIdNamespace(
1042 uint32_t surface_id_namespace) { 1038 uint32_t surface_id_namespace) {
1043 layer_tree_host_->set_surface_id_namespace(surface_id_namespace); 1039 layer_tree_host_->set_surface_id_namespace(surface_id_namespace);
1044 } 1040 }
1045 1041
1046 } // namespace content 1042 } // namespace content
OLDNEW
« content/browser/android/overscroll_glow.cc ('K') | « content/browser/android/overscroll_glow.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698