Skip to content
  • simon.fraser@apple.com's avatar
    2010-09-23 Simon Fraser <simon.fraser@apple.com> · 1ae63fb7
    simon.fraser@apple.com authored
            Reviewed by Dan Bernstein.
    
            Accelerated transitions do not suspend/resume properly.
            https://bugs.webkit.org/show_bug.cgi?id=43792
    
            Fix suspending of accelerated transitions.
    
            GraphicsLayer changes unify the handling of transitions and animations
            in GraphicsLayer. Both are now identified by name, so the code
            now refers to "animationName" rather than "keyframesName". Transitions
            use a dummy name which is not a valid keyframe identifier.
    
            Tests: animations/suspend-transform-animation.html
                   transitions/suspend-transform-transition.html
    
            * page/animation/ImplicitAnimation.h:
            * page/animation/ImplicitAnimation.cpp:
            (WebCore::ImplicitAnimation::pauseAnimation): Call down to the RenderLayerBacking
            to tell it that an accelerated transition was paused.
    
            * platform/graphics/GraphicsLayer.h:
            * platform/graphics/GraphicsLayer.cpp:
            (WebCore::GraphicsLayer::animationNameForTransition): Create a name
            for the transition of the given property.
            (WebCore::GraphicsLayer::addAnimation): Generalize "keyframe" to "animation" in the parameter names.
            (WebCore::GraphicsLayer::pauseAnimation): ditto
            (WebCore::GraphicsLayer::removeAnimation): ditto
    
            * platform/graphics/mac/GraphicsLayerCA.h: Parameter renaming, and some method renames for clarity.
            (WebCore::GraphicsLayerCA::animationIsRunning):
            (WebCore::GraphicsLayerCA::LayerPropertyAnimation::LayerPropertyAnimation): struct rename for clarity.
    
            * platform/graphics/mac/GraphicsLayerCA.mm:
            (WebCore::animationIdentifier): the animationName already has the property baked in.
            (WebCore::GraphicsLayerCA::moveOrCopyLayerAnimation): just deals with one animation now.
            (WebCore::GraphicsLayerCA::moveOrCopyAnimationsForProperty): we have to trawl through
            m_runningAnimations to get the identifiers for the animations that need to be copied.
            (WebCore::GraphicsLayerCA::addAnimation): rename parameters.
            (WebCore::GraphicsLayerCA::pauseAnimation): re-ordered methods here. member var renames.
            (WebCore::GraphicsLayerCA::removeAnimation): ditto.
            (WebCore::GraphicsLayerCA::updateLayerAnimations): no need to iterate over m_transitionPropertiesToRemove,
            and no more divergence between transitions and animations.
            (WebCore::GraphicsLayerCA::setCAAnimationOnLayer): renames for clarity.
            (WebCore::GraphicsLayerCA::removeCAAnimationFromLayer): ditto
            (WebCore::GraphicsLayerCA::pauseCAAnimationOnLayer): ditto
            (WebCore::GraphicsLayerCA::createAnimationFromKeyframes): renames
            (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): renames
            (WebCore::GraphicsLayerCA::suspendAnimations): whitespace.
    
            * rendering/RenderLayerBacking.h: Group the transition and animation methods together.
            * rendering/RenderLayerBacking.cpp:
            (WebCore::RenderLayerBacking::animationPaused): Re-ordered methods for clarity.
            (WebCore::RenderLayerBacking::animationFinished): ditto
            (WebCore::RenderLayerBacking::startTransition): Use animationNameForTransition() to generate
            the animation identifier.
            (WebCore::RenderLayerBacking::transitionPaused): Call pauseAnimation, using animationNameForTransition()
            to generate the animation identifier.
            (WebCore::RenderLayerBacking::transitionFinished): Call removeAnimation, using animationNameForTransition()
            to generate the animation identifier.
            (WebCore::RenderLayerBacking::notifyAnimationStarted): Moved.
            (WebCore::RenderLayerBacking::notifySyncRequired): Moved.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68233 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    1ae63fb7