| Index: Source/core/animation/AnimationPlayer.cpp
|
| diff --git a/Source/core/animation/AnimationPlayer.cpp b/Source/core/animation/AnimationPlayer.cpp
|
| index b3ad782e389f17110f27b535006eead7da0c4ec4..d400e1bdf3c1894e04b3451efde6f89e267c5050 100644
|
| --- a/Source/core/animation/AnimationPlayer.cpp
|
| +++ b/Source/core/animation/AnimationPlayer.cpp
|
| @@ -246,8 +246,11 @@ void AnimationPlayer::preCommit(int compositorGroup, bool startOnCompositor)
|
|
|
| if (shouldStart) {
|
| m_compositorGroup = compositorGroup;
|
| - if (startOnCompositor && maybeStartAnimationOnCompositor()) {
|
| - m_compositorState = adoptPtr(new CompositorState(*this));
|
| + if (startOnCompositor) {
|
| + if (maybeStartAnimationOnCompositor())
|
| + m_compositorState = adoptPtr(new CompositorState(*this));
|
| + else
|
| + cancelIncompatibleAnimationsOnCompositor();
|
| }
|
| }
|
| }
|
| @@ -331,6 +334,15 @@ void AnimationPlayer::notifyStartTime(double timelineTime)
|
| }
|
| }
|
|
|
| +bool AnimationPlayer::affects(const Element& element, CSSPropertyID property) const
|
| +{
|
| + if (!m_content || !m_content->isAnimation())
|
| + return false;
|
| +
|
| + const Animation* animation = toAnimation(m_content.get());
|
| + return (animation->target() == &element) && animation->affects(property);
|
| +}
|
| +
|
| double AnimationPlayer::calculateStartTime(double currentTime) const
|
| {
|
| return m_timeline->effectiveTime() - currentTime / m_playbackRate;
|
| @@ -690,6 +702,18 @@ void AnimationPlayer::setCompositorPending(bool sourceChanged)
|
| }
|
| }
|
|
|
| +void AnimationPlayer::cancelAnimationOnCompositor()
|
| +{
|
| + if (hasActiveAnimationsOnCompositor())
|
| + toAnimation(m_content.get())->cancelAnimationOnCompositor();
|
| +}
|
| +
|
| +void AnimationPlayer::cancelIncompatibleAnimationsOnCompositor()
|
| +{
|
| + if (m_content && m_content->isAnimation())
|
| + toAnimation(m_content.get())->cancelIncompatibleAnimationsOnCompositor();
|
| +}
|
| +
|
| bool AnimationPlayer::hasActiveAnimationsOnCompositor()
|
| {
|
| if (!m_content || !m_content->isAnimation())
|
| @@ -698,12 +722,6 @@ bool AnimationPlayer::hasActiveAnimationsOnCompositor()
|
| return toAnimation(m_content.get())->hasActiveAnimationsOnCompositor();
|
| }
|
|
|
| -void AnimationPlayer::cancelAnimationOnCompositor()
|
| -{
|
| - if (hasActiveAnimationsOnCompositor())
|
| - toAnimation(m_content.get())->cancelAnimationOnCompositor();
|
| -}
|
| -
|
| bool AnimationPlayer::update(TimingUpdateReason reason)
|
| {
|
| if (!m_timeline)
|
| @@ -806,7 +824,6 @@ AnimationPlayer::PlayStateUpdateScope::~PlayStateUpdateScope()
|
| if (oldPlayState != newPlayState) {
|
| bool wasActive = oldPlayState == Pending || oldPlayState == Running;
|
| bool isActive = newPlayState == Pending || newPlayState == Running;
|
| -
|
| if (!wasActive && isActive)
|
| TRACE_EVENT_NESTABLE_ASYNC_BEGIN1("blink.animations," TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Animation", m_player, "data", InspectorAnimationEvent::data(*m_player));
|
| else if (wasActive && !isActive)
|
|
|