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

Side by Side Diff: cc/layer_tree_host_common_unittest.cc

Issue 11491003: Revert 171714 - Use an auxiliary list of animation controllers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/layer_tree_host.cc ('k') | cc/layer_tree_host_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1684 matching lines...) Expand 10 before | Expand all | Expand 10 after
1695 renderSurface1->addChild(renderSurface2); 1695 renderSurface1->addChild(renderSurface2);
1696 renderSurface2->addChild(childOfRS2); 1696 renderSurface2->addChild(childOfRS2);
1697 childOfRoot->addChild(grandChildOfRoot); 1697 childOfRoot->addChild(grandChildOfRoot);
1698 childOfRS1->addChild(grandChildOfRS1); 1698 childOfRS1->addChild(grandChildOfRS1);
1699 childOfRS2->addChild(grandChildOfRS2); 1699 childOfRS2->addChild(grandChildOfRS2);
1700 1700
1701 // Make our render surfaces. 1701 // Make our render surfaces.
1702 renderSurface1->setForceRenderSurface(true); 1702 renderSurface1->setForceRenderSurface(true);
1703 renderSurface2->setForceRenderSurface(true); 1703 renderSurface2->setForceRenderSurface(true);
1704 1704
1705 // Put an animated opacity on the render surface.
1706 addOpacityTransitionToController(*renderSurface1->layerAnimationController() , 10, 1, 0, false);
1707
1708 // Also put an animated opacity on a layer without descendants.
1709 addOpacityTransitionToController(*grandChildOfRoot->layerAnimationController (), 10, 1, 0, false);
1710
1705 gfx::Transform layerTransform; 1711 gfx::Transform layerTransform;
1706 layerTransform.Translate(1, 1); 1712 layerTransform.Translate(1, 1);
1707 gfx::Transform sublayerTransform; 1713 gfx::Transform sublayerTransform;
1708 sublayerTransform.Scale3d(10, 1, 1); 1714 sublayerTransform.Scale3d(10, 1, 1);
1709 1715
1716 // Put a transform animation on the render surface.
1717 addAnimatedTransformToController(*renderSurface2->layerAnimationController() , 10, 30, 0);
1718
1719 // Also put transform animations on grandChildOfRoot, and grandChildOfRS2
1720 addAnimatedTransformToController(*grandChildOfRoot->layerAnimationController (), 10, 30, 0);
1721 addAnimatedTransformToController(*grandChildOfRS2->layerAnimationController( ), 10, 30, 0);
1722
1710 setLayerPropertiesForTesting(parent.get(), layerTransform, sublayerTransform , gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false); 1723 setLayerPropertiesForTesting(parent.get(), layerTransform, sublayerTransform , gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false);
1711 setLayerPropertiesForTesting(renderSurface1.get(), layerTransform, sublayerT ransform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false); 1724 setLayerPropertiesForTesting(renderSurface1.get(), layerTransform, sublayerT ransform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false);
1712 setLayerPropertiesForTesting(renderSurface2.get(), layerTransform, sublayerT ransform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false); 1725 setLayerPropertiesForTesting(renderSurface2.get(), layerTransform, sublayerT ransform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false);
1713 setLayerPropertiesForTesting(childOfRoot.get(), layerTransform, sublayerTran sform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false); 1726 setLayerPropertiesForTesting(childOfRoot.get(), layerTransform, sublayerTran sform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false);
1714 setLayerPropertiesForTesting(childOfRS1.get(), layerTransform, sublayerTrans form, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false); 1727 setLayerPropertiesForTesting(childOfRS1.get(), layerTransform, sublayerTrans form, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false);
1715 setLayerPropertiesForTesting(childOfRS2.get(), layerTransform, sublayerTrans form, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false); 1728 setLayerPropertiesForTesting(childOfRS2.get(), layerTransform, sublayerTrans form, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false);
1716 setLayerPropertiesForTesting(grandChildOfRoot.get(), layerTransform, sublaye rTransform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false) ; 1729 setLayerPropertiesForTesting(grandChildOfRoot.get(), layerTransform, sublaye rTransform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false) ;
1717 setLayerPropertiesForTesting(grandChildOfRS1.get(), layerTransform, sublayer Transform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false); 1730 setLayerPropertiesForTesting(grandChildOfRS1.get(), layerTransform, sublayer Transform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false);
1718 setLayerPropertiesForTesting(grandChildOfRS2.get(), layerTransform, sublayer Transform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false); 1731 setLayerPropertiesForTesting(grandChildOfRS2.get(), layerTransform, sublayer Transform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false);
1719 1732
1720 // Put an animated opacity on the render surface.
1721 addOpacityTransitionToController(*renderSurface1->layerAnimationController() , 10, 1, 0, false);
1722
1723 // Also put an animated opacity on a layer without descendants.
1724 addOpacityTransitionToController(*grandChildOfRoot->layerAnimationController (), 10, 1, 0, false);
1725
1726 // Put a transform animation on the render surface.
1727 addAnimatedTransformToController(*renderSurface2->layerAnimationController() , 10, 30, 0);
1728
1729 // Also put transform animations on grandChildOfRoot, and grandChildOfRS2
1730 addAnimatedTransformToController(*grandChildOfRoot->layerAnimationController (), 10, 30, 0);
1731 addAnimatedTransformToController(*grandChildOfRS2->layerAnimationController( ), 10, 30, 0);
1732
1733 executeCalculateDrawProperties(parent.get()); 1733 executeCalculateDrawProperties(parent.get());
1734 1734
1735 // Only layers that are associated with render surfaces should have an actua l renderSurface() value. 1735 // Only layers that are associated with render surfaces should have an actua l renderSurface() value.
1736 // 1736 //
1737 ASSERT_TRUE(parent->renderSurface()); 1737 ASSERT_TRUE(parent->renderSurface());
1738 ASSERT_FALSE(childOfRoot->renderSurface()); 1738 ASSERT_FALSE(childOfRoot->renderSurface());
1739 ASSERT_FALSE(grandChildOfRoot->renderSurface()); 1739 ASSERT_FALSE(grandChildOfRoot->renderSurface());
1740 1740
1741 ASSERT_TRUE(renderSurface1->renderSurface()); 1741 ASSERT_TRUE(renderSurface1->renderSurface());
1742 ASSERT_FALSE(childOfRS1->renderSurface()); 1742 ASSERT_FALSE(childOfRS1->renderSurface());
(...skipping 2946 matching lines...) Expand 10 before | Expand all | Expand 10 after
4689 child->addChild(grandChild); 4689 child->addChild(grandChild);
4690 child->setOpacity(0.5f); 4690 child->setOpacity(0.5f);
4691 4691
4692 executeCalculateDrawProperties(root.get()); 4692 executeCalculateDrawProperties(root.get());
4693 4693
4694 EXPECT_FALSE(child->renderSurface()); 4694 EXPECT_FALSE(child->renderSurface());
4695 } 4695 }
4696 4696
4697 } // namespace 4697 } // namespace
4698 } // namespace cc 4698 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layer_tree_host.cc ('k') | cc/layer_tree_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698