| Index: cc/layer_impl.cc
|
| diff --git a/cc/layer_impl.cc b/cc/layer_impl.cc
|
| index 81bc49f01aafb4a2ea926f0412e3764a5c786d8a..e9f71d43d391e3f4e1ceafe4fa1f393b8b1166ad 100644
|
| --- a/cc/layer_impl.cc
|
| +++ b/cc/layer_impl.cc
|
| @@ -59,9 +59,10 @@ LayerImpl::LayerImpl(int id)
|
| #ifndef NDEBUG
|
| , m_betweenWillDrawAndDidDraw(false)
|
| #endif
|
| - , m_layerAnimationController(LayerAnimationController::create(this))
|
| + , m_layerAnimationController(LayerAnimationController::create())
|
| {
|
| DCHECK(m_layerId > 0);
|
| + m_layerAnimationController->setId(m_layerId);
|
| }
|
|
|
| LayerImpl::~LayerImpl()
|
| @@ -121,6 +122,12 @@ bool LayerImpl::descendantDrawsContent()
|
| return false;
|
| }
|
|
|
| +void LayerImpl::setLayerTreeHostImpl(LayerTreeHostImpl* hostImpl)
|
| +{
|
| + m_layerTreeHostImpl = hostImpl;
|
| + m_layerAnimationController->setAnimationRegistrar(hostImpl);
|
| +}
|
| +
|
| scoped_ptr<SharedQuadState> LayerImpl::createSharedQuadState() const
|
| {
|
| scoped_ptr<SharedQuadState> state = SharedQuadState::Create();
|
| @@ -421,26 +428,6 @@ int LayerImpl::id() const
|
| return m_layerId;
|
| }
|
|
|
| -float LayerImpl::opacity() const
|
| -{
|
| - return m_opacity;
|
| -}
|
| -
|
| -void LayerImpl::setOpacityFromAnimation(float opacity)
|
| -{
|
| - setOpacity(opacity);
|
| -}
|
| -
|
| -const gfx::Transform& LayerImpl::transform() const
|
| -{
|
| - return m_transform;
|
| -}
|
| -
|
| -void LayerImpl::setTransformFromAnimation(const gfx::Transform& transform)
|
| -{
|
| - setTransform(transform);
|
| -}
|
| -
|
| void LayerImpl::setBounds(const gfx::Size& bounds)
|
| {
|
| if (m_bounds == bounds)
|
| @@ -567,9 +554,17 @@ void LayerImpl::setOpacity(float opacity)
|
| return;
|
|
|
| m_opacity = opacity;
|
| + m_opacityLastUpdateTime = base::TimeTicks::Now();
|
| m_layerSurfacePropertyChanged = true;
|
| }
|
|
|
| +float LayerImpl::opacity() const
|
| +{
|
| + if (m_layerAnimationController->opacityLastUpdateTime() > m_opacityLastUpdateTime)
|
| + return m_layerAnimationController->opacity();
|
| + return m_opacity;
|
| +}
|
| +
|
| bool LayerImpl::opacityIsAnimating() const
|
| {
|
| return m_layerAnimationController->isAnimatingProperty(ActiveAnimation::Opacity);
|
| @@ -609,9 +604,17 @@ void LayerImpl::setTransform(const gfx::Transform& transform)
|
| return;
|
|
|
| m_transform = transform;
|
| + m_transformLastUpdateTime = base::TimeTicks::Now();
|
| m_layerSurfacePropertyChanged = true;
|
| }
|
|
|
| +const gfx::Transform& LayerImpl::transform() const
|
| +{
|
| + if (m_layerAnimationController->transformLastUpdateTime() > m_transformLastUpdateTime)
|
| + return m_layerAnimationController->transform();
|
| + return m_transform;
|
| +}
|
| +
|
| bool LayerImpl::transformIsAnimating() const
|
| {
|
| return m_layerAnimationController->isAnimatingProperty(ActiveAnimation::Transform);
|
|
|