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

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: Remove old test 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
« no previous file with comments | « content/browser/android/overscroll_glow.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 <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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 } else if (display_vsync_string == "beginframe") { 235 } else if (display_vsync_string == "beginframe") {
236 settings.wait_for_beginframe_interval = false; 236 settings.wait_for_beginframe_interval = false;
237 } else { 237 } else {
238 settings.renderer_settings.disable_display_vsync = true; 238 settings.renderer_settings.disable_display_vsync = true;
239 settings.wait_for_beginframe_interval = false; 239 settings.wait_for_beginframe_interval = false;
240 } 240 }
241 } 241 }
242 settings.main_frame_before_activation_enabled = 242 settings.main_frame_before_activation_enabled =
243 cmd->HasSwitch(cc::switches::kEnableMainFrameBeforeActivation) && 243 cmd->HasSwitch(cc::switches::kEnableMainFrameBeforeActivation) &&
244 !cmd->HasSwitch(cc::switches::kDisableMainFrameBeforeActivation); 244 !cmd->HasSwitch(cc::switches::kDisableMainFrameBeforeActivation);
245 settings.report_overscroll_only_for_scrollable_axes =
246 !compositor_deps_->IsElasticOverscrollEnabled();
247 settings.accelerated_animation_enabled = 245 settings.accelerated_animation_enabled =
248 !cmd->HasSwitch(cc::switches::kDisableThreadedAnimation); 246 !cmd->HasSwitch(cc::switches::kDisableThreadedAnimation);
249 const std::string slimming_group = 247 const std::string slimming_group =
250 base::FieldTrialList::FindFullName("SlimmingPaint"); 248 base::FieldTrialList::FindFullName("SlimmingPaint");
251 settings.use_display_lists = 249 settings.use_display_lists =
252 (cmd->HasSwitch(switches::kEnableSlimmingPaint) || 250 (cmd->HasSwitch(switches::kEnableSlimmingPaint) ||
253 !cmd->HasSwitch(switches::kDisableSlimmingPaint)) && 251 !cmd->HasSwitch(switches::kDisableSlimmingPaint)) &&
254 (slimming_group != "DisableSlimmingPaint"); 252 (slimming_group != "DisableSlimmingPaint");
255 if (cmd->HasSwitch(switches::kEnableCompositorAnimationTimelines)) { 253 if (cmd->HasSwitch(switches::kEnableCompositorAnimationTimelines)) {
256 settings.use_compositor_animation_timelines = true; 254 settings.use_compositor_animation_timelines = true;
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 SynchronousCompositorFactory* synchronous_compositor_factory = 391 SynchronousCompositorFactory* synchronous_compositor_factory =
394 SynchronousCompositorFactory::GetInstance(); 392 SynchronousCompositorFactory::GetInstance();
395 393
396 // We can't use GPU rasterization on low-end devices, because the Ganesh 394 // We can't use GPU rasterization on low-end devices, because the Ganesh
397 // cache would consume too much memory. 395 // cache would consume too much memory.
398 if (base::SysInfo::IsLowEndDevice()) 396 if (base::SysInfo::IsLowEndDevice())
399 settings.gpu_rasterization_enabled = false; 397 settings.gpu_rasterization_enabled = false;
400 settings.using_synchronous_renderer_compositor = 398 settings.using_synchronous_renderer_compositor =
401 synchronous_compositor_factory; 399 synchronous_compositor_factory;
402 settings.record_full_layer = widget_->DoesRecordFullLayer(); 400 settings.record_full_layer = widget_->DoesRecordFullLayer();
403 settings.report_overscroll_only_for_scrollable_axes =
404 !synchronous_compositor_factory;
405 settings.max_partial_texture_updates = 0; 401 settings.max_partial_texture_updates = 0;
406 if (synchronous_compositor_factory) { 402 if (synchronous_compositor_factory) {
407 // Android WebView uses system scrollbars, so make ours invisible. 403 // Android WebView uses system scrollbars, so make ours invisible.
408 settings.scrollbar_animator = cc::LayerTreeSettings::NO_ANIMATOR; 404 settings.scrollbar_animator = cc::LayerTreeSettings::NO_ANIMATOR;
409 settings.solid_color_scrollbar_color = SK_ColorTRANSPARENT; 405 settings.solid_color_scrollbar_color = SK_ColorTRANSPARENT;
410 } else { 406 } else {
411 settings.scrollbar_animator = cc::LayerTreeSettings::LINEAR_FADE; 407 settings.scrollbar_animator = cc::LayerTreeSettings::LINEAR_FADE;
412 settings.scrollbar_fade_delay_ms = 300; 408 settings.scrollbar_fade_delay_ms = 300;
413 settings.scrollbar_fade_resize_delay_ms = 2000; 409 settings.scrollbar_fade_resize_delay_ms = 2000;
414 settings.scrollbar_fade_duration_ms = 300; 410 settings.scrollbar_fade_duration_ms = 300;
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after
1038 return; 1034 return;
1039 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); 1035 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM();
1040 } 1036 }
1041 1037
1042 void RenderWidgetCompositor::SetSurfaceIdNamespace( 1038 void RenderWidgetCompositor::SetSurfaceIdNamespace(
1043 uint32_t surface_id_namespace) { 1039 uint32_t surface_id_namespace) {
1044 layer_tree_host_->set_surface_id_namespace(surface_id_namespace); 1040 layer_tree_host_->set_surface_id_namespace(surface_id_namespace);
1045 } 1041 }
1046 1042
1047 } // namespace content 1043 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/android/overscroll_glow.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698