| Index: cc/layer_impl.cc
|
| diff --git a/cc/layer_impl.cc b/cc/layer_impl.cc
|
| index 58b3b9e80ed83b81df7a8ffff70adc345828c998..328f90779d8be4b10f7eac9d79459026b704e4e1 100644
|
| --- a/cc/layer_impl.cc
|
| +++ b/cc/layer_impl.cc
|
| @@ -6,6 +6,7 @@
|
|
|
| #include "base/debug/trace_event.h"
|
| #include "base/stringprintf.h"
|
| +#include "cc/animation_registrar.h"
|
| #include "cc/debug_border_draw_quad.h"
|
| #include "cc/debug_colors.h"
|
| #include "cc/layer_sorter.h"
|
| @@ -38,7 +39,6 @@ LayerImpl::LayerImpl(int id)
|
| , m_layerSurfacePropertyChanged(false)
|
| , m_masksToBounds(false)
|
| , m_contentsOpaque(false)
|
| - , m_opacity(1.0)
|
| , m_preserves3D(false)
|
| , m_useParentBackfaceVisibility(false)
|
| , m_drawCheckerboardForMissingTiles(false)
|
| @@ -57,9 +57,10 @@ LayerImpl::LayerImpl(int id)
|
| #ifndef NDEBUG
|
| , m_betweenWillDrawAndDidDraw(false)
|
| #endif
|
| - , m_layerAnimationController(LayerAnimationController::create(this))
|
| + , m_layerAnimationController(LayerAnimationController::create(AnimationRegistrar::CompositorThread))
|
| {
|
| DCHECK(m_layerId > 0);
|
| + m_layerAnimationController->setId(m_layerId);
|
| }
|
|
|
| LayerImpl::~LayerImpl()
|
| @@ -122,6 +123,11 @@ int LayerImpl::descendantsDrawContent()
|
| return result;
|
| }
|
|
|
| +void LayerImpl::setLayerTreeHostImpl(LayerTreeHostImpl* hostImpl)
|
| +{
|
| + m_layerTreeHostImpl = hostImpl;
|
| +}
|
| +
|
| scoped_ptr<SharedQuadState> LayerImpl::createSharedQuadState() const
|
| {
|
| scoped_ptr<SharedQuadState> state = SharedQuadState::Create();
|
| @@ -422,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)
|
| @@ -564,13 +550,16 @@ void LayerImpl::setContentsOpaque(bool opaque)
|
|
|
| void LayerImpl::setOpacity(float opacity)
|
| {
|
| - if (m_opacity == opacity)
|
| + if (!m_layerAnimationController->setOpacity(opacity))
|
| return;
|
| -
|
| - m_opacity = opacity;
|
| m_layerSurfacePropertyChanged = true;
|
| }
|
|
|
| +float LayerImpl::opacity() const
|
| +{
|
| + return m_layerAnimationController->opacity();
|
| +}
|
| +
|
| bool LayerImpl::opacityIsAnimating() const
|
| {
|
| return m_layerAnimationController->isAnimatingProperty(ActiveAnimation::Opacity);
|
| @@ -606,13 +595,16 @@ void LayerImpl::setSublayerTransform(const gfx::Transform& sublayerTransform)
|
|
|
| void LayerImpl::setTransform(const gfx::Transform& transform)
|
| {
|
| - if (m_transform == transform)
|
| + if (!m_layerAnimationController->setTransform(transform))
|
| return;
|
| -
|
| - m_transform = transform;
|
| m_layerSurfacePropertyChanged = true;
|
| }
|
|
|
| +const gfx::Transform& LayerImpl::transform() const
|
| +{
|
| + return m_layerAnimationController->transform();
|
| +}
|
| +
|
| bool LayerImpl::transformIsAnimating() const
|
| {
|
| return m_layerAnimationController->isAnimatingProperty(ActiveAnimation::Transform);
|
|
|