Chromium Code Reviews| Index: cc/trees/layer_tree_impl.cc |
| diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc |
| index 06b34d3ecc154755d2a71cd9aeb65533a2cc5318..d7cde48bdec92ec220101c0492b2984ad8cc5a3b 100644 |
| --- a/cc/trees/layer_tree_impl.cc |
| +++ b/cc/trees/layer_tree_impl.cc |
| @@ -1639,9 +1639,17 @@ static bool PointIsClippedByAncestorClipNode( |
| gfx::Rect combined_clip_in_target_space = |
| gfx::ToEnclosingRect(clip_node->data.combined_clip_in_target_space); |
| - if (!PointHitsRect(screen_space_point, transform_node->data.to_screen, |
| - combined_clip_in_target_space, NULL)) |
| + const LayerImpl* target_layer = |
| + layer->layer_tree_impl()->LayerById(transform_node->owner_id); |
| + DCHECK(transform_node->id == 0 || target_layer->render_surface()); |
| + gfx::Transform surface_screen_space_transform = |
| + transform_node->id == 0 |
|
jaydasika
2016/04/26 18:12:22
Making it more explicit that transform node's id =
|
| + ? gfx::Transform() |
| + : SurfaceScreenSpaceTransform(target_layer, transform_tree); |
| + if (!PointHitsRect(screen_space_point, surface_screen_space_transform, |
| + combined_clip_in_target_space, NULL)) { |
| return true; |
| + } |
| } |
| const LayerImpl* clip_node_owner = |
| layer->layer_tree_impl()->LayerById(clip_node->owner_id); |
| @@ -1674,8 +1682,9 @@ static bool PointHitsLayer(const LayerImpl* layer, |
| const ClipTree& clip_tree) { |
| gfx::Rect content_rect(layer->bounds()); |
| if (!PointHitsRect(screen_space_point, layer->ScreenSpaceTransform(), |
| - content_rect, distance_to_intersection)) |
| + content_rect, distance_to_intersection)) { |
| return false; |
| + } |
| // At this point, we think the point does hit the layer, but we need to walk |
| // up the parents to ensure that the layer was not clipped in such a way |