Index: third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.cpp |
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.cpp b/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.cpp |
index 41858117597c83e260d30c92e1c10d6dba15207d..763a2d8a265adad43605cbdf5ac394907cf7ca67 100644 |
--- a/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.cpp |
+++ b/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.cpp |
@@ -17,7 +17,7 @@ |
namespace blink { |
ScrollAnimatorCompositorCoordinator::ScrollAnimatorCompositorCoordinator() |
- : m_compositorAnimationAttachedToLayerId(0) |
+ : m_compositorAnimationAttachedToElementId(0) |
, m_runState(RunState::Idle) |
, m_compositorAnimationId(0) |
, m_compositorAnimationGroupId(0) |
@@ -67,7 +67,7 @@ bool ScrollAnimatorCompositorCoordinator::hasAnimationThatRequiresService() cons |
bool ScrollAnimatorCompositorCoordinator::addAnimation( |
PassOwnPtr<CompositorAnimation> animation) |
{ |
- if (m_compositorPlayer->isLayerAttached()) { |
+ if (m_compositorPlayer->isElementAttached()) { |
m_compositorPlayer->addAnimation(animation.leakPtr()); |
return true; |
} |
@@ -76,13 +76,13 @@ bool ScrollAnimatorCompositorCoordinator::addAnimation( |
void ScrollAnimatorCompositorCoordinator::removeAnimation() |
{ |
- if (m_compositorPlayer->isLayerAttached()) |
+ if (m_compositorPlayer->isElementAttached()) |
m_compositorPlayer->removeAnimation(m_compositorAnimationId); |
} |
void ScrollAnimatorCompositorCoordinator::abortAnimation() |
{ |
- if (m_compositorPlayer->isLayerAttached()) |
+ if (m_compositorPlayer->isElementAttached()) |
m_compositorPlayer->abortAnimation(m_compositorAnimationId); |
} |
@@ -175,27 +175,30 @@ bool ScrollAnimatorCompositorCoordinator::reattachCompositorPlayerIfNeeded( |
CompositorAnimationTimeline* timeline) |
{ |
bool reattached = false; |
- int compositorAnimationAttachedToLayerId = 0; |
- if (getScrollableArea()->layerForScrolling()) |
- compositorAnimationAttachedToLayerId = getScrollableArea()->layerForScrolling()->platformLayer()->id(); |
+ CompositorElementId compositorAnimationAttachedToElementId = 0; |
+ GraphicsLayer* layerForScrolling = getScrollableArea()->layerForScrolling(); |
+ if (layerForScrolling) { |
+ if (!layerForScrolling->platformLayer()->elementId()) |
+ layerForScrolling->platformLayer()->setElementId(nextCompositorElementId()); |
+ compositorAnimationAttachedToElementId = layerForScrolling->platformLayer()->elementId(); |
+ } |
- if (compositorAnimationAttachedToLayerId != m_compositorAnimationAttachedToLayerId) { |
+ if (compositorAnimationAttachedToElementId != m_compositorAnimationAttachedToElementId) { |
if (m_compositorPlayer && timeline) { |
// Detach from old layer (if any). |
- if (m_compositorAnimationAttachedToLayerId) { |
- if (m_compositorPlayer->isLayerAttached()) |
- m_compositorPlayer->detachLayer(); |
+ if (m_compositorAnimationAttachedToElementId) { |
+ if (m_compositorPlayer->isElementAttached()) |
+ m_compositorPlayer->detachElement(); |
timeline->playerDestroyed(*this); |
} |
// Attach to new layer (if any). |
- if (compositorAnimationAttachedToLayerId) { |
- ASSERT(!m_compositorPlayer->isLayerAttached()); |
+ if (compositorAnimationAttachedToElementId) { |
+ ASSERT(!m_compositorPlayer->isElementAttached()); |
timeline->playerAttached(*this); |
- m_compositorPlayer->attachLayer( |
- getScrollableArea()->layerForScrolling()->platformLayer()); |
+ m_compositorPlayer->attachElement(compositorAnimationAttachedToElementId); |
reattached = true; |
} |
- m_compositorAnimationAttachedToLayerId = compositorAnimationAttachedToLayerId; |
+ m_compositorAnimationAttachedToElementId = compositorAnimationAttachedToElementId; |
} |
} |