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

Unified Diff: cc/trees/draw_property_utils.cc

Issue 1802753002: cc: Correctly inherit clip parent's clip in target space (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 | « no previous file | 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 85bf5d7b9a72cc5853c2a76dfa573eaf9319c877..38492034fbcf2188876566de70cb80cc055b96ae 100644
--- a/cc/trees/draw_property_utils.cc
+++ b/cc/trees/draw_property_utils.cc
@@ -530,6 +530,8 @@ void ComputeClips(ClipTree* clip_tree,
// clip node's target space.
gfx::RectF parent_combined_clip_in_target_space =
parent_clip_node->data.combined_clip_in_target_space;
+ gfx::RectF parent_clip_in_target_space =
+ parent_clip_node->data.clip_in_target_space;
if (parent_clip_node->data.target_id != clip_node->data.target_id &&
non_root_surfaces_enabled) {
success &= transform_tree.ComputeTransformWithDestinationSublayerScale(
@@ -548,6 +550,8 @@ void ComputeClips(ClipTree* clip_tree,
parent_combined_clip_in_target_space = MathUtil::ProjectClippedRect(
parent_to_current,
parent_clip_node->data.combined_clip_in_target_space);
+ parent_clip_in_target_space = MathUtil::ProjectClippedRect(
+ parent_to_current, parent_clip_node->data.clip_in_target_space);
}
// Only nodes affected by ancestor clips will have their clip adjusted due
// to intersecting with an ancestor clip. But, we still need to propagate
@@ -579,8 +583,7 @@ void ComputeClips(ClipTree* clip_tree,
clip_node->data.clip_in_target_space =
parent_clip_node->data.clip_in_target_space;
} else if (!clip_node->data.target_is_clipped) {
- clip_node->data.clip_in_target_space =
- parent_combined_clip_in_target_space;
+ clip_node->data.clip_in_target_space = parent_clip_in_target_space;
} else {
// Render Surface applies clip and the owning layer itself applies
// no clip. So, clip_in_target_space is not used and hence we can set
@@ -615,8 +618,6 @@ void ComputeClips(ClipTree* clip_tree,
: !parent_clip_node->data
.layers_are_clipped_when_surfaces_disabled;
if (!layer_clipping_uses_only_local_clip) {
- gfx::RectF parent_clip_in_target_space = MathUtil::ProjectClippedRect(
- parent_to_current, parent_clip_node->data.clip_in_target_space);
clip_node->data.clip_in_target_space = gfx::IntersectRects(
parent_clip_in_target_space, source_clip_in_target_space);
} else {
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698