| Index: cc/trees/layer_tree_host_common_unittest.cc
|
| diff --git a/cc/trees/layer_tree_host_common_unittest.cc b/cc/trees/layer_tree_host_common_unittest.cc
|
| index 01941c1364a37436f78657504adf8bd18ace9268..0165eba0b3e298b086a1d1505a5a2b687ba82406 100644
|
| --- a/cc/trees/layer_tree_host_common_unittest.cc
|
| +++ b/cc/trees/layer_tree_host_common_unittest.cc
|
| @@ -6,6 +6,7 @@
|
|
|
| #include <algorithm>
|
| #include <set>
|
| +#include <tuple>
|
|
|
| #include "cc/animation/layer_animation_controller.h"
|
| #include "cc/animation/transform_operations.h"
|
| @@ -7510,110 +7511,6 @@ TEST_F(LayerTreeHostCommonTest, OutOfOrderClippingRequiresRSLLSorting) {
|
| EXPECT_TRUE(render_surface_layer_list.at(2)->render_surface());
|
| }
|
|
|
| -TEST_F(LayerTreeHostCommonTest, DoNotClobberSorting) {
|
| - // We rearrange layer list contributions if we have to visit children out of
|
| - // order, but it should be a 'stable' rearrangement. That is, the layer list
|
| - // additions for a single layer should not be reordered, though their position
|
| - // wrt to the contributions due to a sibling may vary.
|
| - //
|
| - // + root
|
| - // + scroll_child
|
| - // + top_content
|
| - // + bottom_content
|
| - // + scroll_parent_border
|
| - // + scroll_parent_clip
|
| - // + scroll_parent
|
| - //
|
| - FakeImplProxy proxy;
|
| - TestSharedBitmapManager shared_bitmap_manager;
|
| - FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager);
|
| - host_impl.CreatePendingTree();
|
| - scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl.active_tree(), 1);
|
| - scoped_ptr<LayerImpl> scroll_parent_border =
|
| - LayerImpl::Create(host_impl.active_tree(), 2);
|
| - scoped_ptr<LayerImpl> scroll_parent_clip =
|
| - LayerImpl::Create(host_impl.active_tree(), 3);
|
| - scoped_ptr<LayerImpl> scroll_parent =
|
| - LayerImpl::Create(host_impl.active_tree(), 4);
|
| - scoped_ptr<LayerImpl> scroll_child =
|
| - LayerImpl::Create(host_impl.active_tree(), 5);
|
| - scoped_ptr<LayerImpl> bottom_content =
|
| - LayerImpl::Create(host_impl.active_tree(), 6);
|
| - scoped_ptr<LayerImpl> top_content =
|
| - LayerImpl::Create(host_impl.active_tree(), 7);
|
| -
|
| - scroll_parent_clip->SetMasksToBounds(true);
|
| -
|
| - scroll_child->SetScrollParent(scroll_parent.get());
|
| - scoped_ptr<std::set<LayerImpl*>> scroll_children(new std::set<LayerImpl*>);
|
| - scroll_children->insert(scroll_child.get());
|
| - scroll_parent->SetScrollChildren(scroll_children.release());
|
| -
|
| - scroll_child->SetDrawsContent(true);
|
| - scroll_parent->SetDrawsContent(true);
|
| - top_content->SetDrawsContent(true);
|
| - bottom_content->SetDrawsContent(true);
|
| -
|
| - gfx::Transform identity_transform;
|
| - gfx::Transform top_transform;
|
| - top_transform.Translate3d(0.0, 0.0, 5.0);
|
| - gfx::Transform bottom_transform;
|
| - bottom_transform.Translate3d(0.0, 0.0, 3.0);
|
| -
|
| - SetLayerPropertiesForTesting(root.get(), identity_transform, gfx::Point3F(),
|
| - gfx::PointF(), gfx::Size(50, 50), true, false,
|
| - true);
|
| - SetLayerPropertiesForTesting(scroll_parent_border.get(), identity_transform,
|
| - gfx::Point3F(), gfx::PointF(), gfx::Size(40, 40),
|
| - true, false, false);
|
| - SetLayerPropertiesForTesting(scroll_parent_clip.get(), identity_transform,
|
| - gfx::Point3F(), gfx::PointF(), gfx::Size(30, 30),
|
| - true, false, false);
|
| - SetLayerPropertiesForTesting(scroll_parent.get(), identity_transform,
|
| - gfx::Point3F(), gfx::PointF(), gfx::Size(50, 50),
|
| - true, false, false);
|
| - SetLayerPropertiesForTesting(scroll_child.get(), identity_transform,
|
| - gfx::Point3F(), gfx::PointF(), gfx::Size(50, 50),
|
| - true, false, false);
|
| - SetLayerPropertiesForTesting(top_content.get(), top_transform, gfx::Point3F(),
|
| - gfx::PointF(), gfx::Size(50, 50), false, true,
|
| - true);
|
| - SetLayerPropertiesForTesting(bottom_content.get(), bottom_transform,
|
| - gfx::Point3F(), gfx::PointF(), gfx::Size(50, 50),
|
| - false, true, true);
|
| -
|
| - scroll_child->SetShouldFlattenTransform(false);
|
| - scroll_child->Set3dSortingContextId(1);
|
| -
|
| - scroll_child->AddChild(top_content.Pass());
|
| - scroll_child->AddChild(bottom_content.Pass());
|
| - root->AddChild(scroll_child.Pass());
|
| -
|
| - scroll_parent_clip->AddChild(scroll_parent.Pass());
|
| - scroll_parent_border->AddChild(scroll_parent_clip.Pass());
|
| - root->AddChild(scroll_parent_border.Pass());
|
| -
|
| - LayerImplList render_surface_layer_list;
|
| - LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs(
|
| - root.get(), root->bounds(), &render_surface_layer_list);
|
| -
|
| - LayerTreeHostCommon::CalculateDrawProperties(&inputs);
|
| -
|
| - EXPECT_TRUE(root->render_surface());
|
| -
|
| - // If we don't sort by depth and let the layers get added in the order they
|
| - // would normally be visited in, then layers 6 and 7 will be out of order. In
|
| - // other words, although we've had to shift 5, 6, and 7 to appear before 4
|
| - // in the list (because of the scroll parent relationship), this should not
|
| - // have an effect on the the order of 5, 6, and 7 (which had been reordered
|
| - // due to layer sorting).
|
| - EXPECT_EQ(4u, root->render_surface()->layer_list().size());
|
| - EXPECT_EQ(5, root->render_surface()->layer_list().at(0)->id());
|
| - EXPECT_EQ(6, root->render_surface()->layer_list().at(1)->id());
|
| - EXPECT_EQ(7, root->render_surface()->layer_list().at(2)->id());
|
| - EXPECT_EQ(4, root->render_surface()->layer_list().at(3)->id());
|
| -}
|
| -
|
| TEST_F(LayerTreeHostCommonTest, ScrollCompensationWithRounding) {
|
| // This test verifies that a scrolling layer that gets snapped to
|
| // integer coordinates doesn't move a fixed position child.
|
|
|