cc: Avoid prefer smoothness mode when scrolling with scroll handler
Avoid going into prefer smoothness mode when the scrolled layer has a
scroll handler. The presence of a scroll handler suggests that the main
thread wants to animate in response to scrolling. Avoiding smoothness
mode gives it a chance to do that while still having our deadline as a
fallback.
BUG=347366
Review URL: https://codereview.chromium.org/206523003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@260859 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/cc/trees/layer_tree_host_impl.h b/cc/trees/layer_tree_host_impl.h
index 10477dc2..2d64a3b 100644
--- a/cc/trees/layer_tree_host_impl.h
+++ b/cc/trees/layer_tree_host_impl.h
@@ -284,9 +284,12 @@
LayerImpl* OuterViewportScrollLayer() const;
LayerImpl* CurrentlyScrollingLayer() const;
- int scroll_layer_id_when_mouse_over_scrollbar() {
+ int scroll_layer_id_when_mouse_over_scrollbar() const {
return scroll_layer_id_when_mouse_over_scrollbar_;
}
+ bool scroll_affects_scroll_handler() const {
+ return scroll_affects_scroll_handler_;
+ }
bool IsCurrentlyScrolling() const;
@@ -508,7 +511,8 @@
const gfx::PointF& device_viewport_point,
InputHandler::ScrollInputType type,
LayerImpl* layer_hit_by_point,
- bool* scroll_on_main_thread) const;
+ bool* scroll_on_main_thread,
+ bool* has_ancestor_scroll_handler) const;
float DeviceSpaceDistanceToLayer(const gfx::PointF& device_viewport_point,
LayerImpl* layer_impl);
void StartScrollbarAnimationRecursive(LayerImpl* layer, base::TimeTicks time);
@@ -557,6 +561,7 @@
bool did_lock_scrolling_layer_;
bool should_bubble_scrolls_;
bool wheel_scrolling_;
+ bool scroll_affects_scroll_handler_;
int scroll_layer_id_when_mouse_over_scrollbar_;
bool tile_priorities_dirty_;