[webkit-changes] [WebKit/WebKit] 893f4b: [web-animations] `KeyframeValue` and `AcceleratedE...

Antoine Quint noreply at github.com
Mon Nov 13 11:03:14 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 893f4b23e527ed71d0d970a9adeb78a111870d00
      https://github.com/WebKit/WebKit/commit/893f4b23e527ed71d0d970a9adeb78a111870d00
  Author: Antoine Quint <graouts at webkit.org>
  Date:   2023-11-13 (Mon, 13 Nov 2023)

  Changed paths:
    M Source/WebCore/Headers.cmake
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/animation/KeyframeEffect.cpp
    A Source/WebCore/animation/KeyframeInterpolation.h
    M Source/WebCore/animation/WebAnimationTypes.h
    M Source/WebCore/inspector/agents/InspectorAnimationAgent.cpp
    M Source/WebCore/platform/animation/AcceleratedEffect.cpp
    M Source/WebCore/platform/animation/AcceleratedEffect.h
    M Source/WebCore/rendering/RenderLayerBacking.cpp
    M Source/WebCore/rendering/style/KeyframeList.cpp
    M Source/WebCore/rendering/style/KeyframeList.h
    M Source/WebCore/style/StyleResolver.cpp
    M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in

  Log Message:
  -----------
  [web-animations] `KeyframeValue` and `AcceleratedEffectKeyframe` should derive from a shared base class
https://bugs.webkit.org/show_bug.cgi?id=264747

Reviewed by Dean Jackson.

As part of the work on threaded animation resolution (see bug 250970), we will need to have the keyframe
interpolation logic currently contained in `KeyframeEffect` also apply to `AcceleratedEffect`. This will
require a fair amount of refactoring to move all the relevant code in a shared base class for both
`KeyframeEffect` and `AcceleratedEffect`.

The first step towards this goal is to have the keyframe class backing those animation effect classes,
`KeyframeValue` and `AcceleratedEffectKeyframe`, use a shared base class. In this patch we introduce a
new `KeyframeInterpolation` class, which is currently empty except for the nested `KeyframeInterpolation::Keyframe`.
It exposes a simple set of methods that `KeyframeValue` and `AcceleratedEffectKeyframe` now override:

    double offset() const;
    std::optional<CompositeOperation> compositeOperation() const;
    bool animatesProperty(Property) const;

We also add a new abstract `AnimatedProperty` which can be either `AnimatableCSSProperty` or `AcceleratedEffectProperty`.

* Source/WebCore/Headers.cmake:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::getKeyframes):
(WebCore::KeyframeEffect::setAnimatedPropertiesInStyle):
(WebCore::KeyframeEffect::computeExtentOfTransformAnimation const):
(WebCore::KeyframeEffect::progressUntilNextStep const):
(WebCore::KeyframeEffect::computeHasImplicitKeyframeForAcceleratedProperty):
* Source/WebCore/animation/KeyframeInterpolation.h: Added.
(WebCore::KeyframeInterpolation::Keyframe::isAcceleratedEffectKeyframe const):
(WebCore::KeyframeInterpolation::Keyframe::isKeyframeValue const):
* Source/WebCore/animation/WebAnimationTypes.h:
* Source/WebCore/inspector/agents/InspectorAnimationAgent.cpp:
(WebCore::buildObjectForKeyframes):
* Source/WebCore/platform/animation/AcceleratedEffect.cpp:
(WebCore::AcceleratedEffect::Keyframe::Keyframe):
(WebCore::AcceleratedEffect::Keyframe::animatesProperty const):
(WebCore::AcceleratedEffect::Keyframe::clone const):
(WebCore::AcceleratedEffect::create):
(WebCore::AcceleratedEffect::AcceleratedEffect):
(WebCore::AcceleratedEffectKeyframe::clone const): Deleted.
* Source/WebCore/platform/animation/AcceleratedEffect.h:
(WebCore::AcceleratedEffect::keyframes const):
* Source/WebCore/rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::startAnimation):
* Source/WebCore/rendering/style/KeyframeList.cpp:
(WebCore::KeyframeList::operator== const):
(WebCore::KeyframeList::insert):
(WebCore::KeyframeList::hasImplicitKeyframes const):
(WebCore::KeyframeList::copyKeyframes):
(WebCore::KeyframeList::fillImplicitKeyframes):
(WebCore::KeyframeValue::animatesProperty const):
(WebCore::KeyframeValue::containsProperty const): Deleted.
* Source/WebCore/rendering/style/KeyframeList.h:
(WebCore::KeyframeValue::KeyframeValue): Deleted.
(WebCore::KeyframeValue::properties const): Deleted.
(WebCore::KeyframeValue::key const): Deleted.
(WebCore::KeyframeValue::setKey): Deleted.
(WebCore::KeyframeValue::style const): Deleted.
(WebCore::KeyframeValue::setStyle): Deleted.
(WebCore::KeyframeValue::timingFunction const): Deleted.
(WebCore::KeyframeValue::setTimingFunction): Deleted.
(WebCore::KeyframeValue::compositeOperation const): Deleted.
(WebCore::KeyframeValue::setCompositeOperation): Deleted.
(WebCore::KeyframeValue::containsDirectionAwareProperty const): Deleted.
(WebCore::KeyframeValue::setContainsDirectionAwareProperty): Deleted.
* Source/WebCore/style/StyleResolver.cpp:
(WebCore::Style::Resolver::keyframeStylesForAnimation):
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:

Canonical link: https://commits.webkit.org/270648@main




More information about the webkit-changes mailing list