Index: cc/layer.cc |
diff --git a/cc/layer.cc b/cc/layer.cc |
index 7b701554ce9d97f0c95366109d4c406916d87363..3be62f0e0877a88efc2f73996a6a2fb162d443b8 100644 |
--- a/cc/layer.cc |
+++ b/cc/layer.cc |
@@ -757,23 +757,15 @@ bool Layer::IsActive() const |
return true; |
} |
-bool Layer::addAnimation(scoped_ptr <Animation> animation) |
+bool Layer::IsOrphaned() const |
{ |
- // WebCore currently assumes that accelerated animations will start soon |
- // after the animation is added. However we cannot guarantee that if we do |
- // not have a layerTreeHost that will setNeedsCommit(). |
- // Unfortunately, the fix below to guarantee correctness causes performance |
- // regressions on Android, since Android has shipped for a long time |
- // with all animations accelerated. For this reason, we will live with |
- // this bug only on Android until the bug is fixed. |
- // http://crbug.com/129683 |
-#if !defined(OS_ANDROID) |
- if (!m_layerTreeHost) |
- return false; |
+ return !m_layerTreeHost; |
+} |
- if (!m_layerTreeHost->settings().acceleratedAnimationEnabled) |
+bool Layer::addAnimation(scoped_ptr <Animation> animation) |
+{ |
+ if (!m_layerAnimationController->animationRegistrar()) |
return false; |
-#endif |
m_layerAnimationController->addAnimation(animation.Pass()); |
setNeedsCommit(); |
@@ -821,6 +813,7 @@ scoped_refptr<LayerAnimationController> Layer::releaseLayerAnimationController() |
scoped_refptr<LayerAnimationController> toReturn = m_layerAnimationController; |
m_layerAnimationController = LayerAnimationController::create(id()); |
m_layerAnimationController->addObserver(this); |
+ m_layerAnimationController->setAnimationRegistrar(toReturn->animationRegistrar()); |
return toReturn; |
} |