| 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 5dcc838fcfe1c0a0e10bc00ad189a783e977f59e..3d41d128b5841ed4ce633e29d53cc4fc53eb34b5 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)
|
| @@ -66,7 +66,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;
|
| }
|
| @@ -75,13 +75,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);
|
| }
|
|
|
| @@ -171,27 +171,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;
|
| }
|
| }
|
|
|
|
|