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

Unified Diff: cc/trees/draw_property_utils.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/clip_node.cc ('k') | cc/trees/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/draw_property_utils.cc
diff --git a/cc/trees/draw_property_utils.cc b/cc/trees/draw_property_utils.cc
index 4eeeec4757c711556a7d69bde6268867c2a74cf8..2be0874d95eb62853bcbc8f51c480b352dd3da51 100644
--- a/cc/trees/draw_property_utils.cc
+++ b/cc/trees/draw_property_utils.cc
@@ -266,12 +266,13 @@ static ConditionalClip ComputeAccumulatedClip(
// TODO(weiliangc): If we don't create clip for render surface, we don't need
// to check applies_local_clip.
- while (!clip_node->applies_local_clip && parent_chain.size() > 0) {
+ while (clip_node->clip_type != ClipNode::ClipType::APPLIES_LOCAL_CLIP &&
+ parent_chain.size() > 0) {
clip_node = parent_chain.top();
parent_chain.pop();
}
- if (!clip_node->applies_local_clip)
+ if (clip_node->clip_type != ClipNode::ClipType::APPLIES_LOCAL_CLIP)
// No clip node applying clip in between.
return ConditionalClip{false, gfx::RectF()};
@@ -283,7 +284,7 @@ static ConditionalClip ComputeAccumulatedClip(
while (parent_chain.size() > 0) {
clip_node = parent_chain.top();
parent_chain.pop();
- if (!clip_node->applies_local_clip) {
+ if (clip_node->clip_type != ClipNode::ClipType::APPLIES_LOCAL_CLIP) {
continue;
}
ConditionalClip current_clip = ComputeCurrentClip(
@@ -856,7 +857,7 @@ void ComputeClips(PropertyTrees* property_trees,
// need to clip using our parent clip and if we don't propagate it here,
// it will be lost.
if (clip_node->resets_clip && non_root_surfaces_enabled) {
- if (clip_node->applies_local_clip) {
+ if (clip_node->clip_type == ClipNode::ClipType::APPLIES_LOCAL_CLIP) {
clip_node->clip_in_target_space = MathUtil::MapClippedRect(
transform_tree.ToTarget(clip_node->transform_id,
clip_node->target_effect_id),
@@ -874,7 +875,8 @@ void ComputeClips(PropertyTrees* property_trees,
ResetIfHasNanCoordinate(&clip_node->combined_clip_in_target_space);
continue;
}
- bool use_only_parent_clip = !clip_node->applies_local_clip;
+ bool use_only_parent_clip =
+ clip_node->clip_type != ClipNode::ClipType::APPLIES_LOCAL_CLIP;
if (use_only_parent_clip) {
clip_node->combined_clip_in_target_space =
parent_combined_clip_in_target_space;
« no previous file with comments | « cc/trees/clip_node.cc ('k') | cc/trees/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698