Commit 4de4c083 authored by jaydasika's avatar jaydasika Committed by Commit bot

cc : Remove invalid DCHECK from draw_property_utils.cc

The DCHECK is invalid because we can have a render surface between the
target of scroll parent and scroll child.

BUG=663499
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel

Review-Url: https://codereview.chromium.org/2537053002
Cr-Commit-Position: refs/heads/master@{#435008}
parent a38ed643
......@@ -1229,10 +1229,15 @@ static void SetSurfaceClipRect(const ClipNode* parent_clip_node,
return;
}
DCHECK_LT(parent_clip_node->target_transform_id,
transform_tree.TargetId(transform_node->id));
render_surface->SetClipRect(gfx::ToEnclosingRect(MathUtil::ProjectClippedRect(
clip_parent_target_to_target, parent_clip_node->clip_in_target_space)));
if (parent_clip_node->target_transform_id <
transform_tree.TargetId(transform_node->id)) {
render_surface->SetClipRect(gfx::ToEnclosingRect(
MathUtil::ProjectClippedRect(clip_parent_target_to_target,
parent_clip_node->clip_in_target_space)));
} else {
render_surface->SetClipRect(gfx::ToEnclosingRect(MathUtil::MapClippedRect(
clip_parent_target_to_target, parent_clip_node->clip_in_target_space)));
}
}
template <typename LayerType>
......
......@@ -6302,6 +6302,50 @@ TEST_F(LayerTreeHostCommonTest, ScrollChildAndScrollParentDifferentTargets) {
EXPECT_TRANSFORMATION_MATRIX_EQ(scroll_child->DrawTransform(), scale);
}
TEST_F(LayerTreeHostCommonTest, TargetBetweenScrollChildandScrollParentTarget) {
LayerImpl* root = root_layer_for_testing();
LayerImpl* scroll_child_target = AddChildToRoot<LayerImpl>();
LayerImpl* scroll_child = AddChild<LayerImpl>(scroll_child_target);
LayerImpl* child_of_scroll_child = AddChild<LayerImpl>(scroll_child);
LayerImpl* intervening_target = AddChild<LayerImpl>(scroll_child_target);
LayerImpl* clip = AddChild<LayerImpl>(intervening_target);
LayerImpl* scroll_parent_target = AddChild<LayerImpl>(clip);
LayerImpl* scroll_parent = AddChild<LayerImpl>(scroll_parent_target);
scroll_parent->SetDrawsContent(true);
child_of_scroll_child->SetDrawsContent(true);
scroll_child->test_properties()->scroll_parent = scroll_parent;
scroll_parent->test_properties()->scroll_children =
base::MakeUnique<std::set<LayerImpl*>>();
scroll_parent->test_properties()->scroll_children->insert(scroll_child);
root->SetBounds(gfx::Size(50, 50));
scroll_child_target->SetBounds(gfx::Size(50, 50));
scroll_child_target->SetMasksToBounds(true);
scroll_child_target->test_properties()->force_render_surface = true;
scroll_child->SetBounds(gfx::Size(50, 50));
child_of_scroll_child->SetBounds(gfx::Size(50, 50));
child_of_scroll_child->test_properties()->force_render_surface = true;
intervening_target->SetBounds(gfx::Size(50, 50));
intervening_target->test_properties()->force_render_surface = true;
clip->SetBounds(gfx::Size(50, 50));
clip->SetMasksToBounds(true);
scroll_parent_target->SetBounds(gfx::Size(50, 50));
scroll_parent_target->SetMasksToBounds(true);
scroll_parent_target->test_properties()->force_render_surface = true;
scroll_parent->SetBounds(gfx::Size(50, 50));
ExecuteCalculateDrawProperties(root);
PropertyTrees* property_trees = root->layer_tree_impl()->property_trees();
ClipNode* clip_node =
property_trees->clip_tree.Node(child_of_scroll_child->clip_tree_index());
ClipNode* parent_clip_node = property_trees->clip_tree.parent(clip_node);
DCHECK_GT(parent_clip_node->target_transform_id,
property_trees->transform_tree.TargetId(
child_of_scroll_child->transform_tree_index()));
}
TEST_F(LayerTreeHostCommonTest, SingularTransformSubtreesDoNotDraw) {
LayerImpl* root = root_layer_for_testing();
LayerImpl* parent = AddChildToRoot<LayerImpl>();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment