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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 2621133002: Return main thread scroll layer in FindScrollLayerForDeviceViewportPoint (Closed)
Patch Set: test fix Created 3 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 | « no previous file | no next file » | 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 d7559a11a91ee6dac61611d01011bc95558e7ce8..3089a3a07a2818e9abd19b0682736c150177b34d 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -579,7 +579,7 @@ bool LayerTreeHostImpl::IsCurrentlyScrollingLayerAt(
device_viewport_point, type, layer_impl, &scroll_on_main_thread,
&main_thread_scrolling_reasons);
- if (!test_layer_impl)
+ if (scroll_on_main_thread)
return false;
if (scrolling_layer_impl == test_layer_impl)
@@ -1658,7 +1658,6 @@ bool LayerTreeHostImpl::DrawLayers(FrameData* frame) {
}
}
-
CompositorFrame compositor_frame;
compositor_frame.metadata = std::move(metadata);
resource_provider_->PrepareSendToParent(resources,
@@ -2527,7 +2526,7 @@ LayerImpl* LayerTreeHostImpl::FindScrollLayerForDeviceViewportPoint(
// Walk up the hierarchy and look for a scrollable layer.
ScrollTree& scroll_tree = active_tree_->property_trees()->scroll_tree;
- LayerImpl* potentially_scrolling_layer_impl = NULL;
+ LayerImpl* potentially_scrolling_layer_impl = nullptr;
if (layer_impl) {
ScrollNode* scroll_node = scroll_tree.Node(layer_impl->scroll_tree_index());
for (; scroll_tree.parent(scroll_node);
@@ -2539,7 +2538,7 @@ LayerImpl* LayerTreeHostImpl::FindScrollLayerForDeviceViewportPoint(
if (IsMainThreadScrolling(status, scroll_node)) {
*scroll_on_main_thread = true;
*main_thread_scrolling_reasons = status.main_thread_scrolling_reasons;
- return NULL;
+ return active_tree_->LayerById(scroll_node->owning_layer_id);
}
if (status.thread == InputHandler::SCROLL_ON_IMPL_THREAD &&
@@ -2568,7 +2567,6 @@ LayerImpl* LayerTreeHostImpl::FindScrollLayerForDeviceViewportPoint(
if (IsMainThreadScrolling(status, scroll_node)) {
*scroll_on_main_thread = true;
*main_thread_scrolling_reasons = status.main_thread_scrolling_reasons;
- return NULL;
}
}
@@ -2680,15 +2678,15 @@ InputHandler::ScrollStatus LayerTreeHostImpl::ScrollBegin(
device_viewport_point, type, layer_impl, &scroll_on_main_thread,
&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);
scroll_status.thread = SCROLL_ON_MAIN_THREAD;
return scroll_status;
+ } else if (scrolling_layer_impl) {
+ scroll_affects_scroll_handler_ =
+ scrolling_layer_impl->layer_tree_impl()->have_scroll_event_handlers();
}
return ScrollBeginImpl(scroll_state, scrolling_layer_impl, type);
@@ -3242,9 +3240,6 @@ void LayerTreeHostImpl::MouseMoveAt(const gfx::Point& viewport_point) {
active_tree_->FindLayerThatIsHitByPoint(device_viewport_point);
// Check if mouse is over a scrollbar or not.
- // TODO(sahel): get rid of this extera checking when
- // FindScrollLayerForDeviceViewportPoint finds the proper layer for
- // scrolling on main thread, as well.
bokan 2017/01/13 16:19:17 What extra checking is this TODO referring to?
int new_id = Layer::INVALID_ID;
if (layer_impl && layer_impl->ToScrollbarLayer())
new_id = layer_impl->ToScrollbarLayer()->ScrollLayerId();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698