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

Unified Diff: cc/trees/layer_tree_impl.cc

Issue 2718833002: Refactor unreliable hit test code to avoid owning_layers (Closed)
Patch Set: Fix bug when directly hitting a drawn scrollbar Created 3 years, 10 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_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_impl.cc
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc
index 5d91fc703c8436df4fa9f432099b4a3e1b2039a9..fae5f7c6d62f063e7e0508d78287300a3795fe1a 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -1929,32 +1929,26 @@ static void FindClosestMatchingLayer(const gfx::PointF& screen_space_point,
}
}
-static bool IsScrollableOrDrawnScrollbarLayer(LayerImpl* layer) {
- return layer->scrollable() ||
- (layer->ToScrollbarLayer() &&
- layer->is_drawn_render_surface_layer_list_member());
-}
-
-struct FindScrollingLayerOrScrollbarLayerFunctor {
+struct FindScrollingLayerOrDrawnScrollbarFunctor {
bool operator()(LayerImpl* layer) const {
- return IsScrollableOrDrawnScrollbarLayer(layer);
+ return layer->scrollable() || layer->IsDrawnScrollbar();
}
};
LayerImpl*
-LayerTreeImpl::FindFirstScrollingLayerOrScrollbarLayerThatIsHitByPoint(
+LayerTreeImpl::FindFirstScrollingLayerOrDrawnScrollbarThatIsHitByPoint(
const gfx::PointF& screen_space_point) {
FindClosestMatchingLayerState state;
LayerImpl* root_layer = layer_list_.empty() ? nullptr : layer_list_[0];
FindClosestMatchingLayer(screen_space_point, root_layer,
- FindScrollingLayerOrScrollbarLayerFunctor(), &state);
+ FindScrollingLayerOrDrawnScrollbarFunctor(), &state);
return state.closest_match;
}
struct HitTestVisibleScrollableOrTouchableFunctor {
bool operator()(LayerImpl* layer) const {
- return layer->is_drawn_render_surface_layer_list_member() ||
- IsScrollableOrDrawnScrollbarLayer(layer) ||
+ return layer->scrollable() ||
+ layer->is_drawn_render_surface_layer_list_member() ||
!layer->touch_event_handler_region().IsEmpty();
}
};
« no previous file with comments | « cc/trees/layer_tree_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698