Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1360)

Unified Diff: cc/layer_impl.cc

Issue 11348256: Use an auxiliary list of animation controllers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/layer_impl.h ('k') | cc/layer_tree_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer_impl.cc
diff --git a/cc/layer_impl.cc b/cc/layer_impl.cc
index f87a622ea5f471a907c3ca9635fda443a9dbd8ff..12b54a11b0af3dbccc9f387827a37c0ba07507e1 100644
--- a/cc/layer_impl.cc
+++ b/cc/layer_impl.cc
@@ -38,7 +38,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)
@@ -51,9 +50,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()
@@ -116,6 +116,12 @@ int LayerImpl::descendantsDrawContent()
return result;
}
+void LayerImpl::setLayerTreeHostImpl(LayerTreeHostImpl* hostImpl)
+{
+ m_layerTreeHostImpl = hostImpl;
+ m_layerAnimationController->setAnimationRegistrar(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);
« no previous file with comments | « cc/layer_impl.h ('k') | cc/layer_tree_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698