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

Side by Side Diff: cc/layer_tree_host_common_unittest.cc

Issue 11598005: Ref count layer animation controllers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . 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 1682 matching lines...) Expand 10 before | Expand all | Expand 10 after
1693 renderSurface1->addChild(renderSurface2); 1693 renderSurface1->addChild(renderSurface2);
1694 renderSurface2->addChild(childOfRS2); 1694 renderSurface2->addChild(childOfRS2);
1695 childOfRoot->addChild(grandChildOfRoot); 1695 childOfRoot->addChild(grandChildOfRoot);
1696 childOfRS1->addChild(grandChildOfRS1); 1696 childOfRS1->addChild(grandChildOfRS1);
1697 childOfRS2->addChild(grandChildOfRS2); 1697 childOfRS2->addChild(grandChildOfRS2);
1698 1698
1699 // Make our render surfaces. 1699 // Make our render surfaces.
1700 renderSurface1->setForceRenderSurface(true); 1700 renderSurface1->setForceRenderSurface(true);
1701 renderSurface2->setForceRenderSurface(true); 1701 renderSurface2->setForceRenderSurface(true);
1702 1702
1703 // Put an animated opacity on the render surface.
1704 addOpacityTransitionToController(*renderSurface1->layerAnimationController() , 10, 1, 0, false);
1705
1706 // Also put an animated opacity on a layer without descendants.
1707 addOpacityTransitionToController(*grandChildOfRoot->layerAnimationController (), 10, 1, 0, false);
1708
1709 gfx::Transform layerTransform; 1703 gfx::Transform layerTransform;
1710 layerTransform.Translate(1, 1); 1704 layerTransform.Translate(1, 1);
1711 gfx::Transform sublayerTransform; 1705 gfx::Transform sublayerTransform;
1712 sublayerTransform.Scale3d(10, 1, 1); 1706 sublayerTransform.Scale3d(10, 1, 1);
1713 1707
1714 // Put a transform animation on the render surface.
1715 addAnimatedTransformToController(*renderSurface2->layerAnimationController() , 10, 30, 0);
1716
1717 // Also put transform animations on grandChildOfRoot, and grandChildOfRS2
1718 addAnimatedTransformToController(*grandChildOfRoot->layerAnimationController (), 10, 30, 0);
1719 addAnimatedTransformToController(*grandChildOfRS2->layerAnimationController( ), 10, 30, 0);
1720
1721 setLayerPropertiesForTesting(parent.get(), layerTransform, sublayerTransform , gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false); 1708 setLayerPropertiesForTesting(parent.get(), layerTransform, sublayerTransform , gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false);
1722 setLayerPropertiesForTesting(renderSurface1.get(), layerTransform, sublayerT ransform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false); 1709 setLayerPropertiesForTesting(renderSurface1.get(), layerTransform, sublayerT ransform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false);
1723 setLayerPropertiesForTesting(renderSurface2.get(), layerTransform, sublayerT ransform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false); 1710 setLayerPropertiesForTesting(renderSurface2.get(), layerTransform, sublayerT ransform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false);
1724 setLayerPropertiesForTesting(childOfRoot.get(), layerTransform, sublayerTran sform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false); 1711 setLayerPropertiesForTesting(childOfRoot.get(), layerTransform, sublayerTran sform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false);
1725 setLayerPropertiesForTesting(childOfRS1.get(), layerTransform, sublayerTrans form, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false); 1712 setLayerPropertiesForTesting(childOfRS1.get(), layerTransform, sublayerTrans form, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false);
1726 setLayerPropertiesForTesting(childOfRS2.get(), layerTransform, sublayerTrans form, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false); 1713 setLayerPropertiesForTesting(childOfRS2.get(), layerTransform, sublayerTrans form, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false);
1727 setLayerPropertiesForTesting(grandChildOfRoot.get(), layerTransform, sublaye rTransform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false) ; 1714 setLayerPropertiesForTesting(grandChildOfRoot.get(), layerTransform, sublaye rTransform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false) ;
1728 setLayerPropertiesForTesting(grandChildOfRS1.get(), layerTransform, sublayer Transform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false); 1715 setLayerPropertiesForTesting(grandChildOfRS1.get(), layerTransform, sublayer Transform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false);
1729 setLayerPropertiesForTesting(grandChildOfRS2.get(), layerTransform, sublayer Transform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false); 1716 setLayerPropertiesForTesting(grandChildOfRS2.get(), layerTransform, sublayer Transform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false);
1730 1717
1718 // Put an animated opacity on the render surface.
1719 addOpacityTransitionToController(*renderSurface1->layerAnimationController() , 10, 1, 0, false);
1720
1721 // Also put an animated opacity on a layer without descendants.
1722 addOpacityTransitionToController(*grandChildOfRoot->layerAnimationController (), 10, 1, 0, false);
1723
1724 // Put a transform animation on the render surface.
1725 addAnimatedTransformToController(*renderSurface2->layerAnimationController() , 10, 30, 0);
1726
1727 // Also put transform animations on grandChildOfRoot, and grandChildOfRS2
1728 addAnimatedTransformToController(*grandChildOfRoot->layerAnimationController (), 10, 30, 0);
1729 addAnimatedTransformToController(*grandChildOfRS2->layerAnimationController( ), 10, 30, 0);
1730
1731 executeCalculateDrawProperties(parent.get()); 1731 executeCalculateDrawProperties(parent.get());
1732 1732
1733 // Only layers that are associated with render surfaces should have an actua l renderSurface() value. 1733 // Only layers that are associated with render surfaces should have an actua l renderSurface() value.
1734 // 1734 //
1735 ASSERT_TRUE(parent->renderSurface()); 1735 ASSERT_TRUE(parent->renderSurface());
1736 ASSERT_FALSE(childOfRoot->renderSurface()); 1736 ASSERT_FALSE(childOfRoot->renderSurface());
1737 ASSERT_FALSE(grandChildOfRoot->renderSurface()); 1737 ASSERT_FALSE(grandChildOfRoot->renderSurface());
1738 1738
1739 ASSERT_TRUE(renderSurface1->renderSurface()); 1739 ASSERT_TRUE(renderSurface1->renderSurface());
1740 ASSERT_FALSE(childOfRS1->renderSurface()); 1740 ASSERT_FALSE(childOfRS1->renderSurface());
(...skipping 3062 matching lines...) Expand 10 before | Expand all | Expand 10 after
4803 EXPECT_EQ(m_canUseLCDText, m_grandChild->canUseLCDText()); 4803 EXPECT_EQ(m_canUseLCDText, m_grandChild->canUseLCDText());
4804 } 4804 }
4805 4805
4806 INSTANTIATE_TEST_CASE_P(LayerTreeHostCommonTest, 4806 INSTANTIATE_TEST_CASE_P(LayerTreeHostCommonTest,
4807 LCDTextTest, 4807 LCDTextTest,
4808 testing::Combine(testing::Bool(), 4808 testing::Combine(testing::Bool(),
4809 testing::Bool())); 4809 testing::Bool()));
4810 4810
4811 } // namespace 4811 } // namespace
4812 } // namespace cc 4812 } // 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