Skip to content

Conversation

graouts
Copy link
Contributor

@graouts graouts commented Nov 8, 2023

8f40ab2

[web-animations] move shared timing data between AnimationEffect and AcceleratedEffect to a dedicated struct
https://bugs.webkit.org/show_bug.cgi?id=264394

Reviewed by Dean Jackson.

Refactor `AcceleratedEffect` and `AnimationEffect` to use a shared struct to store timing-related properties: `AnimationEffectTiming`.
This will allow `AcceleratedEffect` to resolve timing and compute the transformed progress of an animation with the same code used
for `KeyframeEffect` in the WebContent process.

* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/animation/AnimationEffect.cpp:
(WebCore::AnimationEffect::AnimationEffect):
(WebCore::AnimationEffect::getBindingsTiming const):
(WebCore::AnimationEffect::localTime const):
(WebCore::AnimationEffect::playbackRate const):
(WebCore::AnimationEffect::getBasicTiming const):
(WebCore::AnimationEffect::getComputedTiming const):
(WebCore::AnimationEffect::updateTiming):
(WebCore::AnimationEffect::updateStaticTimingProperties):
(WebCore::AnimationEffect::setIterationStart):
(WebCore::AnimationEffect::setIterations):
(WebCore::AnimationEffect::setDelay):
(WebCore::AnimationEffect::setEndDelay):
(WebCore::AnimationEffect::setFill):
(WebCore::AnimationEffect::setIterationDuration):
(WebCore::AnimationEffect::setDirection):
(WebCore::AnimationEffect::setTimingFunction):
(WebCore::AnimationEffect::progressUntilNextStep const):
(WebCore::AnimationEffect::getTiming const): Deleted.
* Source/WebCore/animation/AnimationEffect.h:
(WebCore::AnimationEffect::timing const):
(WebCore::AnimationEffect::delay const):
(WebCore::AnimationEffect::endDelay const):
(WebCore::AnimationEffect::fill const):
(WebCore::AnimationEffect::iterationStart const):
(WebCore::AnimationEffect::iterations const):
(WebCore::AnimationEffect::iterationDuration const):
(WebCore::AnimationEffect::direction const):
(WebCore::AnimationEffect::timingFunction const):
(WebCore::AnimationEffect::activeDuration const):
(WebCore::AnimationEffect::endTime const):
* Source/WebCore/animation/AnimationEffectTiming.cpp: Added.
(WebCore::AnimationEffectTiming::updateComputedProperties):
(WebCore::AnimationEffectTiming::getBasicTiming const):
(WebCore::AnimationEffectTiming::resolve const):
* Source/WebCore/animation/AnimationEffectTiming.h: Added.
* Source/WebCore/platform/animation/AcceleratedEffect.cpp:
(WebCore::AcceleratedEffect::create):
(WebCore::AcceleratedEffect::clone const):
(WebCore::AcceleratedEffect::AcceleratedEffect):
* Source/WebCore/platform/animation/AcceleratedEffect.h:
(WebCore::AcceleratedEffect::timing const):
(WebCore::AcceleratedEffect::animationType const):
(WebCore::AcceleratedEffect::compositeOperation const):
(WebCore::AcceleratedEffect::paused const):
(WebCore::AcceleratedEffect::playbackRate const):
(WebCore::AcceleratedEffect::fill const): Deleted.
(WebCore::AcceleratedEffect::direction const): Deleted.
(WebCore::AcceleratedEffect::timingFunction const): Deleted.
(WebCore::AcceleratedEffect::iterationStart const): Deleted.
(WebCore::AcceleratedEffect::iterations const): Deleted.
(WebCore::AcceleratedEffect::delay const): Deleted.
(WebCore::AcceleratedEffect::endDelay const): Deleted.
(WebCore::AcceleratedEffect::iterationDuration const): Deleted.
(WebCore::AcceleratedEffect::activeDuration const): Deleted.
(WebCore::AcceleratedEffect::endTime const): Deleted.
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:

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

77ad6cf

Misc iOS, tvOS & watchOS macOS Linux Windows
❌ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 wincairo
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🛠 gtk
✅ 🧪 ios-wk2-wpt ✅ 🧪 mac-wk1 ✅ 🧪 gtk-wk2
✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🧪 api-gtk
✅ 🛠 tv ✅ 🧪 mac-AS-debug-wk2
✅ 🛠 tv-sim
✅ 🛠 watch ⏳ 🛠 jsc-mips
✅ 🛠 🧪 unsafe-merge ✅ 🛠 watch-sim ⏳ 🧪 jsc-mips-tests

@graouts graouts self-assigned this Nov 8, 2023
@graouts graouts added the Animations Bugs related to CSS + SVG animations and transitions label Nov 8, 2023
@graouts graouts requested a review from grorg November 8, 2023 10:55
@graouts graouts added the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Nov 8, 2023
…AcceleratedEffect to a dedicated struct

https://bugs.webkit.org/show_bug.cgi?id=264394

Reviewed by Dean Jackson.

Refactor `AcceleratedEffect` and `AnimationEffect` to use a shared struct to store timing-related properties: `AnimationEffectTiming`.
This will allow `AcceleratedEffect` to resolve timing and compute the transformed progress of an animation with the same code used
for `KeyframeEffect` in the WebContent process.

* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/animation/AnimationEffect.cpp:
(WebCore::AnimationEffect::AnimationEffect):
(WebCore::AnimationEffect::getBindingsTiming const):
(WebCore::AnimationEffect::localTime const):
(WebCore::AnimationEffect::playbackRate const):
(WebCore::AnimationEffect::getBasicTiming const):
(WebCore::AnimationEffect::getComputedTiming const):
(WebCore::AnimationEffect::updateTiming):
(WebCore::AnimationEffect::updateStaticTimingProperties):
(WebCore::AnimationEffect::setIterationStart):
(WebCore::AnimationEffect::setIterations):
(WebCore::AnimationEffect::setDelay):
(WebCore::AnimationEffect::setEndDelay):
(WebCore::AnimationEffect::setFill):
(WebCore::AnimationEffect::setIterationDuration):
(WebCore::AnimationEffect::setDirection):
(WebCore::AnimationEffect::setTimingFunction):
(WebCore::AnimationEffect::progressUntilNextStep const):
(WebCore::AnimationEffect::getTiming const): Deleted.
* Source/WebCore/animation/AnimationEffect.h:
(WebCore::AnimationEffect::timing const):
(WebCore::AnimationEffect::delay const):
(WebCore::AnimationEffect::endDelay const):
(WebCore::AnimationEffect::fill const):
(WebCore::AnimationEffect::iterationStart const):
(WebCore::AnimationEffect::iterations const):
(WebCore::AnimationEffect::iterationDuration const):
(WebCore::AnimationEffect::direction const):
(WebCore::AnimationEffect::timingFunction const):
(WebCore::AnimationEffect::activeDuration const):
(WebCore::AnimationEffect::endTime const):
* Source/WebCore/animation/AnimationEffectTiming.cpp: Added.
(WebCore::AnimationEffectTiming::updateComputedProperties):
(WebCore::AnimationEffectTiming::getBasicTiming const):
(WebCore::AnimationEffectTiming::resolve const):
* Source/WebCore/animation/AnimationEffectTiming.h: Added.
* Source/WebCore/platform/animation/AcceleratedEffect.cpp:
(WebCore::AcceleratedEffect::create):
(WebCore::AcceleratedEffect::clone const):
(WebCore::AcceleratedEffect::AcceleratedEffect):
* Source/WebCore/platform/animation/AcceleratedEffect.h:
(WebCore::AcceleratedEffect::timing const):
(WebCore::AcceleratedEffect::animationType const):
(WebCore::AcceleratedEffect::compositeOperation const):
(WebCore::AcceleratedEffect::paused const):
(WebCore::AcceleratedEffect::playbackRate const):
(WebCore::AcceleratedEffect::fill const): Deleted.
(WebCore::AcceleratedEffect::direction const): Deleted.
(WebCore::AcceleratedEffect::timingFunction const): Deleted.
(WebCore::AcceleratedEffect::iterationStart const): Deleted.
(WebCore::AcceleratedEffect::iterations const): Deleted.
(WebCore::AcceleratedEffect::delay const): Deleted.
(WebCore::AcceleratedEffect::endDelay const): Deleted.
(WebCore::AcceleratedEffect::iterationDuration const): Deleted.
(WebCore::AcceleratedEffect::activeDuration const): Deleted.
(WebCore::AcceleratedEffect::endTime const): Deleted.
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:

Canonical link: https://commits.webkit.org/270402@main
@webkit-commit-queue webkit-commit-queue force-pushed the animation-effect-timing-backing-struct branch from 77ad6cf to 8f40ab2 Compare November 8, 2023 20:14
@webkit-commit-queue
Copy link
Collaborator

Committed 270402@main (8f40ab2): https://commits.webkit.org/270402@main

Reviewed commits have been landed. Closing PR #20154 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 8f40ab2 into WebKit:main Nov 8, 2023
@webkit-commit-queue webkit-commit-queue removed the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Nov 8, 2023
@graouts graouts deleted the animation-effect-timing-backing-struct branch November 8, 2023 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Animations Bugs related to CSS + SVG animations and transitions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants