Index: cc/trees/draw_property_utils.cc |
diff --git a/cc/trees/draw_property_utils.cc b/cc/trees/draw_property_utils.cc |
index 175c33415100440aa966860f8d6a576a48d6f30e..30ae9692b6df96d7b924486969de33ae12c6fe96 100644 |
--- a/cc/trees/draw_property_utils.cc |
+++ b/cc/trees/draw_property_utils.cc |
@@ -417,8 +417,11 @@ void ComputeClips(ClipTree* clip_tree, const TransformTree& transform_tree) { |
target_is_root_surface ? 0 : clip_node->data.target_id; |
bool success = true; |
- if (parent_transform_node->data.content_target_id == |
- clip_node->data.target_id) { |
+ if (clip_node->data.render_surface_applies_clip) { |
+ success &= transform_tree.ComputeTransform(transform_node->data.target_id, |
+ target_id, &parent_to_target); |
ajuma
2015/07/29 16:44:29
I'm having trouble following this. parent_to_targe
jaydasika
2015/07/30 19:43:10
Done.
|
+ } else if (parent_transform_node->data.content_target_id == |
+ clip_node->data.target_id) { |
parent_to_target = parent_transform_node->data.to_target; |
} else { |
success &= transform_tree.ComputeTransformWithDestinationSublayerScale( |
@@ -448,8 +451,14 @@ void ComputeClips(ClipTree* clip_tree, const TransformTree& transform_tree) { |
// In order to intersect with as small a rect as possible, we do a |
// preliminary clip in target space so that when we project back, there's |
// less likelihood of intersecting the view plane. |
- gfx::RectF inherited_clip_in_target_space = MathUtil::MapClippedRect( |
- parent_to_target, parent_clip_node->data.combined_clip); |
+ gfx::RectF inherited_clip_in_target_space; |
+ if (parent_transform_node->id > target_id && |
ajuma
2015/07/29 16:44:29
We weren't previously handling the case where pare
jaydasika
2015/07/30 19:43:10
Add a unit test where render surface applies clip.
|
+ !clip_node->data.render_surface_applies_clip) |
+ inherited_clip_in_target_space = MathUtil::MapClippedRect( |
+ parent_to_target, parent_clip_node->data.combined_clip); |
+ else |
+ inherited_clip_in_target_space = MathUtil::ProjectClippedRect( |
+ parent_to_target, parent_clip_node->data.combined_clip); |
gfx::RectF clip_in_target_space = |
MathUtil::MapClippedRect(clip_to_target, clip_node->data.clip); |