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/layer_tree_host_common.h" | 5 #include "cc/layer_tree_host_common.h" |
6 | 6 |
7 #include "cc/content_layer.h" | 7 #include "cc/content_layer.h" |
8 #include "cc/content_layer_client.h" | 8 #include "cc/content_layer_client.h" |
9 #include "cc/layer.h" | 9 #include "cc/layer.h" |
10 #include "cc/layer_animation_controller.h" | 10 #include "cc/layer_animation_controller.h" |
(...skipping 1664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1675 renderSurface1->addChild(renderSurface2); | 1675 renderSurface1->addChild(renderSurface2); |
1676 renderSurface2->addChild(childOfRS2); | 1676 renderSurface2->addChild(childOfRS2); |
1677 childOfRoot->addChild(grandChildOfRoot); | 1677 childOfRoot->addChild(grandChildOfRoot); |
1678 childOfRS1->addChild(grandChildOfRS1); | 1678 childOfRS1->addChild(grandChildOfRS1); |
1679 childOfRS2->addChild(grandChildOfRS2); | 1679 childOfRS2->addChild(grandChildOfRS2); |
1680 | 1680 |
1681 // Make our render surfaces. | 1681 // Make our render surfaces. |
1682 renderSurface1->setForceRenderSurface(true); | 1682 renderSurface1->setForceRenderSurface(true); |
1683 renderSurface2->setForceRenderSurface(true); | 1683 renderSurface2->setForceRenderSurface(true); |
1684 | 1684 |
1685 // Put an animated opacity on the render surface. | |
1686 addOpacityTransitionToController(*renderSurface1->layerAnimationController()
, 10, 1, 0, false); | |
1687 | |
1688 // Also put an animated opacity on a layer without descendants. | |
1689 addOpacityTransitionToController(*grandChildOfRoot->layerAnimationController
(), 10, 1, 0, false); | |
1690 | |
1691 gfx::Transform layerTransform; | 1685 gfx::Transform layerTransform; |
1692 layerTransform.Translate(1, 1); | 1686 layerTransform.Translate(1, 1); |
1693 gfx::Transform sublayerTransform; | 1687 gfx::Transform sublayerTransform; |
1694 sublayerTransform.Scale3d(10, 1, 1); | 1688 sublayerTransform.Scale3d(10, 1, 1); |
1695 | 1689 |
1696 // Put a transform animation on the render surface. | |
1697 addAnimatedTransformToController(*renderSurface2->layerAnimationController()
, 10, 30, 0); | |
1698 | |
1699 // Also put transform animations on grandChildOfRoot, and grandChildOfRS2 | |
1700 addAnimatedTransformToController(*grandChildOfRoot->layerAnimationController
(), 10, 30, 0); | |
1701 addAnimatedTransformToController(*grandChildOfRS2->layerAnimationController(
), 10, 30, 0); | |
1702 | |
1703 setLayerPropertiesForTesting(parent.get(), layerTransform, sublayerTransform
, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false); | 1690 setLayerPropertiesForTesting(parent.get(), layerTransform, sublayerTransform
, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false); |
1704 setLayerPropertiesForTesting(renderSurface1.get(), layerTransform, sublayerT
ransform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false); | 1691 setLayerPropertiesForTesting(renderSurface1.get(), layerTransform, sublayerT
ransform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false); |
1705 setLayerPropertiesForTesting(renderSurface2.get(), layerTransform, sublayerT
ransform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false); | 1692 setLayerPropertiesForTesting(renderSurface2.get(), layerTransform, sublayerT
ransform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false); |
1706 setLayerPropertiesForTesting(childOfRoot.get(), layerTransform, sublayerTran
sform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false); | 1693 setLayerPropertiesForTesting(childOfRoot.get(), layerTransform, sublayerTran
sform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false); |
1707 setLayerPropertiesForTesting(childOfRS1.get(), layerTransform, sublayerTrans
form, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false); | 1694 setLayerPropertiesForTesting(childOfRS1.get(), layerTransform, sublayerTrans
form, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false); |
1708 setLayerPropertiesForTesting(childOfRS2.get(), layerTransform, sublayerTrans
form, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false); | 1695 setLayerPropertiesForTesting(childOfRS2.get(), layerTransform, sublayerTrans
form, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false); |
1709 setLayerPropertiesForTesting(grandChildOfRoot.get(), layerTransform, sublaye
rTransform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false)
; | 1696 setLayerPropertiesForTesting(grandChildOfRoot.get(), layerTransform, sublaye
rTransform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false)
; |
1710 setLayerPropertiesForTesting(grandChildOfRS1.get(), layerTransform, sublayer
Transform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false); | 1697 setLayerPropertiesForTesting(grandChildOfRS1.get(), layerTransform, sublayer
Transform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false); |
1711 setLayerPropertiesForTesting(grandChildOfRS2.get(), layerTransform, sublayer
Transform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false); | 1698 setLayerPropertiesForTesting(grandChildOfRS2.get(), layerTransform, sublayer
Transform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false); |
1712 | 1699 |
| 1700 // Put an animated opacity on the render surface. |
| 1701 addOpacityTransitionToController(*renderSurface1->layerAnimationController()
, 10, 1, 0, false); |
| 1702 |
| 1703 // Also put an animated opacity on a layer without descendants. |
| 1704 addOpacityTransitionToController(*grandChildOfRoot->layerAnimationController
(), 10, 1, 0, false); |
| 1705 |
| 1706 // Put a transform animation on the render surface. |
| 1707 addAnimatedTransformToController(*renderSurface2->layerAnimationController()
, 10, 30, 0); |
| 1708 |
| 1709 // Also put transform animations on grandChildOfRoot, and grandChildOfRS2 |
| 1710 addAnimatedTransformToController(*grandChildOfRoot->layerAnimationController
(), 10, 30, 0); |
| 1711 addAnimatedTransformToController(*grandChildOfRS2->layerAnimationController(
), 10, 30, 0); |
| 1712 |
1713 executeCalculateDrawTransformsAndVisibility(parent.get()); | 1713 executeCalculateDrawTransformsAndVisibility(parent.get()); |
1714 | 1714 |
1715 // Only layers that are associated with render surfaces should have an actua
l renderSurface() value. | 1715 // Only layers that are associated with render surfaces should have an actua
l renderSurface() value. |
1716 // | 1716 // |
1717 ASSERT_TRUE(parent->renderSurface()); | 1717 ASSERT_TRUE(parent->renderSurface()); |
1718 ASSERT_FALSE(childOfRoot->renderSurface()); | 1718 ASSERT_FALSE(childOfRoot->renderSurface()); |
1719 ASSERT_FALSE(grandChildOfRoot->renderSurface()); | 1719 ASSERT_FALSE(grandChildOfRoot->renderSurface()); |
1720 | 1720 |
1721 ASSERT_TRUE(renderSurface1->renderSurface()); | 1721 ASSERT_TRUE(renderSurface1->renderSurface()); |
1722 ASSERT_FALSE(childOfRS1->renderSurface()); | 1722 ASSERT_FALSE(childOfRS1->renderSurface()); |
(...skipping 2912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4635 child->addChild(grandChild); | 4635 child->addChild(grandChild); |
4636 child->setOpacity(0.5f); | 4636 child->setOpacity(0.5f); |
4637 | 4637 |
4638 executeCalculateDrawTransformsAndVisibility(root.get()); | 4638 executeCalculateDrawTransformsAndVisibility(root.get()); |
4639 | 4639 |
4640 EXPECT_FALSE(child->renderSurface()); | 4640 EXPECT_FALSE(child->renderSurface()); |
4641 } | 4641 } |
4642 | 4642 |
4643 } // namespace | 4643 } // namespace |
4644 } // namespace cc | 4644 } // namespace cc |
OLD | NEW |