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

Unified Diff: cc/trees/layer_tree_host_common_unittest.cc

Issue 2222163006: Reland use screen space transform to compute translation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 4 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.h » ('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 09e196eeee3e04820a79eeea76bde37fafe61ef4..b76090f8ba2fd8b98c39ca4fd5bd0a9bf952ca94 100644
--- a/cc/trees/layer_tree_host_common_unittest.cc
+++ b/cc/trees/layer_tree_host_common_unittest.cc
@@ -6896,6 +6896,41 @@ TEST_F(LayerTreeHostCommonTest, ScrollSnappingWithScrollChild) {
scroll_child_impl->ScreenSpaceTransform());
}
+TEST_F(LayerTreeHostCommonTest, NonFlatContainerForFixedPosLayer) {
+ scoped_refptr<Layer> root = Layer::Create();
+ scoped_refptr<Layer> container = Layer::Create();
+ scoped_refptr<Layer> scroller = Layer::Create();
+ scoped_refptr<Layer> fixed_pos = Layer::Create();
+
+ scroller->SetIsContainerForFixedPositionLayers(true);
+ root->AddChild(container);
+ container->AddChild(scroller);
+ scroller->AddChild(fixed_pos);
+ host()->SetRootLayer(root);
+
+ LayerPositionConstraint fixed_position;
+ fixed_position.set_is_fixed_position(true);
+ scroller->SetScrollClipLayerId(container->id());
+ fixed_pos->SetPositionConstraint(fixed_position);
+
+ root->SetBounds(gfx::Size(50, 50));
+ container->SetBounds(gfx::Size(50, 50));
+ scroller->SetBounds(gfx::Size(50, 50));
+ fixed_pos->SetBounds(gfx::Size(50, 50));
+
+ gfx::Transform rotate;
+ rotate.RotateAboutXAxis(20);
+ container->SetTransform(rotate);
+
+ ExecuteCalculateDrawProperties(root.get());
+ TransformTree& tree =
+ root->layer_tree_host()->property_trees()->transform_tree;
+ gfx::Transform transform;
+ tree.ComputeTranslation(fixed_pos->transform_tree_index(),
+ container->transform_tree_index(), &transform);
+ EXPECT_TRUE(transform.IsIdentity());
+}
+
TEST_F(LayerTreeHostCommonTest, ScrollSnappingWithFixedPosChild) {
// This test verifies that a fixed pos child of a scrolling layer doesn't get
// snapped to integer coordinates.
« no previous file with comments | « no previous file | cc/trees/property_tree.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698