Changeset 165977 in webkit
- Timestamp:
- Mar 20, 2014, 11:32:13 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 10 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/compositing/animation/filling-animation-overlap-at-end-expected.txt (added)
-
LayoutTests/compositing/animation/filling-animation-overlap-at-end.html (added)
-
LayoutTests/compositing/animation/filling-animation-overlap-expected.txt (added)
-
LayoutTests/compositing/animation/filling-animation-overlap.html (added)
-
LayoutTests/compositing/animation/layer-for-filling-animation-expected.txt (added)
-
LayoutTests/compositing/animation/layer-for-filling-animation.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/page/animation/AnimationBase.h (modified) (2 diffs)
-
Source/WebCore/page/animation/AnimationController.cpp (modified) (2 diffs)
-
Source/WebCore/page/animation/AnimationController.h (modified) (3 diffs)
-
Source/WebCore/page/animation/AnimationControllerPrivate.h (modified) (2 diffs)
-
Source/WebCore/page/animation/CompositeAnimation.cpp (modified) (3 diffs)
-
Source/WebCore/page/animation/CompositeAnimation.h (modified) (1 diff)
-
Source/WebCore/rendering/RenderLayerBacking.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderLayerCompositor.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r165976 r165977 1 2014-03-20 Simon Fraser <simon.fraser@apple.com> 2 3 A completed fill-forwards animation should not disable overlap testing 4 https://bugs.webkit.org/show_bug.cgi?id=130522 5 <rdar://problem/15862395> 6 7 Reviewed by Dean Jackson. 8 9 Tests that dump layer trees when a fill-forwards animation has finished, 10 both when the final keyframe causes overlap, and when it does not. 11 12 * compositing/animation/filling-animation-overlap-at-end-expected.txt: Added. 13 * compositing/animation/filling-animation-overlap-at-end.html: Added. 14 * compositing/animation/filling-animation-overlap-expected.txt: Added. 15 * compositing/animation/filling-animation-overlap.html: Added. 16 * compositing/animation/layer-for-filling-animation-expected.txt: Added. 17 * compositing/animation/layer-for-filling-animation.html: Added. 18 1 19 2014-03-20 Dirk Schulze <krit@webkit.org> 2 20 -
trunk/Source/WebCore/ChangeLog
r165976 r165977 1 2014-03-20 Simon Fraser <simon.fraser@apple.com> 2 3 A completed fill-forwards animation should not disable overlap testing 4 https://bugs.webkit.org/show_bug.cgi?id=130522 5 <rdar://problem/15862395> 6 7 Reviewed by Dean Jackson. 8 9 Previously, if -webkit-transform was being keyframe-animated, and the 10 animation had fill-forwards, then we would continue to think that the 11 animation is running and turn off compositing overlap testing. This 12 caused some sites to keep too much backing store around. 13 14 Fix by having isRunning{Accelerated}AnimationOnRenderer take some flags 15 so that more specific questions about the running state can be asked. 16 For layer creation, keep using the same criteria as before (for now) 17 which includes paused and fill-forwards animations. For overlap testing, 18 don't include the fill-forwards test. 19 20 Tests: compositing/animation/filling-animation-overlap-at-end.html 21 compositing/animation/filling-animation-overlap.html 22 compositing/animation/layer-for-filling-animation.html 23 24 * page/animation/AnimationBase.h: 25 (WebCore::AnimationBase::fillingForwards): 26 (WebCore::AnimationBase::inPausedState): 27 (WebCore::AnimationBase::isAnimatingProperty): 28 * page/animation/AnimationController.cpp: 29 (WebCore::AnimationControllerPrivate::isRunningAnimationOnRenderer): 30 (WebCore::AnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer): 31 (WebCore::AnimationController::isRunningAnimationOnRenderer): 32 (WebCore::AnimationController::isRunningAcceleratedAnimationOnRenderer): 33 * page/animation/AnimationController.h: 34 * page/animation/AnimationControllerPrivate.h: 35 * page/animation/CompositeAnimation.cpp: 36 (WebCore::CompositeAnimation::isAnimatingProperty): 37 * page/animation/CompositeAnimation.h: 38 * rendering/RenderLayerBacking.cpp: 39 (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry): 40 * rendering/RenderLayerCompositor.cpp: 41 (WebCore::RenderLayerCompositor::requiresCompositingForAnimation): 42 (WebCore::RenderLayerCompositor::isRunningAcceleratedTransformAnimation): 43 1 44 2014-03-20 Dirk Schulze <krit@webkit.org> 2 45 -
trunk/Source/WebCore/page/animation/AnimationBase.h
r165676 r165977 123 123 124 124 bool postActive() const { return m_animState == AnimationStateDone; } 125 bool fillingForwards() const { return m_animState == AnimationStateFillingForwards; } 125 126 bool active() const { return !postActive() && !preActive(); } 126 127 bool running() const { return !isNew() && !postActive(); } 127 128 bool paused() const { return m_pauseTime >= 0 || m_animState == AnimationStatePausedNew; } 129 bool inPausedState() const { return m_animState >= AnimationStatePausedNew && m_animState <= AnimationStatePausedRun; } 128 130 bool isNew() const { return m_animState == AnimationStateNew || m_animState == AnimationStatePausedNew; } 129 131 bool waitingForStartTime() const { return m_animState == AnimationStateStartWaitResponse; } … … 154 156 virtual bool affectsProperty(CSSPropertyID /*property*/) const { return false; } 155 157 156 bool isAnimatingProperty(CSSPropertyID property, bool acceleratedOnly, bool isRunningNow) const 158 enum RunningStates { 159 Delaying = 1 << 0, 160 Paused = 1 << 1, 161 Running = 1 << 2, 162 FillingFowards = 1 << 3 163 }; 164 typedef unsigned RunningState; 165 bool isAnimatingProperty(CSSPropertyID property, bool acceleratedOnly, RunningState runningState) const 157 166 { 158 167 if (acceleratedOnly && !m_isAccelerated) 159 168 return false; 160 161 if (isRunningNow) 162 return (!waitingToStart() && !postActive()) && affectsProperty(property); 163 164 return !postActive() && affectsProperty(property); 169 170 if (!affectsProperty(property)) 171 return false; 172 173 if ((runningState & Delaying) && preActive()) 174 return true; 175 176 if ((runningState & Paused) && inPausedState()) 177 return true; 178 179 if ((runningState & Running) && !inPausedState() && (m_animState >= AnimationStateStartWaitStyleAvailable && m_animState <= AnimationStateDone)) 180 return true; 181 182 if ((runningState & FillingFowards) && m_animState == AnimationStateFillingForwards) 183 return true; 184 185 return false; 165 186 } 166 187 -
trunk/Source/WebCore/page/animation/AnimationController.cpp
r165676 r165977 237 237 } 238 238 239 bool AnimationControllerPrivate::isRunningAnimationOnRenderer(RenderElement* renderer, CSSPropertyID property, bool isRunningNow) const239 bool AnimationControllerPrivate::isRunningAnimationOnRenderer(RenderElement* renderer, CSSPropertyID property, AnimationBase::RunningState runningState) const 240 240 { 241 241 const CompositeAnimation* animation = m_compositeAnimations.get(renderer); 242 return animation && animation->isAnimatingProperty(property, false, isRunningNow);243 } 244 245 bool AnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer(RenderElement* renderer, CSSPropertyID property, bool isRunningNow) const242 return animation && animation->isAnimatingProperty(property, false, runningState); 243 } 244 245 bool AnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer(RenderElement* renderer, CSSPropertyID property, AnimationBase::RunningState runningState) const 246 246 { 247 247 const CompositeAnimation* animation = m_compositeAnimations.get(renderer); 248 return animation && animation->isAnimatingProperty(property, true, isRunningNow);248 return animation && animation->isAnimatingProperty(property, true, runningState); 249 249 } 250 250 … … 556 556 } 557 557 558 bool AnimationController::isRunningAnimationOnRenderer(RenderElement* renderer, CSSPropertyID property, bool isRunningNow) const559 { 560 return m_data->isRunningAnimationOnRenderer(renderer, property, isRunningNow);561 } 562 563 bool AnimationController::isRunningAcceleratedAnimationOnRenderer(RenderElement* renderer, CSSPropertyID property, bool isRunningNow) const564 { 565 return m_data->isRunningAcceleratedAnimationOnRenderer(renderer, property, isRunningNow);558 bool AnimationController::isRunningAnimationOnRenderer(RenderElement* renderer, CSSPropertyID property, AnimationBase::RunningState runningState) const 559 { 560 return m_data->isRunningAnimationOnRenderer(renderer, property, runningState); 561 } 562 563 bool AnimationController::isRunningAcceleratedAnimationOnRenderer(RenderElement* renderer, CSSPropertyID property, AnimationBase::RunningState runningState) const 564 { 565 return m_data->isRunningAcceleratedAnimationOnRenderer(renderer, property, runningState); 566 566 } 567 567 -
trunk/Source/WebCore/page/animation/AnimationController.h
r165676 r165977 30 30 #define AnimationController_h 31 31 32 #include "AnimationBase.h" 32 33 #include "CSSPropertyNames.h" 33 34 #include <wtf/Forward.h> … … 36 37 namespace WebCore { 37 38 38 class AnimationBase;39 39 class AnimationControllerPrivate; 40 40 class Document; … … 60 60 unsigned numberOfActiveAnimations(Document*) const; // To be used only for testing 61 61 62 bool isRunningAnimationOnRenderer(RenderElement*, CSSPropertyID, bool isRunningNow = true) const;63 bool isRunningAcceleratedAnimationOnRenderer(RenderElement*, CSSPropertyID, bool isRunningNow = true) const;62 bool isRunningAnimationOnRenderer(RenderElement*, CSSPropertyID, AnimationBase::RunningState) const; 63 bool isRunningAcceleratedAnimationOnRenderer(RenderElement*, CSSPropertyID, AnimationBase::RunningState) const; 64 64 65 65 bool isSuspended() const; -
trunk/Source/WebCore/page/animation/AnimationControllerPrivate.h
r165676 r165977 30 30 #define AnimationControllerPrivate_h 31 31 32 #include "AnimationBase.h" 32 33 #include "CSSPropertyNames.h" 33 34 #include "Timer.h" … … 86 87 void startAnimationsIfNotSuspended(Document*); 87 88 88 bool isRunningAnimationOnRenderer(RenderElement*, CSSPropertyID, bool isRunningNow) const;89 bool isRunningAcceleratedAnimationOnRenderer(RenderElement*, CSSPropertyID, bool isRunningNow) const;89 bool isRunningAnimationOnRenderer(RenderElement*, CSSPropertyID, AnimationBase::RunningState) const; 90 bool isRunningAcceleratedAnimationOnRenderer(RenderElement*, CSSPropertyID, AnimationBase::RunningState) const; 90 91 91 92 bool pauseAnimationAtTime(RenderElement*, const AtomicString& name, double t); -
trunk/Source/WebCore/page/animation/CompositeAnimation.cpp
r165676 r165977 474 474 } 475 475 476 bool CompositeAnimation::isAnimatingProperty(CSSPropertyID property, bool acceleratedOnly, bool isRunningNow) const476 bool CompositeAnimation::isAnimatingProperty(CSSPropertyID property, bool acceleratedOnly, AnimationBase::RunningState runningState) const 477 477 { 478 478 if (!m_keyframeAnimations.isEmpty()) { … … 481 481 for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) { 482 482 KeyframeAnimation* anim = it->value.get(); 483 if (anim && anim->isAnimatingProperty(property, acceleratedOnly, isRunningNow))483 if (anim && anim->isAnimatingProperty(property, acceleratedOnly, runningState)) 484 484 return true; 485 485 } … … 490 490 for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) { 491 491 ImplicitAnimation* anim = it->value.get(); 492 if (anim && anim->isAnimatingProperty(property, acceleratedOnly, isRunningNow))492 if (anim && anim->isAnimatingProperty(property, acceleratedOnly, runningState)) 493 493 return true; 494 494 } -
trunk/Source/WebCore/page/animation/CompositeAnimation.h
r165676 r165977 69 69 bool hasAnimations() const { return !m_transitions.isEmpty() || !m_keyframeAnimations.isEmpty(); } 70 70 71 bool isAnimatingProperty(CSSPropertyID, bool acceleratedOnly, bool isRunningNow) const;71 bool isAnimatingProperty(CSSPropertyID, bool acceleratedOnly, AnimationBase::RunningState) const; 72 72 73 73 PassRefPtr<KeyframeAnimation> getAnimationForProperty(CSSPropertyID) const; -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r165963 r165977 671 671 // Set transform property, if it is not animating. We have to do this here because the transform 672 672 // is affected by the layer dimensions. 673 if (!renderer().animation().isRunningAcceleratedAnimationOnRenderer(&renderer(), CSSPropertyWebkitTransform ))673 if (!renderer().animation().isRunningAcceleratedAnimationOnRenderer(&renderer(), CSSPropertyWebkitTransform, AnimationBase::Running | AnimationBase::Paused | AnimationBase::FillingFowards)) 674 674 updateTransform(&renderer().style()); 675 675 676 676 // Set opacity, if it is not animating. 677 if (!renderer().animation().isRunningAcceleratedAnimationOnRenderer(&renderer(), CSSPropertyOpacity ))677 if (!renderer().animation().isRunningAcceleratedAnimationOnRenderer(&renderer(), CSSPropertyOpacity, AnimationBase::Running | AnimationBase::Paused | AnimationBase::FillingFowards)) 678 678 updateOpacity(&renderer().style()); 679 679 -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r165970 r165977 2369 2369 return false; 2370 2370 2371 const AnimationBase::RunningState activeAnimationState = AnimationBase::Running | AnimationBase::Paused | AnimationBase::FillingFowards; 2371 2372 AnimationController& animController = renderer.animation(); 2372 return (animController.isRunningAnimationOnRenderer(&renderer, CSSPropertyOpacity )2373 return (animController.isRunningAnimationOnRenderer(&renderer, CSSPropertyOpacity, activeAnimationState) 2373 2374 && (inCompositingMode() || (m_compositingTriggers & ChromeClient::AnimatedOpacityTrigger))) 2374 2375 #if ENABLE(CSS_FILTERS) 2375 || animController.isRunningAnimationOnRenderer(&renderer, CSSPropertyWebkitFilter )2376 || animController.isRunningAnimationOnRenderer(&renderer, CSSPropertyWebkitFilter, activeAnimationState) 2376 2377 #endif // CSS_FILTERS 2377 || animController.isRunningAnimationOnRenderer(&renderer, CSSPropertyWebkitTransform );2378 || animController.isRunningAnimationOnRenderer(&renderer, CSSPropertyWebkitTransform, activeAnimationState); 2378 2379 } 2379 2380 … … 2555 2556 return false; 2556 2557 2557 return renderer.animation().isRunningA nimationOnRenderer(&renderer, CSSPropertyWebkitTransform);2558 return renderer.animation().isRunningAcceleratedAnimationOnRenderer(&renderer, CSSPropertyWebkitTransform, AnimationBase::Running | AnimationBase::Paused); 2558 2559 } 2559 2560
Note:
See TracChangeset
for help on using the changeset viewer.