| Index: cc/layer_impl.cc
|
| diff --git a/cc/layer_impl.cc b/cc/layer_impl.cc
|
| index e1cf9d49fd8695871fa11f6bc3ce5511864c715a..7f6bdb4dc55789f4500076c91d7955c803d60d6b 100644
|
| --- a/cc/layer_impl.cc
|
| +++ b/cc/layer_impl.cc
|
| @@ -50,11 +50,13 @@ LayerImpl::LayerImpl(LayerTreeImpl* treeImpl, int id)
|
| #ifndef NDEBUG
|
| , m_betweenWillDrawAndDidDraw(false)
|
| #endif
|
| - , m_layerAnimationController(LayerAnimationController::create(this))
|
| {
|
| DCHECK(m_layerId > 0);
|
| DCHECK(m_layerTreeImpl);
|
| m_layerTreeImpl->RegisterLayer(this);
|
| + AnimationRegistrar* registrar = m_layerTreeImpl;
|
| + m_layerAnimationController = registrar->GetAnimationControllerForId(m_layerId);
|
| + m_layerAnimationController->addObserver(this);
|
| }
|
|
|
| LayerImpl::~LayerImpl()
|
| @@ -63,6 +65,7 @@ LayerImpl::~LayerImpl()
|
| DCHECK(!m_betweenWillDrawAndDidDraw);
|
| #endif
|
| m_layerTreeImpl->UnregisterLayer(this);
|
| + m_layerAnimationController->removeObserver(this);
|
| }
|
|
|
| void LayerImpl::addChild(scoped_ptr<LayerImpl> child)
|
| @@ -459,22 +462,12 @@ int LayerImpl::id() const
|
| return m_layerId;
|
| }
|
|
|
| -float LayerImpl::opacity() const
|
| -{
|
| - return m_opacity;
|
| -}
|
| -
|
| -void LayerImpl::setOpacityFromAnimation(float opacity)
|
| +void LayerImpl::OnOpacityAnimated(float opacity)
|
| {
|
| setOpacity(opacity);
|
| }
|
|
|
| -const gfx::Transform& LayerImpl::transform() const
|
| -{
|
| - return m_transform;
|
| -}
|
| -
|
| -void LayerImpl::setTransformFromAnimation(const gfx::Transform& transform)
|
| +void LayerImpl::OnTransformAnimated(const gfx::Transform& transform)
|
| {
|
| setTransform(transform);
|
| }
|
| @@ -626,6 +619,11 @@ void LayerImpl::setOpacity(float opacity)
|
| noteLayerSurfacePropertyChanged();
|
| }
|
|
|
| +float LayerImpl::opacity() const
|
| +{
|
| + return m_opacity;
|
| +}
|
| +
|
| bool LayerImpl::opacityIsAnimating() const
|
| {
|
| return m_layerAnimationController->isAnimatingProperty(ActiveAnimation::Opacity);
|
| @@ -668,6 +666,11 @@ void LayerImpl::setTransform(const gfx::Transform& transform)
|
| noteLayerSurfacePropertyChanged();
|
| }
|
|
|
| +const gfx::Transform& LayerImpl::transform() const
|
| +{
|
| + return m_transform;
|
| +}
|
| +
|
| bool LayerImpl::transformIsAnimating() const
|
| {
|
| return m_layerAnimationController->isAnimatingProperty(ActiveAnimation::Transform);
|
|
|