OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/trees/layer_tree_host_common.h" | 5 #include "cc/trees/layer_tree_host_common.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "cc/animation/layer_animation_controller.h" | 10 #include "cc/animation/layer_animation_controller.h" |
(...skipping 8757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8768 animated->SetOpacity(0.f); | 8768 animated->SetOpacity(0.f); |
8769 | 8769 |
8770 AddOpacityTransitionToController(animated->layer_animation_controller(), 10.0, | 8770 AddOpacityTransitionToController(animated->layer_animation_controller(), 10.0, |
8771 0.f, 1.f, false); | 8771 0.f, 1.f, false); |
8772 | 8772 |
8773 ExecuteCalculateDrawProperties(root.get()); | 8773 ExecuteCalculateDrawProperties(root.get()); |
8774 | 8774 |
8775 EXPECT_FALSE(animated->visible_rect_from_property_trees().IsEmpty()); | 8775 EXPECT_FALSE(animated->visible_rect_from_property_trees().IsEmpty()); |
8776 } | 8776 } |
8777 | 8777 |
| 8778 // Verify that having an animated filter (but no current filter, as these |
| 8779 // are mutually exclusive) correctly creates a render surface. |
| 8780 TEST_F(LayerTreeHostCommonTest, AnimatedFilterCreatesRenderSurface) { |
| 8781 scoped_refptr<Layer> root = Layer::Create(); |
| 8782 scoped_refptr<Layer> child = Layer::Create(); |
| 8783 scoped_refptr<Layer> grandchild = Layer::Create(); |
| 8784 root->AddChild(child); |
| 8785 child->AddChild(grandchild); |
| 8786 |
| 8787 gfx::Transform identity_transform; |
| 8788 SetLayerPropertiesForTesting(root.get(), identity_transform, gfx::Point3F(), |
| 8789 gfx::PointF(), gfx::Size(50, 50), true, false); |
| 8790 SetLayerPropertiesForTesting(child.get(), identity_transform, gfx::Point3F(), |
| 8791 gfx::PointF(), gfx::Size(50, 50), true, false); |
| 8792 SetLayerPropertiesForTesting(grandchild.get(), identity_transform, |
| 8793 gfx::Point3F(), gfx::PointF(), gfx::Size(50, 50), |
| 8794 true, false); |
| 8795 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 8796 host->SetRootLayer(root); |
| 8797 |
| 8798 AddAnimatedFilterToLayer(child.get(), 10.0, 0.1f, 0.2f); |
| 8799 |
| 8800 ExecuteCalculateDrawProperties(root.get()); |
| 8801 |
| 8802 EXPECT_TRUE(root->render_surface()); |
| 8803 EXPECT_TRUE(child->render_surface()); |
| 8804 EXPECT_FALSE(grandchild->render_surface()); |
| 8805 |
| 8806 EXPECT_TRUE(root->filters().IsEmpty()); |
| 8807 EXPECT_TRUE(child->filters().IsEmpty()); |
| 8808 EXPECT_TRUE(grandchild->filters().IsEmpty()); |
| 8809 |
| 8810 EXPECT_FALSE(root->FilterIsAnimating()); |
| 8811 EXPECT_TRUE(child->FilterIsAnimating()); |
| 8812 EXPECT_FALSE(grandchild->FilterIsAnimating()); |
| 8813 } |
| 8814 |
8778 } // namespace | 8815 } // namespace |
8779 } // namespace cc | 8816 } // namespace cc |
OLD | NEW |