WebKit Bugzilla
Attachment 359136 Details for
Bug 193435
: Simplify isRunningAnimationOnRenderer()
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193435-20190114220718.patch (text/plain), 15.74 KB, created by
Simon Fraser (smfr)
on 2019-01-14 22:07:19 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Simon Fraser (smfr)
Created:
2019-01-14 22:07:19 PST
Size:
15.74 KB
patch
obsolete
>Subversion Revision: 239974 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index b0e39299516923479ff0e3a569b014e11fed324a..9e63292572fa4ee5f60ea7403f3594e6983e0b63 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,38 @@ >+2019-01-14 Simon Fraser <simon.fraser@apple.com> >+ >+ Simplify isRunningAnimationOnRenderer() >+ https://bugs.webkit.org/show_bug.cgi?id=193435 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ All callers of CSSAnimationController::isRunningAnimationOnRenderer() pass AnimationBase::Running | AnimationBase::Paused, >+ so we can remove the parameter and just hardcode this behavior. >+ >+ This will simplify a later patch that needs to consider state changes between running and not running. >+ >+ No behavior change. >+ >+ * page/animation/AnimationBase.h: >+ (WebCore::AnimationBase::isAnimatingProperty const): >+ * page/animation/CSSAnimationController.cpp: >+ (WebCore::CSSAnimationControllerPrivate::isRunningAnimationOnRenderer const): >+ (WebCore::CSSAnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer const): >+ (WebCore::CSSAnimationControllerPrivate::computeExtentOfAnimation const): >+ (WebCore::CSSAnimationController::isRunningAnimationOnRenderer const): >+ (WebCore::CSSAnimationController::isRunningAcceleratedAnimationOnRenderer const): >+ * page/animation/CSSAnimationController.h: >+ * page/animation/CSSAnimationControllerPrivate.h: >+ * page/animation/CompositeAnimation.cpp: >+ (WebCore::CompositeAnimation::isAnimatingProperty const): >+ * page/animation/CompositeAnimation.h: >+ * rendering/RenderLayer.cpp: >+ (WebCore::RenderLayer::currentTransform const): >+ * rendering/RenderLayerBacking.cpp: >+ (WebCore::RenderLayerBacking::updateGeometry): >+ * rendering/RenderLayerCompositor.cpp: >+ (WebCore::RenderLayerCompositor::requiresCompositingForAnimation const): >+ (WebCore::RenderLayerCompositor::isRunningTransformAnimation const): >+ > 2019-01-14 Alex Christensen <achristensen@webkit.org> > > Split headerValueForVary into specialized functions for NetworkProcess and WebProcess/WebKitLegacy >diff --git a/Source/WebCore/page/animation/AnimationBase.h b/Source/WebCore/page/animation/AnimationBase.h >index 0631ee676c5e1977ac8a71166a9ffd35272ce6f4..6ff7bff9518cd968cc4b27faf2e7b28c0289dfdc 100644 >--- a/Source/WebCore/page/animation/AnimationBase.h >+++ b/Source/WebCore/page/animation/AnimationBase.h >@@ -155,13 +155,7 @@ public: > // Does this animation/transition involve the given property? > virtual bool affectsProperty(CSSPropertyID /*property*/) const { return false; } > >- enum RunningStates { >- Delaying = 1 << 0, >- Paused = 1 << 1, >- Running = 1 << 2, >- }; >- typedef unsigned RunningState; >- bool isAnimatingProperty(CSSPropertyID property, bool acceleratedOnly, RunningState runningState) const >+ bool isAnimatingProperty(CSSPropertyID property, bool acceleratedOnly) const > { > if (acceleratedOnly && !m_isAccelerated) > return false; >@@ -169,13 +163,10 @@ public: > if (!affectsProperty(property)) > return false; > >- if ((runningState & Delaying) && preActive()) >- return true; >- >- if ((runningState & Paused) && inPausedState()) >+ if (inPausedState()) > return true; > >- if ((runningState & Running) && !inPausedState() && (m_animationState >= AnimationState::StartWaitStyleAvailable && m_animationState < AnimationState::Done)) >+ if (m_animationState >= AnimationState::StartWaitStyleAvailable && m_animationState < AnimationState::Done) > return true; > > return false; >diff --git a/Source/WebCore/page/animation/CSSAnimationController.cpp b/Source/WebCore/page/animation/CSSAnimationController.cpp >index 32108b49a7065508718e70a30332b3dc363734a8..339913cd72c65c66d99a3bc3c6f816e291d4f7f0 100644 >--- a/Source/WebCore/page/animation/CSSAnimationController.cpp >+++ b/Source/WebCore/page/animation/CSSAnimationController.cpp >@@ -290,24 +290,24 @@ void CSSAnimationControllerPrivate::animationTimerFired() > fireEventsAndUpdateStyle(); > } > >-bool CSSAnimationControllerPrivate::isRunningAnimationOnRenderer(RenderElement& renderer, CSSPropertyID property, AnimationBase::RunningState runningState) const >+bool CSSAnimationControllerPrivate::isRunningAnimationOnRenderer(RenderElement& renderer, CSSPropertyID property) const > { > if (!renderer.element()) > return false; > auto* animation = m_compositeAnimations.get(renderer.element()); > if (!animation) > return false; >- return animation->isAnimatingProperty(property, false, runningState); >+ return animation->isAnimatingProperty(property, false); > } > >-bool CSSAnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer(RenderElement& renderer, CSSPropertyID property, AnimationBase::RunningState runningState) const >+bool CSSAnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer(RenderElement& renderer, CSSPropertyID property) const > { > if (!renderer.element()) > return false; > auto* animation = m_compositeAnimations.get(renderer.element()); > if (!animation) > return false; >- return animation->isAnimatingProperty(property, true, runningState); >+ return animation->isAnimatingProperty(property, true); > } > > void CSSAnimationControllerPrivate::updateThrottlingState() >@@ -489,7 +489,7 @@ bool CSSAnimationControllerPrivate::computeExtentOfAnimation(Element& element, L > if (!animation) > return true; > >- if (!animation->isAnimatingProperty(CSSPropertyTransform, false, AnimationBase::Running | AnimationBase::Paused)) >+ if (!animation->isAnimatingProperty(CSSPropertyTransform, false)) > return true; > > return animation->computeExtentOfTransformAnimation(bounds); >@@ -693,18 +693,18 @@ bool CSSAnimationController::pauseTransitionAtTime(Element& element, const Strin > return m_data->pauseTransitionAtTime(element, property, t); > } > >-bool CSSAnimationController::isRunningAnimationOnRenderer(RenderElement& renderer, CSSPropertyID property, AnimationBase::RunningState runningState) const >+bool CSSAnimationController::isRunningAnimationOnRenderer(RenderElement& renderer, CSSPropertyID property) const > { > if (!renderer.style().hasAnimationsOrTransitions()) > return false; >- return m_data->isRunningAnimationOnRenderer(renderer, property, runningState); >+ return m_data->isRunningAnimationOnRenderer(renderer, property); > } > >-bool CSSAnimationController::isRunningAcceleratedAnimationOnRenderer(RenderElement& renderer, CSSPropertyID property, AnimationBase::RunningState runningState) const >+bool CSSAnimationController::isRunningAcceleratedAnimationOnRenderer(RenderElement& renderer, CSSPropertyID property) const > { > if (!renderer.style().hasAnimationsOrTransitions()) > return false; >- return m_data->isRunningAcceleratedAnimationOnRenderer(renderer, property, runningState); >+ return m_data->isRunningAcceleratedAnimationOnRenderer(renderer, property); > } > > bool CSSAnimationController::isSuspended() const >diff --git a/Source/WebCore/page/animation/CSSAnimationController.h b/Source/WebCore/page/animation/CSSAnimationController.h >index 5b2e67a91f9f791a61b705b1c166a3dcfc1c2ec9..06b566e210ef5b3df467625edfb1590be5f92eee 100644 >--- a/Source/WebCore/page/animation/CSSAnimationController.h >+++ b/Source/WebCore/page/animation/CSSAnimationController.h >@@ -69,8 +69,9 @@ public: > WEBCORE_EXPORT bool pauseTransitionAtTime(Element&, const String& property, double t); // To be used only for testing > WEBCORE_EXPORT unsigned numberOfActiveAnimations(Document*) const; // To be used only for testing > >- bool isRunningAnimationOnRenderer(RenderElement&, CSSPropertyID, AnimationBase::RunningState) const; >- bool isRunningAcceleratedAnimationOnRenderer(RenderElement&, CSSPropertyID, AnimationBase::RunningState) const; >+ // "Running" here means the animation is running or paused. >+ bool isRunningAnimationOnRenderer(RenderElement&, CSSPropertyID) const; >+ bool isRunningAcceleratedAnimationOnRenderer(RenderElement&, CSSPropertyID) const; > > WEBCORE_EXPORT bool isSuspended() const; > WEBCORE_EXPORT void suspendAnimations(); >diff --git a/Source/WebCore/page/animation/CSSAnimationControllerPrivate.h b/Source/WebCore/page/animation/CSSAnimationControllerPrivate.h >index 4c763d530f830812202567efb5c2e574f3637350..b324c61b33caff837f7471470792121d5a8fe0d2 100644 >--- a/Source/WebCore/page/animation/CSSAnimationControllerPrivate.h >+++ b/Source/WebCore/page/animation/CSSAnimationControllerPrivate.h >@@ -76,8 +76,8 @@ public: > void startAnimationsIfNotSuspended(Document*); > void detachFromDocument(Document*); > >- bool isRunningAnimationOnRenderer(RenderElement&, CSSPropertyID, AnimationBase::RunningState) const; >- bool isRunningAcceleratedAnimationOnRenderer(RenderElement&, CSSPropertyID, AnimationBase::RunningState) const; >+ bool isRunningAnimationOnRenderer(RenderElement&, CSSPropertyID) const; >+ bool isRunningAcceleratedAnimationOnRenderer(RenderElement&, CSSPropertyID) const; > > bool pauseAnimationAtTime(Element&, const AtomicString& name, double t); > bool pauseTransitionAtTime(Element&, const String& property, double t); >diff --git a/Source/WebCore/page/animation/CompositeAnimation.cpp b/Source/WebCore/page/animation/CompositeAnimation.cpp >index f9d9968fafa956b5391a6fd22d1195c2ad85febe..b2d1567db708a622c4b98ead98050a79b9234e5f 100644 >--- a/Source/WebCore/page/animation/CompositeAnimation.cpp >+++ b/Source/WebCore/page/animation/CompositeAnimation.cpp >@@ -510,19 +510,19 @@ void CompositeAnimation::resumeOverriddenImplicitAnimations(CSSPropertyID proper > } > } > >-bool CompositeAnimation::isAnimatingProperty(CSSPropertyID property, bool acceleratedOnly, AnimationBase::RunningState runningState) const >+bool CompositeAnimation::isAnimatingProperty(CSSPropertyID property, bool acceleratedOnly) const > { > if (!m_keyframeAnimations.isEmpty()) { > m_keyframeAnimations.checkConsistency(); > for (auto& animation : m_keyframeAnimations.values()) { >- if (animation->isAnimatingProperty(property, acceleratedOnly, runningState)) >+ if (animation->isAnimatingProperty(property, acceleratedOnly)) > return true; > } > } > > if (!m_transitions.isEmpty()) { > for (auto& transition : m_transitions.values()) { >- if (transition->isAnimatingProperty(property, acceleratedOnly, runningState)) >+ if (transition->isAnimatingProperty(property, acceleratedOnly)) > return true; > } > } >diff --git a/Source/WebCore/page/animation/CompositeAnimation.h b/Source/WebCore/page/animation/CompositeAnimation.h >index 3ec2c5545ee452f6c92136876a8f1e946b98cff4..4052b93d4b149aad83d512765cc5dd5bdd443beb 100644 >--- a/Source/WebCore/page/animation/CompositeAnimation.h >+++ b/Source/WebCore/page/animation/CompositeAnimation.h >@@ -69,7 +69,7 @@ public: > > bool hasAnimations() const { return !m_transitions.isEmpty() || !m_keyframeAnimations.isEmpty(); } > >- bool isAnimatingProperty(CSSPropertyID, bool acceleratedOnly, AnimationBase::RunningState) const; >+ bool isAnimatingProperty(CSSPropertyID, bool acceleratedOnly) const; > > KeyframeAnimation* animationForProperty(CSSPropertyID) const; > >diff --git a/Source/WebCore/rendering/RenderLayer.cpp b/Source/WebCore/rendering/RenderLayer.cpp >index 410f2d31a79f581ad82bf4b4c9807f0ddf553593..ca9d11815168f1a0d69cce61a97bcac0c572e317 100644 >--- a/Source/WebCore/rendering/RenderLayer.cpp >+++ b/Source/WebCore/rendering/RenderLayer.cpp >@@ -1205,7 +1205,7 @@ TransformationMatrix RenderLayer::currentTransform(RenderStyle::ApplyTransformOr > } > } > } else { >- if (renderer().animation().isRunningAcceleratedAnimationOnRenderer(renderer(), CSSPropertyTransform, AnimationBase::Running | AnimationBase::Paused)) { >+ if (renderer().animation().isRunningAcceleratedAnimationOnRenderer(renderer(), CSSPropertyTransform)) { > TransformationMatrix currTransform; > FloatRect pixelSnappedBorderRect = snapRectToDevicePixels(box->borderBoxRect(), box->document().deviceScaleFactor()); > std::unique_ptr<RenderStyle> style = renderer().animation().animatedStyleForRenderer(renderer()); >diff --git a/Source/WebCore/rendering/RenderLayerBacking.cpp b/Source/WebCore/rendering/RenderLayerBacking.cpp >index be8bba0a7c86eb19e424d75b1b04051e1ae9158c..d573aa03673175aa49fc1f07e1a2cc78912195fc 100644 >--- a/Source/WebCore/rendering/RenderLayerBacking.cpp >+++ b/Source/WebCore/rendering/RenderLayerBacking.cpp >@@ -990,8 +990,8 @@ void RenderLayerBacking::updateGeometry() > isRunningAcceleratedOpacityAnimation = timeline->isRunningAcceleratedAnimationOnRenderer(renderer(), CSSPropertyOpacity); > } > } else { >- isRunningAcceleratedTransformAnimation = renderer().animation().isRunningAcceleratedAnimationOnRenderer(renderer(), CSSPropertyTransform, AnimationBase::Running | AnimationBase::Paused); >- isRunningAcceleratedOpacityAnimation = renderer().animation().isRunningAcceleratedAnimationOnRenderer(renderer(), CSSPropertyOpacity, AnimationBase::Running | AnimationBase::Paused); >+ isRunningAcceleratedTransformAnimation = renderer().animation().isRunningAcceleratedAnimationOnRenderer(renderer(), CSSPropertyTransform); >+ isRunningAcceleratedOpacityAnimation = renderer().animation().isRunningAcceleratedAnimationOnRenderer(renderer(), CSSPropertyOpacity); > } > > // Set transform property, if it is not animating. We have to do this here because the transform >diff --git a/Source/WebCore/rendering/RenderLayerCompositor.cpp b/Source/WebCore/rendering/RenderLayerCompositor.cpp >index a8a2583190d0a33de9a906f70bf8651b298f5e67..28de97774a38387877e8fda6f3c96d1bdb15e2bd 100644 >--- a/Source/WebCore/rendering/RenderLayerCompositor.cpp >+++ b/Source/WebCore/rendering/RenderLayerCompositor.cpp >@@ -2439,15 +2439,14 @@ bool RenderLayerCompositor::requiresCompositingForAnimation(RenderLayerModelObje > if (RuntimeEnabledFeatures::sharedFeatures().webAnimationsCSSIntegrationEnabled()) > return false; > >- const AnimationBase::RunningState activeAnimationState = AnimationBase::Running | AnimationBase::Paused; > auto& animController = renderer.animation(); >- return (animController.isRunningAnimationOnRenderer(renderer, CSSPropertyOpacity, activeAnimationState) >+ return (animController.isRunningAnimationOnRenderer(renderer, CSSPropertyOpacity) > && (usesCompositing() || (m_compositingTriggers & ChromeClient::AnimatedOpacityTrigger))) >- || animController.isRunningAnimationOnRenderer(renderer, CSSPropertyFilter, activeAnimationState) >+ || animController.isRunningAnimationOnRenderer(renderer, CSSPropertyFilter) > #if ENABLE(FILTERS_LEVEL_2) >- || animController.isRunningAnimationOnRenderer(renderer, CSSPropertyWebkitBackdropFilter, activeAnimationState) >+ || animController.isRunningAnimationOnRenderer(renderer, CSSPropertyWebkitBackdropFilter) > #endif >- || animController.isRunningAnimationOnRenderer(renderer, CSSPropertyTransform, activeAnimationState); >+ || animController.isRunningAnimationOnRenderer(renderer, CSSPropertyTransform); > } > > bool RenderLayerCompositor::requiresCompositingForTransform(RenderLayerModelObject& renderer) const >@@ -2856,7 +2855,7 @@ bool RenderLayerCompositor::isRunningTransformAnimation(RenderLayerModelObject& > } > return false; > } >- return renderer.animation().isRunningAnimationOnRenderer(renderer, CSSPropertyTransform, AnimationBase::Running | AnimationBase::Paused); >+ return renderer.animation().isRunningAnimationOnRenderer(renderer, CSSPropertyTransform); > } > > // If an element has negative z-index children, those children render in front of the
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193435
: 359136