Summary: | Step animations invalidate style on every rendering update whether or not they need to | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Simon Fraser (smfr) <simon.fraser> | ||||||
Component: | Animations | Assignee: | Nobody <webkit-unassigned> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | dino, graouts, graouts, koivisto, simon.fraser, webkit-bug-importer | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | Safari Technology Preview | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
See Also: |
https://bugs.webkit.org/show_bug.cgi?id=214712 https://bugs.webkit.org/show_bug.cgi?id=215241 |
||||||||
Attachments: |
|
Description
Simon Fraser (smfr)
2020-08-06 11:17:08 PDT
This is tested by the (failing) animations/steps-transform-rendering-updates.html Created attachment 407395 [details]
wip
This bug is specific to step timing functions. Rendering updates will tick animations only if DocumentTimeline::m_animationResolutionScheduled bit is set which correctly doesn't happen during accelerated animations. Step timing functions with transforms try and fail to start accelerated which causes them to repeatedly schedule unnecessary rendering updates. Created attachment 407397 [details]
patch
Committed r266232: <https://trac.webkit.org/changeset/266232> All reviewed patches have been landed. Closing bug and clearing flags on attachment 407397 [details]. Comment on attachment 407397 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=407397&action=review > Source/WebCore/animation/KeyframeEffect.cpp:1498 > + if (m_acceleratedPropertiesState == AcceleratedProperties::None || m_someKeyframesUseStepsTimingFunction || is<StepsTimingFunction>(timingFunction())) It's GraphicsLayerCA that decides that it can't accelerate animations with steps() timing functions, so adding this code here is spreading that logic around into two places. Not great. GraphicsLayerCA is a totally wrong place for that sort of logic. Duplication can be removed after the legacy animation code is removed. But the idea is that some native platforms might be able to support steps() natively. You're hard-coding Core Animation limitations into cross-platform code. We should have a better way to communicate that sort of information to the animation engine (when we actually have a reason to abstract it). We can probably have this logic sit somewhere in between GraphicsLayerCA and KeyframeEffect that would allow for some platform-specific logic. Specific accelerated properties are already hardcoded in animation code. This seems like a much bigger deal if we want to be (unnecessarily?) generic. |