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

Unified Diff: cc/trees/draw_property_utils.cc

Issue 1252313004: Add ClipNode when Render Surface Inherits Clip (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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/property_tree.h » ('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 175c33415100440aa966860f8d6a576a48d6f30e..30ae9692b6df96d7b924486969de33ae12c6fe96 100644
--- a/cc/trees/draw_property_utils.cc
+++ b/cc/trees/draw_property_utils.cc
@@ -417,8 +417,11 @@ void ComputeClips(ClipTree* clip_tree, const TransformTree& transform_tree) {
target_is_root_surface ? 0 : clip_node->data.target_id;
bool success = true;
- if (parent_transform_node->data.content_target_id ==
- clip_node->data.target_id) {
+ if (clip_node->data.render_surface_applies_clip) {
+ success &= transform_tree.ComputeTransform(transform_node->data.target_id,
+ target_id, &parent_to_target);
ajuma 2015/07/29 16:44:29 I'm having trouble following this. parent_to_targe
jaydasika 2015/07/30 19:43:10 Done.
+ } else if (parent_transform_node->data.content_target_id ==
+ clip_node->data.target_id) {
parent_to_target = parent_transform_node->data.to_target;
} else {
success &= transform_tree.ComputeTransformWithDestinationSublayerScale(
@@ -448,8 +451,14 @@ void ComputeClips(ClipTree* clip_tree, const TransformTree& transform_tree) {
// In order to intersect with as small a rect as possible, we do a
// preliminary clip in target space so that when we project back, there's
// less likelihood of intersecting the view plane.
- gfx::RectF inherited_clip_in_target_space = MathUtil::MapClippedRect(
- parent_to_target, parent_clip_node->data.combined_clip);
+ gfx::RectF inherited_clip_in_target_space;
+ if (parent_transform_node->id > target_id &&
ajuma 2015/07/29 16:44:29 We weren't previously handling the case where pare
jaydasika 2015/07/30 19:43:10 Add a unit test where render surface applies clip.
+ !clip_node->data.render_surface_applies_clip)
+ inherited_clip_in_target_space = MathUtil::MapClippedRect(
+ parent_to_target, parent_clip_node->data.combined_clip);
+ else
+ inherited_clip_in_target_space = MathUtil::ProjectClippedRect(
+ parent_to_target, parent_clip_node->data.combined_clip);
gfx::RectF clip_in_target_space =
MathUtil::MapClippedRect(clip_to_target, clip_node->data.clip);
« no previous file with comments | « no previous file | cc/trees/property_tree.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698