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

Unified Diff: cc/trees/draw_property_utils.cc

Issue 1903073002: cc : Fix sublayer scale bug when there is a transform node b/w targets (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 f86b3017a531a8624fb9f8bffd9e0e92614ef18a..8982605466abbda819e6039e2062a8a5d5f9e4e3 100644
--- a/cc/trees/draw_property_utils.cc
+++ b/cc/trees/draw_property_utils.cc
@@ -473,8 +473,8 @@ void ComputeClips(ClipTree* clip_tree,
ClipNode* parent_clip_node = clip_tree->parent(clip_node);
gfx::Transform parent_to_current;
- const TransformNode* parent_transform_node =
- transform_tree.Node(parent_clip_node->data.transform_id);
+ const TransformNode* parent_target_transform_node =
+ transform_tree.Node(parent_clip_node->data.target_id);
bool success = true;
// Clips must be combined in target space. We cannot, for example, combine
@@ -491,16 +491,17 @@ void ComputeClips(ClipTree* clip_tree,
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 &&
+ if (parent_target_transform_node &&
+ parent_target_transform_node->id != clip_node->data.target_id &&
non_root_surfaces_enabled) {
success &= transform_tree.ComputeTransformWithDestinationSublayerScale(
- parent_clip_node->data.target_id, clip_node->data.target_id,
+ parent_target_transform_node->id, clip_node->data.target_id,
&parent_to_current);
- if (parent_transform_node->data.sublayer_scale.x() > 0 &&
- parent_transform_node->data.sublayer_scale.y() > 0)
+ if (parent_target_transform_node->data.sublayer_scale.x() > 0 &&
+ parent_target_transform_node->data.sublayer_scale.y() > 0)
parent_to_current.Scale(
- 1.f / parent_transform_node->data.sublayer_scale.x(),
- 1.f / parent_transform_node->data.sublayer_scale.y());
+ 1.f / parent_target_transform_node->data.sublayer_scale.x(),
+ 1.f / parent_target_transform_node->data.sublayer_scale.y());
// If we can't compute a transform, it's because we had to use the inverse
// of a singular transform. We won't draw in this case, so there's no need
// to compute clips.
« 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