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

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: changes done after 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
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..eced362eacae6b604634276c36354246437b80c1 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -2313,6 +2313,20 @@ 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) {
+ gfx::SizeF ceiled_viewport_size =
jdduke (slow) 2014/04/10 14:16:02 You shouldn't need to check both viewport size and
+ gfx::ToCeiledSize(active_tree_->ScrollableViewportSize());
+ gfx::SizeF root_layer_size = active_tree_->ScrollableSize();
+ if (!(ceiled_viewport_size.width() < root_layer_size.width())) {
+ if (std::abs(InnerViewportScrollLayer()->MaxScrollOffset().x()) <= 0)
aelias_OOO_until_Jul13 2014/04/10 16:28:37 Please also check OuterViewportScrollLayer as I me
+ unused_root_delta.set_x(0.0f);
+ }
+ if (!(ceiled_viewport_size.height() < root_layer_size.height())) {
+ if (std::abs(InnerViewportScrollLayer()->MaxScrollOffset().y()) <= 0)
+ 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') | content/browser/renderer_host/render_widget_host_view_android.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698