-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WebAnimation] Optimize updateCSSTransitions
https://bugs.webkit.org/show_bug.cgi?id=261715 rdar://115703255 Reviewed by Mark Lam. WebAnimation's updateCSSTransitions is inefficient, 1. We are repeatedly copying AnimationProperty while it is held. This is appearing much in the profiler. Let's not copy them. We use `const AnimationProperty&`. This is OK since 1.1. updateCSSTransitionsForStyleableAndProperty's owner is holding this ownership. Reference is always valid. 1.2. Other change immediately copies or uses switchOn to dispatch. So this is fine. 2. Avoid repeated call of `styleable.hasRunningTransitionForProperty` etc. This is really costly function since it involves HashMap lookup. We reorganize updateCSSTransitionsForStyleableAndProperty not to do wasteful operations multiple times. * Source/WebCore/animation/CSSPropertyAnimation.cpp: (WebCore::CSSPropertyBlendingContext::CSSPropertyBlendingContext): (WebCore::CSSPropertyAnimation::blendProperty): (WebCore::CSSPropertyAnimation::isPropertyAnimatable): (WebCore::CSSPropertyAnimation::isPropertyAdditiveOrCumulative): (WebCore::CSSPropertyAnimation::propertyRequiresBlendingForAccumulativeIteration): (WebCore::CSSPropertyAnimation::animationOfPropertyIsAccelerated): (WebCore::CSSPropertyAnimation::propertiesEqual): (WebCore::CSSPropertyAnimation::canPropertyBeInterpolated): * Source/WebCore/animation/CSSPropertyAnimation.h: * Source/WebCore/dom/Element.cpp: (WebCore::Element::hasCompletedTransitionForProperty const): (WebCore::Element::hasRunningTransitionForProperty const): * Source/WebCore/dom/Element.h: * Source/WebCore/style/Styleable.cpp: (WebCore::keyframeEffectForElementAndProperty): (WebCore::propertyInStyleMatchesValueForTransitionInMap): (WebCore::transitionMatchesProperty): (WebCore::updateCSSTransitionsForStyleableAndProperty): (WebCore::Styleable::updateCSSTransitions const): * Source/WebCore/style/Styleable.h: (WebCore::Styleable::hasCompletedTransitionForProperty const): (WebCore::Styleable::hasRunningTransitionForProperty const): Canonical link: https://commits.webkit.org/268113@main
- Loading branch information
1 parent
ba13698
commit 7fd0774
Showing
12 changed files
with
61 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.