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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 27718006: cc: Fix touch hit-testing for overlapping layers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix-win Created 7 years, 2 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 c0c5c2a04975020a7ba70f2846cf1ced4e70bccb..70fa77872d40ca38d255993e508d09b788d259ac 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -435,21 +435,11 @@ bool LayerTreeHostImpl::HaveTouchEventHandlersAt(gfx::Point viewport_point) {
gfx::PointF device_viewport_point =
gfx::ScalePoint(viewport_point, device_scale_factor_);
- // First find out which layer was hit from the saved list of visible layers
- // in the most recent frame.
- LayerImpl* layer_impl = LayerTreeHostCommon::FindLayerThatIsHitByPoint(
- device_viewport_point,
- active_tree_->RenderSurfaceLayerList());
-
- // Walk up the hierarchy and look for a layer with a touch event handler
- // region that the given point hits.
- for (; layer_impl; layer_impl = layer_impl->parent()) {
- if (LayerTreeHostCommon::LayerHasTouchEventHandlersAt(device_viewport_point,
- layer_impl))
- return true;
- }
-
- return false;
+ LayerImpl* layer_impl =
+ LayerTreeHostCommon::FindLayerThatIsHitByPointInTouchHandlerRegion(
+ device_viewport_point,
+ active_tree_->RenderSurfaceLayerList());
+ return layer_impl != NULL;
}
void LayerTreeHostImpl::SetLatencyInfoForInputEvent(
« cc/trees/layer_tree_host_common.cc ('K') | « cc/trees/layer_tree_host_common_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698