summaryrefslogtreecommitdiffstats
path: root/cc/layer_tree_host_common_unittest.cc
diff options
context:
space:
mode:
authorvollick@chromium.org <vollick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-20 00:11:34 +0000
committervollick@chromium.org <vollick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-20 00:11:34 +0000
commitde4afb5eaff3e756cc13d915532402c651302a32 (patch)
treed7517e1363c8cf3698dc1fd08af4623705a4263d /cc/layer_tree_host_common_unittest.cc
parent8f95c562479b3be9776e77b597d72b464bb447a5 (diff)
downloadchromium_src-de4afb5eaff3e756cc13d915532402c651302a32.zip
chromium_src-de4afb5eaff3e756cc13d915532402c651302a32.tar.gz
chromium_src-de4afb5eaff3e756cc13d915532402c651302a32.tar.bz2
Ref count layer animation controllers.
With this patch we accomplish the following: 1. layer animation controllers are ref counted (so they can be shared by the two impl trees) 2. the layer tree hosts now own a list of active animation controllers. This allows for a couple of nice things __a. Ticking the animation controllers no longer requires a tree walk __b. We will be able to support ticking of animation controllers for layers that are not yet added to the layer tree. (Support coming in a future patch). 3. animation controllers register and unregister themselves from their respective layer tree host's list when they have an animation to tick. R=nduca@chromium.org,enne@chromium.org BUG=162111 Review URL: https://chromiumcodereview.appspot.com/11598005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@174043 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/layer_tree_host_common_unittest.cc')
-rw-r--r--cc/layer_tree_host_common_unittest.cc26
1 files changed, 13 insertions, 13 deletions
diff --git a/cc/layer_tree_host_common_unittest.cc b/cc/layer_tree_host_common_unittest.cc
index 7888a6a..0fd26e4 100644
--- a/cc/layer_tree_host_common_unittest.cc
+++ b/cc/layer_tree_host_common_unittest.cc
@@ -1700,24 +1700,11 @@ TEST(LayerTreeHostCommonTest, verifyAnimationsForRenderSurfaceHierarchy)
renderSurface1->setForceRenderSurface(true);
renderSurface2->setForceRenderSurface(true);
- // Put an animated opacity on the render surface.
- addOpacityTransitionToController(*renderSurface1->layerAnimationController(), 10, 1, 0, false);
-
- // Also put an animated opacity on a layer without descendants.
- addOpacityTransitionToController(*grandChildOfRoot->layerAnimationController(), 10, 1, 0, false);
-
gfx::Transform layerTransform;
layerTransform.Translate(1, 1);
gfx::Transform sublayerTransform;
sublayerTransform.Scale3d(10, 1, 1);
- // Put a transform animation on the render surface.
- addAnimatedTransformToController(*renderSurface2->layerAnimationController(), 10, 30, 0);
-
- // Also put transform animations on grandChildOfRoot, and grandChildOfRS2
- addAnimatedTransformToController(*grandChildOfRoot->layerAnimationController(), 10, 30, 0);
- addAnimatedTransformToController(*grandChildOfRS2->layerAnimationController(), 10, 30, 0);
-
setLayerPropertiesForTesting(parent.get(), layerTransform, sublayerTransform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false);
setLayerPropertiesForTesting(renderSurface1.get(), layerTransform, sublayerTransform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false);
setLayerPropertiesForTesting(renderSurface2.get(), layerTransform, sublayerTransform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false);
@@ -1728,6 +1715,19 @@ TEST(LayerTreeHostCommonTest, verifyAnimationsForRenderSurfaceHierarchy)
setLayerPropertiesForTesting(grandChildOfRS1.get(), layerTransform, sublayerTransform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false);
setLayerPropertiesForTesting(grandChildOfRS2.get(), layerTransform, sublayerTransform, gfx::PointF(0.25, 0), gfx::PointF(2.5, 0), gfx::Size(10, 10), false);
+ // Put an animated opacity on the render surface.
+ addOpacityTransitionToController(*renderSurface1->layerAnimationController(), 10, 1, 0, false);
+
+ // Also put an animated opacity on a layer without descendants.
+ addOpacityTransitionToController(*grandChildOfRoot->layerAnimationController(), 10, 1, 0, false);
+
+ // Put a transform animation on the render surface.
+ addAnimatedTransformToController(*renderSurface2->layerAnimationController(), 10, 30, 0);
+
+ // Also put transform animations on grandChildOfRoot, and grandChildOfRS2
+ addAnimatedTransformToController(*grandChildOfRoot->layerAnimationController(), 10, 30, 0);
+ addAnimatedTransformToController(*grandChildOfRS2->layerAnimationController(), 10, 30, 0);
+
executeCalculateDrawProperties(parent.get());
// Only layers that are associated with render surfaces should have an actual renderSurface() value.