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

Unified Diff: cc/trees/layer_tree_host_common_unittest.cc

Issue 994843002: Account for fixed positioning once when computing parent offset (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 9 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') | no next file with comments »
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 0a51cccfc0b61706e26f37be82fb7f6ffd2afc85..d10668e956bc8ecfa845f39fa8be899fcdc46a61 100644
--- a/cc/trees/layer_tree_host_common_unittest.cc
+++ b/cc/trees/layer_tree_host_common_unittest.cc
@@ -8904,5 +8904,40 @@ TEST_F(LayerTreeHostCommonTest, CombineClipsUsingContentTarget) {
ExecuteCalculateDrawProperties(root.get());
}
+TEST_F(LayerTreeHostCommonTest, OnlyApplyFixedPositioningOnce) {
+ gfx::Transform identity;
+ gfx::Transform translateZ;
ajuma 2015/03/20 18:15:34 nit: translate_z
Ian Vollick 2015/03/20 20:23:20 Done.
+ translateZ.Translate3d(0, 0, 10);
+
+ scoped_refptr<Layer> root = Layer::Create();
+ SetLayerPropertiesForTesting(root.get(), identity, gfx::Point3F(),
+ gfx::PointF(), gfx::Size(800, 800), true, false);
+ root->SetIsContainerForFixedPositionLayers(true);
+
+ scoped_refptr<Layer> frame_clip = Layer::Create();
+ SetLayerPropertiesForTesting(frame_clip.get(), translateZ, gfx::Point3F(),
+ gfx::PointF(500, 100), gfx::Size(100, 100), true,
+ false);
+ frame_clip->SetMasksToBounds(true);
+
+ scoped_refptr<LayerWithForcedDrawsContent> fixed =
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
+ SetLayerPropertiesForTesting(fixed.get(), identity, gfx::Point3F(),
+ gfx::PointF(), gfx::Size(1000, 1000), true,
+ false);
+
+ LayerPositionConstraint constraint;
+ constraint.set_is_fixed_position(true);
+ fixed->SetPositionConstraint(constraint);
+
+ root->AddChild(frame_clip);
+ frame_clip->AddChild(fixed);
+
+ scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost());
+ host->SetRootLayer(root);
+
+ ExecuteCalculateDrawProperties(root.get());
ajuma 2015/03/20 18:15:35 It'd be good to add 'EXPECT' lines here so this co
Ian Vollick 2015/03/20 20:23:20 Done.
+}
+
} // namespace
} // namespace cc
« no previous file with comments | « no previous file | cc/trees/property_tree_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698