| Index: cc/layer_tree_host.cc
|
| diff --git a/cc/layer_tree_host.cc b/cc/layer_tree_host.cc
|
| index d52422e9ae023c1f1cebb9c4b32f6caf04acb46f..7ab7c19e71ef6da4d72aada88ac83d1e36d9f285 100644
|
| --- a/cc/layer_tree_host.cc
|
| +++ b/cc/layer_tree_host.cc
|
| @@ -160,7 +160,6 @@ scoped_ptr<LayerTreeHost> LayerTreeHost::create(LayerTreeHostClient* client, con
|
|
|
| LayerTreeHost::LayerTreeHost(LayerTreeHostClient* client, const LayerTreeSettings& settings)
|
| : m_animating(false)
|
| - , m_needsAnimateLayers(false)
|
| , m_needsFullTreeSync(true)
|
| , m_client(client)
|
| , m_commitNumber(0)
|
| @@ -209,6 +208,9 @@ LayerTreeHost::~LayerTreeHost()
|
| RateLimiterMap::iterator it = m_rateLimiters.begin();
|
| if (it != m_rateLimiters.end())
|
| it->second->stop();
|
| +
|
| + if (m_rootLayer)
|
| + m_rootLayer = 0;
|
| }
|
|
|
| void LayerTreeHost::setSurfaceReady()
|
| @@ -358,11 +360,6 @@ void LayerTreeHost::finishCommitOnImplThread(LayerTreeHostImpl* hostImpl)
|
| else
|
| hostImpl->setHudLayer(0);
|
|
|
| - // We may have added an animation during the tree sync. This will cause both layer tree hosts
|
| - // to visit their controllers.
|
| - if (rootLayer() && m_needsAnimateLayers)
|
| - hostImpl->setNeedsAnimateLayers();
|
| -
|
| hostImpl->setSourceFrameNumber(commitNumber());
|
| hostImpl->setViewportSize(layoutViewportSize(), deviceViewportSize());
|
| hostImpl->setDeviceScaleFactor(deviceScaleFactor());
|
| @@ -496,12 +493,6 @@ void LayerTreeHost::setAnimationEvents(scoped_ptr<AnimationEventsVector> events,
|
| setAnimationEventsRecursive(*events.get(), m_rootLayer.get(), wallClockTime);
|
| }
|
|
|
| -void LayerTreeHost::didAddAnimation()
|
| -{
|
| - m_needsAnimateLayers = true;
|
| - m_proxy->didAddAnimation();
|
| -}
|
| -
|
| void LayerTreeHost::setRootLayer(scoped_refptr<Layer> rootLayer)
|
| {
|
| if (m_rootLayer == rootLayer)
|
| @@ -904,33 +895,16 @@ void LayerTreeHost::setDeviceScaleFactor(float deviceScaleFactor)
|
|
|
| void LayerTreeHost::animateLayers(base::TimeTicks time)
|
| {
|
| - if (!m_settings.acceleratedAnimationEnabled || !m_needsAnimateLayers)
|
| + if (!m_settings.acceleratedAnimationEnabled || AnimationRegistrar::GetActiveControllers(AnimationRegistrar::MainThread).empty())
|
| return;
|
|
|
| TRACE_EVENT0("cc", "LayerTreeHostImpl::animateLayers");
|
| - m_needsAnimateLayers = animateLayersRecursive(m_rootLayer.get(), time);
|
| -}
|
|
|
| -bool LayerTreeHost::animateLayersRecursive(Layer* current, base::TimeTicks time)
|
| -{
|
| - if (!current)
|
| - return false;
|
| -
|
| - bool subtreeNeedsAnimateLayers = false;
|
| - LayerAnimationController* currentController = current->layerAnimationController();
|
| double monotonicTime = (time - base::TimeTicks()).InSecondsF();
|
| - currentController->animate(monotonicTime, 0);
|
| -
|
| - // If the current controller still has an active animation, we must continue animating layers.
|
| - if (currentController->hasActiveAnimation())
|
| - subtreeNeedsAnimateLayers = true;
|
| -
|
| - for (size_t i = 0; i < current->children().size(); ++i) {
|
| - if (animateLayersRecursive(current->children()[i].get(), time))
|
| - subtreeNeedsAnimateLayers = true;
|
| - }
|
|
|
| - return subtreeNeedsAnimateLayers;
|
| + AnimationRegistrar::AnimationControllerSet copy = AnimationRegistrar::GetActiveControllers(AnimationRegistrar::MainThread);
|
| + for (AnimationRegistrar::AnimationControllerSet::iterator iter = copy.begin(); iter != copy.end(); ++iter)
|
| + (*iter)->animate(monotonicTime, 0);
|
| }
|
|
|
| void LayerTreeHost::setAnimationEventsRecursive(const AnimationEventsVector& events, Layer* layer, base::Time wallClockTime)
|
|
|