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

Unified Diff: cc/trees/layer_tree_host_common_unittest.cc

Issue 957703004: cc: Fix animated filter render surface check (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 10 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/layer_tree_host_common.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 9c524b6db9bb564c269df4ed3730afd3a63fbdad..6f05035428a285c7fc1f13411b77b6a52f067b07 100644
--- a/cc/trees/layer_tree_host_common_unittest.cc
+++ b/cc/trees/layer_tree_host_common_unittest.cc
@@ -8775,5 +8775,42 @@ TEST_F(LayerTreeHostCommonTest, VisibleContentRectForAnimatedLayer) {
EXPECT_FALSE(animated->visible_rect_from_property_trees().IsEmpty());
}
+// Verify that having an animated filter (but no current filter, as these
+// are mutually exclusive) correctly creates a render surface.
+TEST_F(LayerTreeHostCommonTest, AnimatedFilterCreatesRenderSurface) {
+ scoped_refptr<Layer> root = Layer::Create();
+ scoped_refptr<Layer> child = Layer::Create();
+ scoped_refptr<Layer> grandchild = Layer::Create();
+ root->AddChild(child);
+ child->AddChild(grandchild);
+
+ gfx::Transform identity_transform;
+ SetLayerPropertiesForTesting(root.get(), identity_transform, gfx::Point3F(),
+ gfx::PointF(), gfx::Size(50, 50), true, false);
+ SetLayerPropertiesForTesting(child.get(), identity_transform, gfx::Point3F(),
+ gfx::PointF(), gfx::Size(50, 50), true, false);
+ SetLayerPropertiesForTesting(grandchild.get(), identity_transform,
+ gfx::Point3F(), gfx::PointF(), gfx::Size(50, 50),
+ true, false);
+ scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost());
+ host->SetRootLayer(root);
+
+ AddAnimatedFilterToLayer(child.get(), 10.0, 0.1f, 0.2f);
+
+ ExecuteCalculateDrawProperties(root.get());
+
+ EXPECT_TRUE(root->render_surface());
+ EXPECT_TRUE(child->render_surface());
+ EXPECT_FALSE(grandchild->render_surface());
+
+ EXPECT_TRUE(root->filters().IsEmpty());
+ EXPECT_TRUE(child->filters().IsEmpty());
+ EXPECT_TRUE(grandchild->filters().IsEmpty());
+
+ EXPECT_FALSE(root->FilterIsAnimating());
+ EXPECT_TRUE(child->FilterIsAnimating());
+ EXPECT_FALSE(grandchild->FilterIsAnimating());
+}
+
} // namespace
} // namespace cc
« no previous file with comments | « cc/trees/layer_tree_host_common.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698