diff options
author | ajuma@chromium.org <ajuma@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-07 20:24:58 +0000 |
---|---|---|
committer | ajuma@chromium.org <ajuma@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-07 20:24:58 +0000 |
commit | cef1b3983dbd6ab92da56fc5555470050f53332b (patch) | |
tree | 57ac179ac7ded495206fe55019141aa27f8f7002 /cc/layer.cc | |
parent | c256030c230c2cfd9de19cef5ec2bb4a44dda6df (diff) | |
download | chromium_src-cef1b3983dbd6ab92da56fc5555470050f53332b.zip chromium_src-cef1b3983dbd6ab92da56fc5555470050f53332b.tar.gz chromium_src-cef1b3983dbd6ab92da56fc5555470050f53332b.tar.bz2 |
Enable accelerated animations for orphan layers
This defines RenderWidgetCompositor::registerForAnimations,
which associates the LayerAnimationController of
newly-created cc::Layers with the AnimationRegistrar of the
RenderWidgetCompositor's LayerTreeHost. This also makes
cc::Layer::addAnimation accept animations whenever the
layer's LayerAnimationController has an AnimationRegistrar,
and makes LayerTreeHost only create an AnimationRegistrar
when accelerated animations are enabled.
Note that this is expected to regress Robohornet Pro by
about 16%: because of
https://bugs.webkit.org/show_bug.cgi?id=111617, Robohornet
Pro takes longer to complete when its animations are
accelerated. However, animations during this test (and on
other pages where animations are added to orphan layers)
will now be much smoother.
BUG=129683,179196
Review URL: https://chromiumcodereview.appspot.com/12388093
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@186775 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/layer.cc')
-rw-r--r-- | cc/layer.cc | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/cc/layer.cc b/cc/layer.cc index b08bbcd..d129817 100644 --- a/cc/layer.cc +++ b/cc/layer.cc @@ -790,22 +790,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; @@ -852,6 +839,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; } |