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

Unified Diff: cc/trees/property_tree_builder.cc

Issue 1252313004: Add ClipNode when Render Surface Inherits Clip (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Layout tests pass , unit test added , comments on patch 11 Created 5 years, 4 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
« cc/trees/layer_tree_host_common_unittest.cc ('K') | « cc/trees/property_tree.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/property_tree_builder.cc
diff --git a/cc/trees/property_tree_builder.cc b/cc/trees/property_tree_builder.cc
index 93ff9d196d03f3e2ac1a6bd459447124926ff03e..b42e844d521aa2ac0e61239966107c82ff502d5b 100644
--- a/cc/trees/property_tree_builder.cc
+++ b/cc/trees/property_tree_builder.cc
@@ -79,11 +79,7 @@ static bool RequiresClipNode(LayerType* layer,
if (!render_surface_applies_clip)
return false;
- bool axis_aligned_with_respect_to_parent =
- data.transform_tree->Are2DAxisAligned(layer->transform_tree_index(),
- parent_transform_id);
-
- return !axis_aligned_with_respect_to_parent;
+ return !!layer->parent();
}
template <typename LayerType>
@@ -122,7 +118,7 @@ void AddClipNodeIfNeeded(const DataForRecursion<LayerType>& data_from_ancestor,
parent_id = 0;
if (!RequiresClipNode(layer, data_from_ancestor, parent->data.transform_id,
- data_for_children->ancestor_clips_subtree)) {
+ ancestor_clips_subtree)) {
// Unclipped surfaces reset the clip rect.
data_for_children->clip_tree_parent = parent_id;
} else {
@@ -138,7 +134,9 @@ void AddClipNodeIfNeeded(const DataForRecursion<LayerType>& data_from_ancestor,
node.data.target_id =
data_for_children->render_target->transform_tree_index();
node.owner_id = layer->id();
-
+ node.data.inherit_parent_target_space_clip =
+ !data_for_children->ancestor_clips_subtree &&
+ layer->has_render_surface() && ancestor_clips_subtree;
data_for_children->clip_tree_parent =
data_for_children->clip_tree->Insert(node, parent_id);
}
« cc/trees/layer_tree_host_common_unittest.cc ('K') | « cc/trees/property_tree.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698