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 8729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8740 | 8740 |
8741 root->SetBoundsDelta(gfx::Vector2dF(0.0, 50.0)); | 8741 root->SetBoundsDelta(gfx::Vector2dF(0.0, 50.0)); |
8742 | 8742 |
8743 LayerTreeHostCommon::CalculateDrawProperties(&inputs); | 8743 LayerTreeHostCommon::CalculateDrawProperties(&inputs); |
8744 | 8744 |
8745 gfx::Rect affected_by_delta(0, 0, root_size.width(), | 8745 gfx::Rect affected_by_delta(0, 0, root_size.width(), |
8746 root_size.height() + 50); | 8746 root_size.height() + 50); |
8747 EXPECT_EQ(affected_by_delta, sublayer->visible_content_rect()); | 8747 EXPECT_EQ(affected_by_delta, sublayer->visible_content_rect()); |
8748 } | 8748 } |
8749 | 8749 |
| 8750 // Verify that having an animated filter (but no current filter, as these |
| 8751 // are mutually exclusive) correctly creates a render surface. |
| 8752 TEST_F(LayerTreeHostCommonTest, AnimatedFilterCreatesRenderSurface) { |
| 8753 scoped_refptr<Layer> root = Layer::Create(); |
| 8754 scoped_refptr<Layer> child = Layer::Create(); |
| 8755 scoped_refptr<Layer> grandchild = Layer::Create(); |
| 8756 root->AddChild(child); |
| 8757 child->AddChild(grandchild); |
| 8758 |
| 8759 gfx::Transform identity_transform; |
| 8760 SetLayerPropertiesForTesting(root.get(), identity_transform, gfx::Point3F(), |
| 8761 gfx::PointF(), gfx::Size(50, 50), true, false); |
| 8762 SetLayerPropertiesForTesting(child.get(), identity_transform, gfx::Point3F(), |
| 8763 gfx::PointF(), gfx::Size(50, 50), true, false); |
| 8764 SetLayerPropertiesForTesting(grandchild.get(), identity_transform, |
| 8765 gfx::Point3F(), gfx::PointF(), gfx::Size(50, 50), |
| 8766 true, false); |
| 8767 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 8768 host->SetRootLayer(root); |
| 8769 |
| 8770 AddAnimatedFilterToLayer(child.get(), 10.0, 0.1f, 0.2f); |
| 8771 |
| 8772 ExecuteCalculateDrawProperties(root.get()); |
| 8773 |
| 8774 EXPECT_TRUE(root->render_surface()); |
| 8775 EXPECT_TRUE(child->render_surface()); |
| 8776 EXPECT_FALSE(grandchild->render_surface()); |
| 8777 |
| 8778 EXPECT_TRUE(root->filters().IsEmpty()); |
| 8779 EXPECT_TRUE(child->filters().IsEmpty()); |
| 8780 EXPECT_TRUE(grandchild->filters().IsEmpty()); |
| 8781 |
| 8782 EXPECT_FALSE(root->FilterIsAnimating()); |
| 8783 EXPECT_TRUE(child->FilterIsAnimating()); |
| 8784 EXPECT_FALSE(grandchild->FilterIsAnimating()); |
| 8785 } |
| 8786 |
8750 } // namespace | 8787 } // namespace |
8751 } // namespace cc | 8788 } // namespace cc |
OLD | NEW |