| 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..70fa7f9c8fcd895a82bf3e86de76840c8ddab77a 100644
|
| --- a/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.cpp
|
| +++ b/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.cpp
|
| @@ -6,6 +6,7 @@
|
|
|
| #include "cc/animation/scroll_offset_animation_curve.h"
|
| #include "platform/RuntimeEnabledFeatures.h"
|
| +#include "platform/animation/CompositorAnimationHost.h"
|
| #include "platform/animation/CompositorAnimationPlayer.h"
|
| #include "platform/animation/CompositorAnimationTimeline.h"
|
| #include "platform/graphics/CompositorFactory.h"
|
| @@ -47,6 +48,9 @@ void ScrollAnimatorCompositorCoordinator::resetAnimationState()
|
|
|
| bool ScrollAnimatorCompositorCoordinator::hasAnimationThatRequiresService() const
|
| {
|
| + if (!m_implOnlyAnimationAdjustment.isZero())
|
| + return true;
|
| +
|
| switch (m_runState) {
|
| case RunState::Idle:
|
| case RunState::RunningOnCompositor:
|
| @@ -238,6 +242,33 @@ FloatPoint ScrollAnimatorCompositorCoordinator::blinkOffsetFromCompositorOffset(
|
| return offset;
|
| }
|
|
|
| +void ScrollAnimatorCompositorCoordinator::updateCompositorAnimations()
|
| +{
|
| + if (!getScrollableArea()->scrollAnimatorEnabled() || m_implOnlyAnimationAdjustment.isZero())
|
| + return;
|
| +
|
| + GraphicsLayer* layer = getScrollableArea()->layerForScrolling();
|
| + CompositorAnimationTimeline* timeline = getScrollableArea()->compositorAnimationTimeline();
|
| + if (layer && timeline && !timeline->compositorAnimationHost().isNull()) {
|
| + CompositorAnimationHost host = timeline->compositorAnimationHost();
|
| + host.updateImplOnlyScrollOffsetAnimation(
|
| + gfx::Vector2dF(m_implOnlyAnimationAdjustment.width(), m_implOnlyAnimationAdjustment.height()),
|
| + layer->platformLayer()->id());
|
| + }
|
| + m_implOnlyAnimationAdjustment = FloatSize();
|
| +}
|
| +
|
| +void ScrollAnimatorCompositorCoordinator::updateImplOnlyScrollOffsetAnimation(
|
| + const FloatSize& adjustment)
|
| +{
|
| + if (!getScrollableArea()->scrollAnimatorEnabled())
|
| + return;
|
| +
|
| + m_implOnlyAnimationAdjustment.expand(adjustment.width(), adjustment.height());
|
| +
|
| + getScrollableArea()->registerForAnimation();
|
| +}
|
| +
|
| String ScrollAnimatorCompositorCoordinator::runStateAsText() const
|
| {
|
| switch (m_runState) {
|
|
|