Commit b140ec29 authored by Fredrik Söderquist's avatar Fredrik Söderquist Committed by Commit Bot

Drop some redundant reassignments of the 'from' animated value

SVGAnimateElement::CalculateAnimatedValue already does this reassignment
generally.

Bug: 1017723
Change-Id: I91917719a10f7d0edab9a7396283c86e8fac1a3c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1884551Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#710036}
parent ac6a9e50
......@@ -391,9 +391,7 @@ void SVGAngle::CalculateAnimatedValue(
SVGPropertyBase* to,
SVGPropertyBase* to_at_end_of_duration,
SVGElement*) {
bool is_to_animation = animation_element.GetAnimationMode() == kToAnimation;
SVGAngle* from_angle = is_to_animation ? this : ToSVGAngle(from);
SVGAngle* from_angle = ToSVGAngle(from);
SVGAngle* to_angle = ToSVGAngle(to);
SVGMarkerOrientType from_orient_type = from_angle->OrientType()->EnumValue();
SVGMarkerOrientType to_orient_type = to_angle->OrientType()->EnumValue();
......
......@@ -102,9 +102,7 @@ void SVGRect::CalculateAnimatedValue(
SVGPropertyBase* to_value,
SVGPropertyBase* to_at_end_of_duration_value,
SVGElement*) {
SVGRect* from_rect = animation_element.GetAnimationMode() == kToAnimation
? this
: ToSVGRect(from_value);
SVGRect* from_rect = ToSVGRect(from_value);
SVGRect* to_rect = ToSVGRect(to_value);
SVGRect* to_at_end_of_duration_rect = ToSVGRect(to_at_end_of_duration_value);
......
......@@ -455,16 +455,13 @@ void SVGTransformList::CalculateAnimatedValue(
SVGPropertyBase* to_value,
SVGPropertyBase* to_at_end_of_duration_value,
SVGElement* context_element) {
bool is_to_animation = animation_element.GetAnimationMode() == kToAnimation;
// Spec: To animations provide specific functionality to get a smooth change
// from the underlying value to the 'to' attribute value, which conflicts
// mathematically with the requirement for additive transform animations to be
// post-multiplied. As a consequence, in SVG 1.1 the behavior of to animations
// for 'animateTransform' is undefined.
// FIXME: This is not taken into account yet.
SVGTransformList* from_list =
is_to_animation ? this : ToSVGTransformList(from_value);
SVGTransformList* from_list = ToSVGTransformList(from_value);
SVGTransformList* to_list = ToSVGTransformList(to_value);
SVGTransformList* to_at_end_of_duration_list =
ToSVGTransformList(to_at_end_of_duration_value);
......@@ -488,6 +485,7 @@ void SVGTransformList::CalculateAnimatedValue(
// Never resize the animatedTransformList to the toList size, instead either
// clear the list or append to it.
bool is_to_animation = animation_element.GetAnimationMode() == kToAnimation;
if (!IsEmpty() && (!animation_element.IsAdditive() || is_to_animation))
Clear();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment