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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 1646603004: Move scroll event handlers from layer to layer tree view. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master_cc_listeners
Patch Set: Rebase Created 4 years, 11 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 | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('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 50fc49f398d9878fb3c651e4e3093ecdafc4cd8c..1ccc3c8daeeca609d43e1751c32b0aedd53e4e42 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -552,7 +552,7 @@ bool LayerTreeHostImpl::IsCurrentlyScrollingLayerAt(
bool scroll_on_main_thread = false;
uint32_t main_thread_scrolling_reasons;
LayerImpl* test_layer_impl = FindScrollLayerForDeviceViewportPoint(
- device_viewport_point, type, layer_impl, &scroll_on_main_thread, nullptr,
+ device_viewport_point, type, layer_impl, &scroll_on_main_thread,
&main_thread_scrolling_reasons);
if (!test_layer_impl)
@@ -2433,7 +2433,6 @@ LayerImpl* LayerTreeHostImpl::FindScrollLayerForDeviceViewportPoint(
InputHandler::ScrollInputType type,
LayerImpl* layer_impl,
bool* scroll_on_main_thread,
- bool* optional_has_ancestor_scroll_handler,
uint32_t* main_thread_scrolling_reasons) const {
DCHECK(scroll_on_main_thread);
DCHECK(main_thread_scrolling_reasons);
@@ -2467,10 +2466,6 @@ LayerImpl* LayerTreeHostImpl::FindScrollLayerForDeviceViewportPoint(
return NULL;
}
- if (optional_has_ancestor_scroll_handler &&
- layer_impl->have_scroll_event_handlers())
- *optional_has_ancestor_scroll_handler = true;
-
if (status.thread == InputHandler::SCROLL_ON_IMPL_THREAD &&
!potentially_scrolling_layer_impl) {
potentially_scrolling_layer_impl = layer_impl;
@@ -2598,9 +2593,12 @@ InputHandler::ScrollStatus LayerTreeHostImpl::ScrollBegin(
bool scroll_on_main_thread = false;
LayerImpl* scrolling_layer_impl = FindScrollLayerForDeviceViewportPoint(
device_viewport_point, type, layer_impl, &scroll_on_main_thread,
- &scroll_affects_scroll_handler_,
&scroll_status.main_thread_scrolling_reasons);
+ if (scrolling_layer_impl)
+ scroll_affects_scroll_handler_ =
+ scrolling_layer_impl->layer_tree_impl()->have_scroll_event_handlers();
+
if (scroll_on_main_thread) {
RecordCompositorSlowScrollMetric(type, MAIN_THREAD);
@@ -3075,7 +3073,7 @@ void LayerTreeHostImpl::MouseMoveAt(const gfx::Point& viewport_point) {
uint32_t main_thread_scrolling_reasons;
LayerImpl* scroll_layer_impl = FindScrollLayerForDeviceViewportPoint(
device_viewport_point, InputHandler::GESTURE, layer_impl,
- &scroll_on_main_thread, NULL, &main_thread_scrolling_reasons);
+ &scroll_on_main_thread, &main_thread_scrolling_reasons);
if (scroll_layer_impl == InnerViewportScrollLayer())
scroll_layer_impl = OuterViewportScrollLayer();
if (scroll_on_main_thread || !scroll_layer_impl)
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698