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 1c850810bb8f2612cd4b224020d8648fa5cadede..41e477774b75f4fc1d3becd748997ba3c7bda979 100644 |
--- a/cc/trees/layer_tree_host_common_unittest.cc |
+++ b/cc/trees/layer_tree_host_common_unittest.cc |
@@ -156,6 +156,50 @@ TEST_F(LayerTreeHostCommonTest, TransformsForNoOpLayer) { |
grand_child->screen_space_transform()); |
} |
+TEST_F(LayerTreeHostCommonTest, DrawnChildrenRequiresScreenSpaceTransform) { |
+ // Sanity check: For layers positioned at zero, with zero size, |
+ // and with identity transforms, then the draw transform, |
+ // screen space transform, and the hierarchy passed on to children |
+ // layers should also be identity transforms. |
+ |
+ scoped_refptr<Layer> parent = Layer::Create(); |
+ scoped_refptr<Layer> child = Layer::Create(); |
+ scoped_refptr<Layer> grand_child = Layer::Create(); |
+ parent->AddChild(child); |
+ child->AddChild(grand_child); |
+ |
+ scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); |
+ host->SetRootLayer(parent); |
+ |
+ gfx::Transform identity_matrix; |
+ SetLayerPropertiesForTesting(parent.get(), |
+ identity_matrix, |
+ gfx::Point3F(), |
+ gfx::PointF(), |
+ gfx::Size(100, 100), |
+ true, |
+ false); |
+ SetLayerPropertiesForTesting(child.get(), |
+ identity_matrix, |
+ gfx::Point3F(), |
+ gfx::PointF(10, 10), |
+ gfx::Size(100, 100), |
+ true, |
+ false); |
+ child->SetIsDrawable(false); |
+ SetLayerPropertiesForTesting(grand_child.get(), |
+ identity_matrix, |
+ gfx::Point3F(), |
+ gfx::PointF(), |
+ gfx::Size(100, 100), |
+ true, |
+ false); |
+ |
+ ExecuteCalculateDrawProperties(parent.get()); |
+ |
+ EXPECT_FALSE(child->screen_space_transform().IsIdentity()); |
danakj
2014/06/11 22:15:06
Can you verify content_bounds() as well since you
Ian Vollick
2014/06/11 23:50:37
I've added a check for non-empty content bounds, t
|
+} |
+ |
TEST_F(LayerTreeHostCommonTest, TransformsForSingleLayer) { |
gfx::Transform identity_matrix; |
scoped_refptr<Layer> layer = Layer::Create(); |