| Index: cc/layer_impl.cc
|
| diff --git a/cc/layer_impl.cc b/cc/layer_impl.cc
|
| index c9615dcc7da09ab0449d8606d9a59c91ae2e9fec..7a7965b7655d37b2eca783c871a1a8fb7623fdc6 100644
|
| --- a/cc/layer_impl.cc
|
| +++ b/cc/layer_impl.cc
|
| @@ -38,6 +38,7 @@ LayerImpl::LayerImpl(LayerTreeHostImpl* hostImpl, int id)
|
| , m_layerSurfacePropertyChanged(false)
|
| , m_masksToBounds(false)
|
| , m_contentsOpaque(false)
|
| + , m_opacity(1.0)
|
| , m_preserves3D(false)
|
| , m_useParentBackfaceVisibility(false)
|
| , m_drawCheckerboardForMissingTiles(false)
|
| @@ -50,12 +51,10 @@ LayerImpl::LayerImpl(LayerTreeHostImpl* hostImpl, int id)
|
| #ifndef NDEBUG
|
| , m_betweenWillDrawAndDidDraw(false)
|
| #endif
|
| - , m_layerAnimationController(LayerAnimationController::create())
|
| + , m_layerAnimationController(LayerAnimationController::create(this))
|
| {
|
| DCHECK(m_layerId > 0);
|
| DCHECK(m_layerTreeHostImpl);
|
| - m_layerAnimationController->setId(m_layerId);
|
| - m_layerAnimationController->setAnimationRegistrar(hostImpl);
|
| }
|
|
|
| LayerImpl::~LayerImpl()
|
| @@ -452,6 +451,26 @@ 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)
|
| @@ -578,14 +597,11 @@ void LayerImpl::setContentsOpaque(bool opaque)
|
|
|
| void LayerImpl::setOpacity(float opacity)
|
| {
|
| - if (!m_layerAnimationController->setOpacity(opacity))
|
| + if (m_opacity == opacity)
|
| return;
|
| - m_layerSurfacePropertyChanged = true;
|
| -}
|
|
|
| -float LayerImpl::opacity() const
|
| -{
|
| - return m_layerAnimationController->opacity();
|
| + m_opacity = opacity;
|
| + m_layerSurfacePropertyChanged = true;
|
| }
|
|
|
| bool LayerImpl::opacityIsAnimating() const
|
| @@ -623,14 +639,11 @@ void LayerImpl::setSublayerTransform(const gfx::Transform& sublayerTransform)
|
|
|
| void LayerImpl::setTransform(const gfx::Transform& transform)
|
| {
|
| - if (!m_layerAnimationController->setTransform(transform))
|
| + if (m_transform == transform)
|
| return;
|
| - m_layerSurfacePropertyChanged = true;
|
| -}
|
|
|
| -const gfx::Transform& LayerImpl::transform() const
|
| -{
|
| - return m_layerAnimationController->transform();
|
| + m_transform = transform;
|
| + m_layerSurfacePropertyChanged = true;
|
| }
|
|
|
| bool LayerImpl::transformIsAnimating() const
|
|
|