Decouple animation value from SVGAnimateElements
SVGAnimateElement currently holds on to the computed animation value, and one of the animation elements in a sandwich is appointed the "result element". This value management is unnecessarily complex, since the lifecycle of the value is roughly create->compute->apply, and after having applied the value we no longer need it because a new one will be created on the next animation update. Clearing the value does not require actually having the value itself. Instead introduce a SMILAnimationValue structure which essentially wraps all possible animation value types. This structure is setup by CreateAnimationValue() (previously ResetAnimatedType()) and then subsequently passed to ApplyAnimation() (CalculateAnimatedValue()) and ApplyResultsToTarget(). ClearAnimatedType() is renamed to ClearAnimationValue() and CalculateAnimatedValue() is renamed to CalculateAnimationValue(). For SVGAnimateMotionElement this means we can compute the resulting transform and then apply it as the final step - i.e we don't need to compute it in-place. This should allow simplifying the application logic for motion paths in the future. Bug: 1017723 Change-Id: I205e83a8c471bbe8becb0bc4a686086d811eb482 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2523183 Commit-Queue: Fredrik Söderquist <fs@opera.com> Reviewed-by:Stephen Chenney <schenney@chromium.org> Cr-Commit-Position: refs/heads/master@{#825299}
Showing
Please register or sign in to comment