2010-09-23 Simon Fraser <simon.fraser@apple.com>
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Sep 2010 04:17:03 +0000 (04:17 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Sep 2010 04:17:03 +0000 (04:17 +0000)
commitfda3ad248299a25c7fd5a022acba5df34bf239c5
treedbf27faf5ae226c294a2564f05a3550ea9143dcb
parente22241b666568ef6ca6dd91041b385ed964eaab7
2010-09-23  Simon Fraser  <simon.fraser@apple.com>

        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: https://svn.webkit.org/repository/webkit/trunk@68233 268f45cc-cd09-0410-ab3c-d52691b4dbfc
19 files changed:
LayoutTests/ChangeLog
LayoutTests/animations/suspend-transform-animation-expected.checksum [new file with mode: 0644]
LayoutTests/animations/suspend-transform-animation-expected.png [new file with mode: 0644]
LayoutTests/animations/suspend-transform-animation-expected.txt [new file with mode: 0644]
LayoutTests/animations/suspend-transform-animation.html [new file with mode: 0644]
LayoutTests/transitions/repeated-firing-background-color.html
LayoutTests/transitions/suspend-transform-transition-expected.checksum [new file with mode: 0644]
LayoutTests/transitions/suspend-transform-transition-expected.png [new file with mode: 0644]
LayoutTests/transitions/suspend-transform-transition-expected.txt [new file with mode: 0644]
LayoutTests/transitions/suspend-transform-transition.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/page/animation/ImplicitAnimation.cpp
WebCore/page/animation/ImplicitAnimation.h
WebCore/platform/graphics/GraphicsLayer.cpp
WebCore/platform/graphics/GraphicsLayer.h
WebCore/platform/graphics/mac/GraphicsLayerCA.h
WebCore/platform/graphics/mac/GraphicsLayerCA.mm
WebCore/rendering/RenderLayerBacking.cpp
WebCore/rendering/RenderLayerBacking.h