Changeset 239985 in webkit
- Timestamp:
- Jan 15, 2019, 8:24:57 AM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 10 edited
-
ChangeLog (modified) (1 diff)
-
page/animation/AnimationBase.h (modified) (2 diffs)
-
page/animation/CSSAnimationController.cpp (modified) (5 diffs)
-
page/animation/CSSAnimationController.h (modified) (1 diff)
-
page/animation/CSSAnimationControllerPrivate.h (modified) (1 diff)
-
page/animation/CompositeAnimation.cpp (modified) (2 diffs)
-
page/animation/CompositeAnimation.h (modified) (1 diff)
-
rendering/RenderLayer.cpp (modified) (1 diff)
-
rendering/RenderLayerBacking.cpp (modified) (1 diff)
-
rendering/RenderLayerCompositor.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r239984 r239985 1 2019-01-15 Simon Fraser <simon.fraser@apple.com> 2 3 Simplify isRunningAnimationOnRenderer() 4 https://bugs.webkit.org/show_bug.cgi?id=193435 5 6 Reviewed by Darin Adler. 7 8 All callers of CSSAnimationController::isRunningAnimationOnRenderer() pass AnimationBase::Running | AnimationBase::Paused, 9 so we can remove the parameter and just hardcode this behavior. 10 11 This will simplify a later patch that needs to consider state changes between running and not running. 12 13 No behavior change. 14 15 * page/animation/AnimationBase.h: 16 (WebCore::AnimationBase::isAnimatingProperty const): 17 * page/animation/CSSAnimationController.cpp: 18 (WebCore::CSSAnimationControllerPrivate::isRunningAnimationOnRenderer const): 19 (WebCore::CSSAnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer const): 20 (WebCore::CSSAnimationControllerPrivate::computeExtentOfAnimation const): 21 (WebCore::CSSAnimationController::isRunningAnimationOnRenderer const): 22 (WebCore::CSSAnimationController::isRunningAcceleratedAnimationOnRenderer const): 23 * page/animation/CSSAnimationController.h: 24 * page/animation/CSSAnimationControllerPrivate.h: 25 * page/animation/CompositeAnimation.cpp: 26 (WebCore::CompositeAnimation::isAnimatingProperty const): 27 * page/animation/CompositeAnimation.h: 28 * rendering/RenderLayer.cpp: 29 (WebCore::RenderLayer::currentTransform const): 30 * rendering/RenderLayerBacking.cpp: 31 (WebCore::RenderLayerBacking::updateGeometry): 32 * rendering/RenderLayerCompositor.cpp: 33 (WebCore::RenderLayerCompositor::requiresCompositingForAnimation const): 34 (WebCore::RenderLayerCompositor::isRunningTransformAnimation const): 35 1 36 2019-01-15 Antti Koivisto <antti@apple.com> 2 37 -
trunk/Source/WebCore/page/animation/AnimationBase.h
r239427 r239985 156 156 virtual bool affectsProperty(CSSPropertyID /*property*/) const { return false; } 157 157 158 enum RunningStates { 159 Delaying = 1 << 0, 160 Paused = 1 << 1, 161 Running = 1 << 2, 162 }; 163 typedef unsigned RunningState; 164 bool isAnimatingProperty(CSSPropertyID property, bool acceleratedOnly, RunningState runningState) const 158 bool isAnimatingProperty(CSSPropertyID property, bool acceleratedOnly) const 165 159 { 166 160 if (acceleratedOnly && !m_isAccelerated) … … 170 164 return false; 171 165 172 if ( (runningState & Delaying) && preActive())166 if (inPausedState()) 173 167 return true; 174 168 175 if ((runningState & Paused) && inPausedState()) 176 return true; 177 178 if ((runningState & Running) && !inPausedState() && (m_animationState >= AnimationState::StartWaitStyleAvailable && m_animationState < AnimationState::Done)) 169 if (m_animationState >= AnimationState::StartWaitStyleAvailable && m_animationState < AnimationState::Done) 179 170 return true; 180 171 -
trunk/Source/WebCore/page/animation/CSSAnimationController.cpp
r239965 r239985 291 291 } 292 292 293 bool CSSAnimationControllerPrivate::isRunningAnimationOnRenderer(RenderElement& renderer, CSSPropertyID property , AnimationBase::RunningState runningState) const293 bool CSSAnimationControllerPrivate::isRunningAnimationOnRenderer(RenderElement& renderer, CSSPropertyID property) const 294 294 { 295 295 if (!renderer.element()) … … 298 298 if (!animation) 299 299 return false; 300 return animation->isAnimatingProperty(property, false , runningState);301 } 302 303 bool CSSAnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer(RenderElement& renderer, CSSPropertyID property , AnimationBase::RunningState runningState) const300 return animation->isAnimatingProperty(property, false); 301 } 302 303 bool CSSAnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer(RenderElement& renderer, CSSPropertyID property) const 304 304 { 305 305 if (!renderer.element()) … … 308 308 if (!animation) 309 309 return false; 310 return animation->isAnimatingProperty(property, true , runningState);310 return animation->isAnimatingProperty(property, true); 311 311 } 312 312 … … 490 490 return true; 491 491 492 if (!animation->isAnimatingProperty(CSSPropertyTransform, false , AnimationBase::Running | AnimationBase::Paused))492 if (!animation->isAnimatingProperty(CSSPropertyTransform, false)) 493 493 return true; 494 494 … … 694 694 } 695 695 696 bool CSSAnimationController::isRunningAnimationOnRenderer(RenderElement& renderer, CSSPropertyID property , AnimationBase::RunningState runningState) const696 bool CSSAnimationController::isRunningAnimationOnRenderer(RenderElement& renderer, CSSPropertyID property) const 697 697 { 698 698 if (!renderer.style().hasAnimationsOrTransitions()) 699 699 return false; 700 return m_data->isRunningAnimationOnRenderer(renderer, property , runningState);701 } 702 703 bool CSSAnimationController::isRunningAcceleratedAnimationOnRenderer(RenderElement& renderer, CSSPropertyID property , AnimationBase::RunningState runningState) const700 return m_data->isRunningAnimationOnRenderer(renderer, property); 701 } 702 703 bool CSSAnimationController::isRunningAcceleratedAnimationOnRenderer(RenderElement& renderer, CSSPropertyID property) const 704 704 { 705 705 if (!renderer.style().hasAnimationsOrTransitions()) 706 706 return false; 707 return m_data->isRunningAcceleratedAnimationOnRenderer(renderer, property , runningState);707 return m_data->isRunningAcceleratedAnimationOnRenderer(renderer, property); 708 708 } 709 709 -
trunk/Source/WebCore/page/animation/CSSAnimationController.h
r236750 r239985 70 70 WEBCORE_EXPORT unsigned numberOfActiveAnimations(Document*) const; // To be used only for testing 71 71 72 bool isRunningAnimationOnRenderer(RenderElement&, CSSPropertyID, AnimationBase::RunningState) const; 73 bool isRunningAcceleratedAnimationOnRenderer(RenderElement&, CSSPropertyID, AnimationBase::RunningState) const; 72 // "Running" here means the animation is running or paused. 73 bool isRunningAnimationOnRenderer(RenderElement&, CSSPropertyID) const; 74 bool isRunningAcceleratedAnimationOnRenderer(RenderElement&, CSSPropertyID) const; 74 75 75 76 WEBCORE_EXPORT bool isSuspended() const; -
trunk/Source/WebCore/page/animation/CSSAnimationControllerPrivate.h
r239427 r239985 77 77 void detachFromDocument(Document*); 78 78 79 bool isRunningAnimationOnRenderer(RenderElement&, CSSPropertyID , AnimationBase::RunningState) const;80 bool isRunningAcceleratedAnimationOnRenderer(RenderElement&, CSSPropertyID , AnimationBase::RunningState) const;79 bool isRunningAnimationOnRenderer(RenderElement&, CSSPropertyID) const; 80 bool isRunningAcceleratedAnimationOnRenderer(RenderElement&, CSSPropertyID) const; 81 81 82 82 bool pauseAnimationAtTime(Element&, const AtomicString& name, double t); -
trunk/Source/WebCore/page/animation/CompositeAnimation.cpp
r239427 r239985 511 511 } 512 512 513 bool CompositeAnimation::isAnimatingProperty(CSSPropertyID property, bool acceleratedOnly , AnimationBase::RunningState runningState) const513 bool CompositeAnimation::isAnimatingProperty(CSSPropertyID property, bool acceleratedOnly) const 514 514 { 515 515 if (!m_keyframeAnimations.isEmpty()) { 516 516 m_keyframeAnimations.checkConsistency(); 517 517 for (auto& animation : m_keyframeAnimations.values()) { 518 if (animation->isAnimatingProperty(property, acceleratedOnly , runningState))518 if (animation->isAnimatingProperty(property, acceleratedOnly)) 519 519 return true; 520 520 } … … 523 523 if (!m_transitions.isEmpty()) { 524 524 for (auto& transition : m_transitions.values()) { 525 if (transition->isAnimatingProperty(property, acceleratedOnly , runningState))525 if (transition->isAnimatingProperty(property, acceleratedOnly)) 526 526 return true; 527 527 } -
trunk/Source/WebCore/page/animation/CompositeAnimation.h
r239427 r239985 70 70 bool hasAnimations() const { return !m_transitions.isEmpty() || !m_keyframeAnimations.isEmpty(); } 71 71 72 bool isAnimatingProperty(CSSPropertyID, bool acceleratedOnly , AnimationBase::RunningState) const;72 bool isAnimatingProperty(CSSPropertyID, bool acceleratedOnly) const; 73 73 74 74 KeyframeAnimation* animationForProperty(CSSPropertyID) const; -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r239965 r239985 1206 1206 } 1207 1207 } else { 1208 if (renderer().animation().isRunningAcceleratedAnimationOnRenderer(renderer(), CSSPropertyTransform , AnimationBase::Running | AnimationBase::Paused)) {1208 if (renderer().animation().isRunningAcceleratedAnimationOnRenderer(renderer(), CSSPropertyTransform)) { 1209 1209 TransformationMatrix currTransform; 1210 1210 FloatRect pixelSnappedBorderRect = snapRectToDevicePixels(box->borderBoxRect(), box->document().deviceScaleFactor()); -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r239576 r239985 991 991 } 992 992 } else { 993 isRunningAcceleratedTransformAnimation = renderer().animation().isRunningAcceleratedAnimationOnRenderer(renderer(), CSSPropertyTransform , AnimationBase::Running | AnimationBase::Paused);994 isRunningAcceleratedOpacityAnimation = renderer().animation().isRunningAcceleratedAnimationOnRenderer(renderer(), CSSPropertyOpacity , AnimationBase::Running | AnimationBase::Paused);993 isRunningAcceleratedTransformAnimation = renderer().animation().isRunningAcceleratedAnimationOnRenderer(renderer(), CSSPropertyTransform); 994 isRunningAcceleratedOpacityAnimation = renderer().animation().isRunningAcceleratedAnimationOnRenderer(renderer(), CSSPropertyOpacity); 995 995 } 996 996 -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r239658 r239985 2440 2440 return false; 2441 2441 2442 const AnimationBase::RunningState activeAnimationState = AnimationBase::Running | AnimationBase::Paused;2443 2442 auto& animController = renderer.animation(); 2444 return (animController.isRunningAnimationOnRenderer(renderer, CSSPropertyOpacity , activeAnimationState)2443 return (animController.isRunningAnimationOnRenderer(renderer, CSSPropertyOpacity) 2445 2444 && (usesCompositing() || (m_compositingTriggers & ChromeClient::AnimatedOpacityTrigger))) 2446 || animController.isRunningAnimationOnRenderer(renderer, CSSPropertyFilter , activeAnimationState)2445 || animController.isRunningAnimationOnRenderer(renderer, CSSPropertyFilter) 2447 2446 #if ENABLE(FILTERS_LEVEL_2) 2448 || animController.isRunningAnimationOnRenderer(renderer, CSSPropertyWebkitBackdropFilter , activeAnimationState)2449 #endif 2450 || animController.isRunningAnimationOnRenderer(renderer, CSSPropertyTransform , activeAnimationState);2447 || animController.isRunningAnimationOnRenderer(renderer, CSSPropertyWebkitBackdropFilter) 2448 #endif 2449 || animController.isRunningAnimationOnRenderer(renderer, CSSPropertyTransform); 2451 2450 } 2452 2451 … … 2857 2856 return false; 2858 2857 } 2859 return renderer.animation().isRunningAnimationOnRenderer(renderer, CSSPropertyTransform , AnimationBase::Running | AnimationBase::Paused);2858 return renderer.animation().isRunningAnimationOnRenderer(renderer, CSSPropertyTransform); 2860 2859 } 2861 2860
Note:
See TracChangeset
for help on using the changeset viewer.