Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7fd07749f8f7e25ed38999bcd1f91505f9b3d472
      
https://github.com/WebKit/WebKit/commit/7fd07749f8f7e25ed38999bcd1f91505f9b3d472
  Author: Yusuke Suzuki <ysuz...@apple.com>
  Date:   2023-09-19 (Tue, 19 Sep 2023)

  Changed paths:
    M Source/WebCore/animation/CSSPropertyAnimation.cpp
    M Source/WebCore/animation/CSSPropertyAnimation.h
    M Source/WebCore/animation/CSSTransition.cpp
    M Source/WebCore/animation/CSSTransition.h
    M Source/WebCore/animation/KeyframeEffect.cpp
    M Source/WebCore/animation/KeyframeEffect.h
    M Source/WebCore/dom/Element.cpp
    M Source/WebCore/dom/Element.h
    M Source/WebCore/rendering/style/KeyframeList.cpp
    M Source/WebCore/rendering/style/KeyframeList.h
    M Source/WebCore/style/Styleable.cpp
    M Source/WebCore/style/Styleable.h

  Log Message:
  -----------
  [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


_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to