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

Unified Diff: cc/layer.cc

Issue 11783037: Not for review: Enable accelerated animations for orphaned layers (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Wait for layout to complete before starting orphaned animations Created 7 years, 11 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.h ('k') | 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 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;
}
« no previous file with comments | « cc/layer.h ('k') | cc/layer_animation_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698