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

Unified Diff: cc/trees/layer_tree_host_common_unittest.cc

Issue 2169143002: cc: Make animated opacity trigger render surface creation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 a5bfd83427141f109f49c8820ce7fe7020bc6240..0dc7520aa0e82e937a54fc0cbbe7c84c8a13b384 100644
--- a/cc/trees/layer_tree_host_common_unittest.cc
+++ b/cc/trees/layer_tree_host_common_unittest.cc
@@ -8482,6 +8482,34 @@ TEST_F(LayerTreeHostCommonTest,
descendant_of_animation->visible_layer_rect_for_testing());
}
+// Verify that having animated opacity but current opacity 1 still creates
+// a render surface.
+TEST_F(LayerTreeHostCommonTest, AnimatedOpacityCreatesRenderSurface) {
+ LayerImpl* root = root_layer_for_testing();
+ LayerImpl* child = AddChild<LayerImpl>(root);
+ LayerImpl* grandchild = AddChild<LayerImpl>(child);
+ child->SetDrawsContent(true);
+ grandchild->SetDrawsContent(true);
+
+ gfx::Transform identity_transform;
+ SetLayerPropertiesForTesting(root, identity_transform, gfx::Point3F(),
+ gfx::PointF(), gfx::Size(50, 50), true, false);
+ SetLayerPropertiesForTesting(child, identity_transform, gfx::Point3F(),
+ gfx::PointF(), gfx::Size(50, 50), true, false);
+ SetLayerPropertiesForTesting(grandchild, identity_transform, gfx::Point3F(),
+ gfx::PointF(), gfx::Size(50, 50), true, false);
+
+ SetElementIdsForTesting();
+ AddOpacityTransitionToElementWithPlayer(child->element_id(), timeline_impl(),
+ 10.0, 1.f, 0.2f, false);
+ ExecuteCalculateDrawProperties(root);
+
+ EXPECT_EQ(1.f, child->Opacity());
+ EXPECT_TRUE(root->has_render_surface());
+ EXPECT_TRUE(child->has_render_surface());
+ EXPECT_FALSE(grandchild->has_render_surface());
+}
+
// Verify that having an animated filter (but no current filter, as these
// are mutually exclusive) correctly creates a render surface.
TEST_F(LayerTreeHostCommonTest, AnimatedFilterCreatesRenderSurface) {
« 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