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

Unified Diff: cc/layer.cc

Issue 12334041: Enable accelerated animations for orphaned layers (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Also test LTH with no registrar 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 | « no previous file | cc/layer_animation_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer.cc
diff --git a/cc/layer.cc b/cc/layer.cc
index 1f22bad17eab4063e360f18790adeca6e1817a0c..bd8d3b8417229718f6b8047d7b26a186b85e68d7 100644
--- a/cc/layer.cc
+++ b/cc/layer.cc
@@ -760,22 +760,9 @@ bool Layer::IsActive() const
bool Layer::addAnimation(scoped_ptr <Animation> animation)
{
- // 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)
+ if (!m_layerAnimationController->animationRegistrar())
return false;
- if (!m_layerTreeHost->settings().acceleratedAnimationEnabled)
- return false;
-#endif
-
m_layerAnimationController->addAnimation(animation.Pass());
setNeedsCommit();
return true;
@@ -822,6 +809,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;
}
« no previous file with comments | « no previous file | cc/layer_animation_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698