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

Unified Diff: cc/trees/layer_tree_host_common_unittest.cc

Issue 1994213002: cc: Update effect_tree backface visibility when transform is updated. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resolve comments in unit test Created 4 years, 7 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 | « cc/trees/draw_property_utils.cc ('k') | no next file » | 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 77b1c68ecfdbc6706f62c28daa671f52dcecd8b2..2fa2494fa9b22eb636b889a372366b3c8f07c3eb 100644
--- a/cc/trees/layer_tree_host_common_unittest.cc
+++ b/cc/trees/layer_tree_host_common_unittest.cc
@@ -6391,6 +6391,56 @@ TEST_F(LayerTreeHostCommonTest, DoNotIncludeBackfaceInvisibleLayers) {
EXPECT_FALSE(grand_child->use_local_transform_for_backface_visibility());
}
+TEST_F(LayerTreeHostCommonTest, TransformAnimationUpdatesBackfaceVisibility) {
+ LayerImpl* root = root_layer();
+ LayerImpl* back_facing = AddChild<LayerImpl>(root);
+ LayerImpl* render_surface1 = AddChild<LayerImpl>(back_facing);
+ LayerImpl* render_surface2 = AddChild<LayerImpl>(back_facing);
+
+ gfx::Transform identity_transform;
+ gfx::Transform rotate_about_y;
+ rotate_about_y.RotateAboutYAxis(180.0);
+ SetLayerPropertiesForTesting(root, identity_transform, gfx::Point3F(),
+ gfx::PointF(), gfx::Size(50, 50), false, true,
+ true);
+ SetLayerPropertiesForTesting(back_facing, rotate_about_y, gfx::Point3F(),
+ gfx::PointF(), gfx::Size(50, 50), false, true,
+ false);
+ SetLayerPropertiesForTesting(render_surface1, identity_transform,
+ gfx::Point3F(), gfx::PointF(), gfx::Size(30, 30),
+ false, true, true);
+ SetLayerPropertiesForTesting(render_surface2, identity_transform,
+ gfx::Point3F(), gfx::PointF(), gfx::Size(30, 30),
+ false, true, true);
+
+ render_surface1->test_properties()->double_sided = false;
+ render_surface2->test_properties()->double_sided = false;
+
+ ExecuteCalculateDrawProperties(root);
+
+ const EffectTree& tree =
+ root->layer_tree_impl()->property_trees()->effect_tree;
+ EXPECT_TRUE(tree.Node(render_surface1->effect_tree_index())
+ ->data.hidden_by_backface_visibility);
+ EXPECT_TRUE(tree.Node(render_surface2->effect_tree_index())
+ ->data.hidden_by_backface_visibility);
+
+ back_facing->OnTransformAnimated(identity_transform);
+ render_surface2->OnTransformAnimated(rotate_about_y);
+ ExecuteCalculateDrawProperties(root);
+ EXPECT_FALSE(tree.Node(render_surface1->effect_tree_index())
+ ->data.hidden_by_backface_visibility);
+ EXPECT_TRUE(tree.Node(render_surface2->effect_tree_index())
+ ->data.hidden_by_backface_visibility);
+
+ render_surface1->OnTransformAnimated(rotate_about_y);
+ ExecuteCalculateDrawProperties(root);
+ EXPECT_TRUE(tree.Node(render_surface1->effect_tree_index())
+ ->data.hidden_by_backface_visibility);
+ EXPECT_TRUE(tree.Node(render_surface2->effect_tree_index())
+ ->data.hidden_by_backface_visibility);
+}
+
TEST_F(LayerTreeHostCommonTest, ClippedByScrollParent) {
// Checks that the simple case (being clipped by a scroll parent that would
// have been processed before you anyhow) results in the right clips.
« no previous file with comments | « cc/trees/draw_property_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698