OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/trees/layer_tree_host_common.h" | 5 #include "cc/trees/layer_tree_host_common.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "cc/base/math_util.h" | 10 #include "cc/base/math_util.h" |
(...skipping 2306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2317 // If we have finished walking all ancestors without having already exited, | 2317 // If we have finished walking all ancestors without having already exited, |
2318 // then the point is not clipped by any ancestors. | 2318 // then the point is not clipped by any ancestors. |
2319 return false; | 2319 return false; |
2320 } | 2320 } |
2321 | 2321 |
2322 LayerImpl* LayerTreeHostCommon::FindLayerThatIsHitByPoint( | 2322 LayerImpl* LayerTreeHostCommon::FindLayerThatIsHitByPoint( |
2323 const gfx::PointF& screen_space_point, | 2323 const gfx::PointF& screen_space_point, |
2324 const LayerImplList& render_surface_layer_list) { | 2324 const LayerImplList& render_surface_layer_list) { |
2325 LayerImpl* found_layer = NULL; | 2325 LayerImpl* found_layer = NULL; |
2326 | 2326 |
2327 typedef LayerIterator<LayerImpl, | 2327 typedef LayerIterator<LayerImpl> LayerIteratorType; |
2328 LayerImplList, | |
2329 RenderSurfaceImpl, | |
2330 LayerIteratorActions::FrontToBack> LayerIteratorType; | |
2331 LayerIteratorType end = LayerIteratorType::End(&render_surface_layer_list); | 2328 LayerIteratorType end = LayerIteratorType::End(&render_surface_layer_list); |
2332 | |
2333 for (LayerIteratorType | 2329 for (LayerIteratorType |
2334 it = LayerIteratorType::Begin(&render_surface_layer_list); | 2330 it = LayerIteratorType::Begin(&render_surface_layer_list); |
2335 it != end; | 2331 it != end; |
2336 ++it) { | 2332 ++it) { |
2337 // We don't want to consider render_surfaces for hit testing. | 2333 // We don't want to consider render_surfaces for hit testing. |
2338 if (!it.represents_itself()) | 2334 if (!it.represents_itself()) |
2339 continue; | 2335 continue; |
2340 | 2336 |
2341 LayerImpl* current_layer = (*it); | 2337 LayerImpl* current_layer = (*it); |
2342 | 2338 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2401 // At this point, we think the point does hit the touch event handler region | 2397 // At this point, we think the point does hit the touch event handler region |
2402 // on the layer, but we need to walk up the parents to ensure that the layer | 2398 // on the layer, but we need to walk up the parents to ensure that the layer |
2403 // was not clipped in such a way that the hit point actually should not hit | 2399 // was not clipped in such a way that the hit point actually should not hit |
2404 // the layer. | 2400 // the layer. |
2405 if (PointIsClippedBySurfaceOrClipRect(screen_space_point, layer_impl)) | 2401 if (PointIsClippedBySurfaceOrClipRect(screen_space_point, layer_impl)) |
2406 return false; | 2402 return false; |
2407 | 2403 |
2408 return true; | 2404 return true; |
2409 } | 2405 } |
2410 } // namespace cc | 2406 } // namespace cc |
OLD | NEW |