| 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_impl.h" | 5 #include "cc/trees/layer_tree_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 1727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1738 // was not clipped in such a way that the hit point actually should not hit | 1738 // was not clipped in such a way that the hit point actually should not hit |
| 1739 // the layer. | 1739 // the layer. |
| 1740 if (PointIsClippedBySurfaceOrClipRect(screen_space_point, layer_impl, | 1740 if (PointIsClippedBySurfaceOrClipRect(screen_space_point, layer_impl, |
| 1741 transform_tree, clip_tree, | 1741 transform_tree, clip_tree, |
| 1742 use_property_trees)) | 1742 use_property_trees)) |
| 1743 return false; | 1743 return false; |
| 1744 | 1744 |
| 1745 return true; | 1745 return true; |
| 1746 } | 1746 } |
| 1747 | 1747 |
| 1748 struct FindWheelEventLayerFunctor { | |
| 1749 bool operator()(LayerImpl* layer) const { | |
| 1750 return layer->wheel_event_properties() != EventListenerProperties::kNone; | |
| 1751 } | |
| 1752 }; | |
| 1753 | |
| 1754 LayerImpl* LayerTreeImpl::FindLayerWithWheelHandlerThatIsHitByPoint( | |
| 1755 const gfx::PointF& screen_space_point) { | |
| 1756 if (!root_layer()) | |
| 1757 return NULL; | |
| 1758 bool update_lcd_text = false; | |
| 1759 if (!UpdateDrawProperties(update_lcd_text)) | |
| 1760 return NULL; | |
| 1761 bool use_property_trees = | |
| 1762 settings().use_property_trees || settings().verify_property_trees; | |
| 1763 FindWheelEventLayerFunctor func; | |
| 1764 FindClosestMatchingLayerDataForRecursion data_for_recursion; | |
| 1765 FindClosestMatchingLayer( | |
| 1766 screen_space_point, root_layer(), func, property_trees_.transform_tree, | |
| 1767 property_trees_.clip_tree, use_property_trees, &data_for_recursion); | |
| 1768 return data_for_recursion.closest_match; | |
| 1769 } | |
| 1770 | |
| 1771 struct FindTouchEventLayerFunctor { | 1748 struct FindTouchEventLayerFunctor { |
| 1772 bool operator()(LayerImpl* layer) const { | 1749 bool operator()(LayerImpl* layer) const { |
| 1773 return LayerHasTouchEventHandlersAt(screen_space_point, layer, | 1750 return LayerHasTouchEventHandlersAt(screen_space_point, layer, |
| 1774 transform_tree, clip_tree, | 1751 transform_tree, clip_tree, |
| 1775 use_property_trees); | 1752 use_property_trees); |
| 1776 } | 1753 } |
| 1777 const gfx::PointF screen_space_point; | 1754 const gfx::PointF screen_space_point; |
| 1778 const TransformTree& transform_tree; | 1755 const TransformTree& transform_tree; |
| 1779 const ClipTree& clip_tree; | 1756 const ClipTree& clip_tree; |
| 1780 const bool use_property_trees; | 1757 const bool use_property_trees; |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2075 const gfx::BoxF& box, | 2052 const gfx::BoxF& box, |
| 2076 gfx::BoxF* bounds) const { | 2053 gfx::BoxF* bounds) const { |
| 2077 *bounds = gfx::BoxF(); | 2054 *bounds = gfx::BoxF(); |
| 2078 return layer_tree_host_impl_->animation_host() | 2055 return layer_tree_host_impl_->animation_host() |
| 2079 ? layer_tree_host_impl_->animation_host() | 2056 ? layer_tree_host_impl_->animation_host() |
| 2080 ->TransformAnimationBoundsForBox(layer->id(), box, bounds) | 2057 ->TransformAnimationBoundsForBox(layer->id(), box, bounds) |
| 2081 : true; | 2058 : true; |
| 2082 } | 2059 } |
| 2083 | 2060 |
| 2084 } // namespace cc | 2061 } // namespace cc |
| OLD | NEW |