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

Unified Diff: cc/trees/layer_tree_impl.cc

Issue 1917043002: cc: Fix sublayer scale bug in hit testing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « no previous file | cc/trees/layer_tree_impl_unittest.cc » ('j') | cc/trees/layer_tree_impl_unittest.cc » ('J')
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 06b34d3ecc154755d2a71cd9aeb65533a2cc5318..27abf72acedf33e70e1b1cb109b41a7b97295f47 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(!target_layer || target_layer->render_surface());
ajuma 2016/04/25 23:58:17 When is target_layer null here? (That is, when the
jaydasika 2016/04/26 00:49:32 For the root transform node (transform node with i
+ gfx::Transform surface_screen_space_transform =
+ target_layer
+ ? SurfaceScreenSpaceTransform(target_layer, transform_tree)
+ : gfx::Transform();
+ 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
« no previous file with comments | « no previous file | cc/trees/layer_tree_impl_unittest.cc » ('j') | cc/trees/layer_tree_impl_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698