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

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: Rebased 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
« no previous file with comments | « 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 96b1bdd748511a5e4da89e36cc267bf1f8dfe4f1..1207b40de7d996b7d2c360373bd5b60f0562532e 100644
--- a/cc/trees/property_tree_builder.cc
+++ b/cc/trees/property_tree_builder.cc
@@ -139,6 +139,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 = !parent->data.resets_clip;
@@ -153,6 +159,8 @@ void AddClipNodeIfNeeded(const DataForRecursion<LayerType>& data_from_ancestor,
if (!requires_node) {
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() &&
@@ -190,6 +198,8 @@ void AddClipNodeIfNeeded(const DataForRecursion<LayerType>& data_from_ancestor,
node.data.resets_clip = has_unclipped_surface;
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);
« no previous file with comments | « cc/trees/property_tree.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698