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

Unified Diff: cc/trees/layer_tree_host_common_unittest.cc

Issue 967163002: Property tree code must account for parent offsets of fixed layers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated comment. Created 5 years, 10 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_builder.cc » ('j') | cc/trees/property_tree_builder.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6f05035428a285c7fc1f13411b77b6a52f067b07..b6c3f67ffd0a78e82f18a6cf998bb2d6ccc4830f 100644
--- a/cc/trees/layer_tree_host_common_unittest.cc
+++ b/cc/trees/layer_tree_host_common_unittest.cc
@@ -8812,5 +8812,42 @@ TEST_F(LayerTreeHostCommonTest, AnimatedFilterCreatesRenderSurface) {
EXPECT_FALSE(grandchild->FilterIsAnimating());
}
+// Ensures that the property tree code accounts for offsets between fixed
+// position layers and their respective containers.
+TEST_F(LayerTreeHostCommonTest, PropertyTreesAccountForFixedParentOffset) {
+ scoped_refptr<Layer> root = Layer::Create();
+ scoped_refptr<Layer> child = Layer::Create();
+ scoped_refptr<LayerWithForcedDrawsContent> grandchild =
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
+
+ root->AddChild(child);
+ child->AddChild(grandchild);
+
+ gfx::Transform identity_transform;
+ SetLayerPropertiesForTesting(root.get(), identity_transform, gfx::Point3F(),
+ gfx::PointF(), gfx::Size(50, 50), true, false);
+ SetLayerPropertiesForTesting(child.get(), identity_transform, gfx::Point3F(),
+ gfx::PointF(1000, 1000), gfx::Size(50, 50), true,
+ false);
+ SetLayerPropertiesForTesting(grandchild.get(), identity_transform,
+ gfx::Point3F(), gfx::PointF(-1000, -1000),
+ gfx::Size(50, 50), true, false);
+
+ root->SetMasksToBounds(true);
+ root->SetIsContainerForFixedPositionLayers(true);
+ LayerPositionConstraint constraint;
+ constraint.set_is_fixed_position(true);
+ grandchild->SetPositionConstraint(constraint);
+
+ root->SetIsContainerForFixedPositionLayers(true);
+
+ scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost());
+ host->SetRootLayer(root);
+
+ // Property tree verification will fail if position of child is not accounted
enne (OOO) 2015/03/02 01:12:26 Verification will not persist in the future. Mayb
Ian Vollick 2015/03/02 01:28:00 Great point -- if we were to switch to property tr
+ // for in the tree building.
+ ExecuteCalculateDrawProperties(root.get());
+}
+
} // namespace
} // namespace cc
« no previous file with comments | « no previous file | cc/trees/property_tree_builder.cc » ('j') | cc/trees/property_tree_builder.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698