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

Unified Diff: cc/trees/layer_tree_host_common_unittest.cc

Issue 328753002: Clean up PointIsClippedBySurfaceOrClipRect (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 6 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/layer_tree_impl.cc » ('j') | cc/trees/layer_tree_impl_unittest.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 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();
« no previous file with comments | « no previous file | cc/trees/layer_tree_impl.cc » ('j') | cc/trees/layer_tree_impl_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698