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

Unified Diff: cc/trees/property_tree_builder.cc

Issue 1387003002: cc: Make property trees support resourceless draw mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@DontReparentUnclippedClipNodes
Patch Set: Created 5 years, 2 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/draw_property_utils.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 0a7fa29d3cabb16eb19fa29855e1f6d0f704edf3..e9edebf9ddb99c4cb947cfbc9b4e85effa4d4c48 100644
--- a/cc/trees/property_tree_builder.cc
+++ b/cc/trees/property_tree_builder.cc
@@ -138,6 +138,12 @@ void AddClipNodeIfNeeded(const DataForRecursion<LayerType>& data_from_ancestor,
if (layer_clips_subtree)
layers_are_clipped = true;
+ // Without surfaces, all non-viewport clips have to be applied using layer
+ // clipping.
+ bool layers_are_clipped_when_surfaces_disabled =
+ layer_clips_subtree ||
+ parent->data.layers_are_clipped_when_surfaces_disabled;
+
bool applies_clip =
AppliesClip(layer, data_from_ancestor, ancestor_clips_subtree);
bool parent_applies_clip =
@@ -153,6 +159,8 @@ void AddClipNodeIfNeeded(const DataForRecursion<LayerType>& data_from_ancestor,
if (!requires_node) {
jaydasika 2015/10/16 21:27:09 In the resourceless draw mode case, can we not jus
ajuma 2015/10/16 22:40:41 It's true that these are the only clips we have to
data_for_children->clip_tree_parent = parent_id;
DCHECK_EQ(layers_are_clipped, parent->data.layers_are_clipped);
+ DCHECK_EQ(layers_are_clipped_when_surfaces_disabled,
+ parent->data.layers_are_clipped_when_surfaces_disabled);
} else {
LayerType* transform_parent = data_for_children->transform_tree_parent;
if (layer->position_constraint().is_fixed_position() &&
@@ -200,6 +208,8 @@ void AddClipNodeIfNeeded(const DataForRecursion<LayerType>& data_from_ancestor,
node.data.resets_clip = has_unclipped_surface || !parent_applies_clip;
node.data.target_is_clipped = data_for_children->target_is_clipped;
node.data.layers_are_clipped = layers_are_clipped;
+ node.data.layers_are_clipped_when_surfaces_disabled =
+ layers_are_clipped_when_surfaces_disabled;
data_for_children->clip_tree_parent =
data_for_children->clip_tree->Insert(node, parent_id);
« cc/trees/draw_property_utils.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