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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 230223006: Move nonscrollable axis gloweffect suppression to renderer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clean up and modified as per review comments Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | cc/trees/layer_tree_settings.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 685cfb99122f393eec5b610e90c35c8c51ed546d..e229474dff7c0181e362dbcce4ae6968ce355757 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -2313,6 +2313,13 @@ bool LayerTreeHostImpl::ScrollBy(const gfx::Point& viewport_point,
unused_root_delta.set_x(0.0f);
if (std::abs(unused_root_delta.y()) < kEpsilon)
unused_root_delta.set_y(0.0f);
+ // Disable overscroll on axes which is impossible to scroll.
+ if (settings_.report_overscroll_only_for_scrollable_axes) {
+ if (std::abs(active_tree_->TotalMaxScrollOffset().x()) <= kEpsilon)
+ unused_root_delta.set_x(0.0f);
+ if (std::abs(active_tree_->TotalMaxScrollOffset().y()) <= kEpsilon)
+ unused_root_delta.set_y(0.0f);
+ }
}
// If the layer wasn't able to move, try the next one in the hierarchy.
« no previous file with comments | « no previous file | cc/trees/layer_tree_settings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698