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

Unified Diff: cc/trees/layer_tree_host_common_unittest.cc

Issue 2885233002: cc : Create effect nodes for non axis aligned clips (Closed)
Patch Set: rebase Created 3 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 | « 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 89bb2a700e46da6f252fd634f189d54e4f2ab5f3..a26ee7f4559f8ea6d2c656289610dafc390d88fb 100644
--- a/cc/trees/layer_tree_host_common_unittest.cc
+++ b/cc/trees/layer_tree_host_common_unittest.cc
@@ -1341,6 +1341,37 @@ TEST_F(LayerTreeHostCommonTest, RenderSurfaceForNonAxisAlignedClipping) {
EXPECT_TRUE(node->has_render_surface);
}
+TEST_F(LayerTreeHostCommonTest, EffectNodesForNonAxisAlignedClips) {
+ LayerImpl* root = root_layer_for_testing();
+ LayerImpl* rotate_and_clip = AddChildToRoot<LayerImpl>();
+ LayerImpl* only_clip = AddChild<LayerImpl>(rotate_and_clip);
+ LayerImpl* rotate_and_clip2 = AddChild<LayerImpl>(only_clip);
+
+ gfx::Transform rotate;
+ rotate.Rotate(2);
+ root->SetBounds(gfx::Size(10, 10));
+ rotate_and_clip->SetBounds(gfx::Size(10, 10));
+ rotate_and_clip->test_properties()->transform = rotate;
+ rotate_and_clip->SetMasksToBounds(true);
+ only_clip->SetBounds(gfx::Size(10, 10));
+ only_clip->SetMasksToBounds(true);
+ rotate_and_clip2->SetBounds(gfx::Size(10, 10));
+ rotate_and_clip2->test_properties()->transform = rotate;
+ rotate_and_clip2->SetMasksToBounds(true);
+
+ ExecuteCalculateDrawProperties(root);
+ // non-axis aligned clip should create an effect node
+ EXPECT_NE(root->effect_tree_index(), rotate_and_clip->effect_tree_index());
+ // Since only_clip's clip is in the same non-axis aligned space as
+ // rotate_and_clip's clip, no new effect node should be created.
+ EXPECT_EQ(rotate_and_clip->effect_tree_index(),
+ only_clip->effect_tree_index());
+ // rotate_and_clip2's clip and only_clip's clip are in different non-axis
+ // aligned spaces. So, new effect node should be created.
+ EXPECT_NE(rotate_and_clip2->effect_tree_index(),
+ only_clip->effect_tree_index());
+}
+
TEST_F(LayerTreeHostCommonTest,
RenderSurfaceListForRenderSurfaceWithClippedLayer) {
LayerImpl* root = root_layer_for_testing();
« 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