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

Unified Diff: cc/layer_unittest.cc

Issue 12334041: Enable accelerated animations for orphaned layers (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix android_dbg_triggered_tests Created 7 years, 10 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/layer_tree_host.cc ('k') | content/renderer/gpu/render_widget_compositor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer_unittest.cc
diff --git a/cc/layer_unittest.cc b/cc/layer_unittest.cc
index 6784858c7fd0f35434d3ff3e13455d88382c31a7..89dc6ffb261463d2d804053acc007c44cde59e8f 100644
--- a/cc/layer_unittest.cc
+++ b/cc/layer_unittest.cc
@@ -844,30 +844,25 @@ static bool addTestAnimation(Layer* layer)
return layer->addAnimation(animation.Pass());
}
-TEST(LayerLayerTreeHostTest, shouldNotAddAnimationWithoutLayerTreeHost)
+TEST(LayerLayerTreeHostTest, shouldNotAddAnimationWithoutAnimationRegistrar)
{
- // Currently, WebCore assumes that animations will be started immediately / very soon
- // if a composited layer's addAnimation() returns true. However, without a layerTreeHost,
- // layers cannot actually animate yet. So, to prevent violating this WebCore assumption,
- // the animation should not be accepted if the layer doesn't already have a layerTreeHost.
-
scoped_refptr<Layer> layer = Layer::create();
- // Case 1: without a layerTreeHost, the animation should not be accepted.
-#if defined(OS_ANDROID)
- // All animations are enabled on Android to avoid performance regressions.
- // Other platforms will be enabled with http://crbug.com/129683
- EXPECT_TRUE(addTestAnimation(layer.get()));
-#else
+ // Case 1: without a LayerTreeHost and without an AnimationRegistrar, the
+ // animation should not be accepted.
EXPECT_FALSE(addTestAnimation(layer.get()));
-#endif
scoped_ptr<FakeLayerImplTreeHost> layerTreeHost(FakeLayerImplTreeHost::create());
+ layer->layerAnimationController()->setAnimationRegistrar(layerTreeHost->animationRegistrar());
+
+ // Case 2: with an AnimationRegistrar, the animation should be accepted.
+ EXPECT_TRUE(addTestAnimation(layer.get()));
+
layerTreeHost->setRootLayer(layer.get());
layer->setLayerTreeHost(layerTreeHost.get());
assertLayerTreeHostMatchesForSubtree(layer.get(), layerTreeHost.get());
- // Case 2: with a layerTreeHost, the animation should be accepted.
+ // Case 3: with a LayerTreeHost, the animation should be accepted.
Ian Vollick 2013/02/25 18:27:29 Maybe we could add a LTH with no registrar and che
EXPECT_TRUE(addTestAnimation(layer.get()));
}
« no previous file with comments | « cc/layer_tree_host.cc ('k') | content/renderer/gpu/render_widget_compositor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698