Commit e33e39ae authored by Rahul Arakeri's avatar Rahul Arakeri Committed by Commit Bot

[PercentBasedScrolling] Make flag accessible to LayerTreeHostImpl.

This CL adds the plumbing to make features::kPercentBasedScrolling
accessible to LayerTreeHostImpl via LayerTreeSettings.

Bug: 1062163
Change-Id: Ic8676f3c1d76533fcc3639de68ece2763baae711
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2107153Reviewed-by: default avatarStefan Zager <szager@chromium.org>
Reviewed-by: default avatarDavid Bokan <bokan@chromium.org>
Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Rahul Arakeri <arakeri@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#751091}
parent 19dca998
...@@ -615,6 +615,9 @@ int ScrollbarController::GetScrollDeltaForScrollbarPart( ...@@ -615,6 +615,9 @@ int ScrollbarController::GetScrollDeltaForScrollbarPart(
const ScrollbarPart scrollbar_part, const ScrollbarPart scrollbar_part,
const bool shift_modifier) { const bool shift_modifier) {
int scroll_delta = 0; int scroll_delta = 0;
if (layer_tree_host_impl_->settings().percent_based_scrolling) {
// TODO(arakeri): Implement percent based deltas.
}
switch (scrollbar_part) { switch (scrollbar_part) {
case ScrollbarPart::BACK_BUTTON: case ScrollbarPart::BACK_BUTTON:
......
...@@ -142,6 +142,9 @@ class CC_EXPORT LayerTreeSettings { ...@@ -142,6 +142,9 @@ class CC_EXPORT LayerTreeSettings {
// on the compositor thread. // on the compositor thread.
bool compositor_threaded_scrollbar_scrolling = true; bool compositor_threaded_scrollbar_scrolling = true;
// If enabled, the scroll deltas will be a percentage of the target scroller.
bool percent_based_scrolling = false;
// Determines whether animated scrolling is supported. If true, and the // Determines whether animated scrolling is supported. If true, and the
// incoming gesture scroll is of a type that would normally be animated (e.g. // incoming gesture scroll is of a type that would normally be animated (e.g.
// coarse granularity scrolls like those coming from an external mouse wheel), // coarse granularity scrolls like those coming from an external mouse wheel),
......
...@@ -2688,6 +2688,8 @@ cc::LayerTreeSettings RenderWidget::GenerateLayerTreeSettings( ...@@ -2688,6 +2688,8 @@ cc::LayerTreeSettings RenderWidget::GenerateLayerTreeSettings(
cc::LayerTreeSettings settings; cc::LayerTreeSettings settings;
settings.use_zoom_for_dsf = compositor_deps->IsUseZoomForDSFEnabled(); settings.use_zoom_for_dsf = compositor_deps->IsUseZoomForDSFEnabled();
settings.percent_based_scrolling =
base::FeatureList::IsEnabled(features::kPercentBasedScrolling);
settings.compositor_threaded_scrollbar_scrolling = settings.compositor_threaded_scrollbar_scrolling =
base::FeatureList::IsEnabled( base::FeatureList::IsEnabled(
features::kCompositorThreadedScrollbarScrolling); features::kCompositorThreadedScrollbarScrolling);
......
...@@ -216,6 +216,10 @@ Compositor::Compositor(const viz::FrameSinkId& frame_sink_id, ...@@ -216,6 +216,10 @@ Compositor::Compositor(const viz::FrameSinkId& frame_sink_id,
settings.compositor_threaded_scrollbar_scrolling = true; settings.compositor_threaded_scrollbar_scrolling = true;
} }
if (base::FeatureList::IsEnabled(features::kPercentBasedScrolling)) {
settings.percent_based_scrolling = true;
}
#if DCHECK_IS_ON() #if DCHECK_IS_ON()
if (command_line->HasSwitch(cc::switches::kLogOnUIDoubleBackgroundBlur)) if (command_line->HasSwitch(cc::switches::kLogOnUIDoubleBackgroundBlur))
settings.log_on_ui_double_background_blur = true; settings.log_on_ui_double_background_blur = true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment