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

Unified Diff: cc/trees/property_tree_builder.cc

Issue 2437923002: cc: Change ClipNode::applies_local_clip to a clip_type enum (Closed)
Patch Set: Fix Windows build Created 4 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/layer_tree_impl.cc ('k') | cc/trees/property_tree_unittest.cc » ('j') | 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 2ad73f16529b919037f8de37bb3761280031b17b..9cb1636d13da98f8f8b2d69f5079e13c5c486912 100644
--- a/cc/trees/property_tree_builder.cc
+++ b/cc/trees/property_tree_builder.cc
@@ -369,7 +369,7 @@ void AddClipNodeIfNeeded(const DataForRecursion<LayerType>& data_from_ancestor,
// of its own, but clips from ancestor nodes don't need to be considered
// when computing clip rects or visibility.
has_unclipped_surface = true;
- DCHECK(!parent->applies_local_clip);
+ DCHECK_NE(parent->clip_type, ClipNode::ClipType::APPLIES_LOCAL_CLIP);
}
// A surface with unclipped descendants cannot be clipped by its ancestor
// clip at draw time since the unclipped descendants aren't affected by the
@@ -429,7 +429,10 @@ void AddClipNodeIfNeeded(const DataForRecursion<LayerType>& data_from_ancestor,
node.layer_clipping_uses_only_local_clip = false;
}
- node.applies_local_clip = layer_clips_subtree;
+ if (layer_clips_subtree)
+ node.clip_type = ClipNode::ClipType::APPLIES_LOCAL_CLIP;
+ else
+ node.clip_type = ClipNode::ClipType::NONE;
node.resets_clip = has_unclipped_surface;
node.target_is_clipped = data_for_children->target_is_clipped;
node.layers_are_clipped = layers_are_clipped;
@@ -1388,7 +1391,7 @@ void BuildPropertyTreesTopLevelInternal(
ClipNode root_clip;
root_clip.resets_clip = true;
- root_clip.applies_local_clip = true;
+ root_clip.clip_type = ClipNode::ClipType::APPLIES_LOCAL_CLIP;
root_clip.clip = gfx::RectF(viewport);
root_clip.transform_id = kRootPropertyTreeNodeId;
data_for_recursion.clip_tree_parent =
« no previous file with comments | « cc/trees/layer_tree_impl.cc ('k') | cc/trees/property_tree_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698