Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(593)

Unified Diff: third_party/WebKit/Source/core/svg/SVGAnimateMotionElement.cpp

Issue 2578913002: Unify animate motion transform update invalidations (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGAnimateMotionElement.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/svg/SVGAnimateMotionElement.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGAnimateMotionElement.cpp b/third_party/WebKit/Source/core/svg/SVGAnimateMotionElement.cpp
index b605ff60cec34e53cd03a5cf8e28f130a6f7bbd9..54bf66d0c4cbcf6bffb4fd6d81ce5f41d97f4910 100644
--- a/third_party/WebKit/Source/core/svg/SVGAnimateMotionElement.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGAnimateMotionElement.cpp
@@ -164,10 +164,8 @@ void SVGAnimateMotionElement::clearAnimatedType() {
transform->makeIdentity();
- if (LayoutObject* targetLayoutObject = targetElement->layoutObject()) {
- targetLayoutObject->setNeedsTransformUpdate();
- markForLayoutAndParentResourceInvalidation(targetLayoutObject);
- }
+ if (LayoutObject* targetLayoutObject = targetElement->layoutObject())
+ invalidateForAnimateMotionTransformChange(*targetLayoutObject);
}
bool SVGAnimateMotionElement::calculateToAtEndOfDurationValue(
@@ -208,7 +206,7 @@ void SVGAnimateMotionElement::calculateAnimatedValue(float percentage,
return;
if (LayoutObject* targetLayoutObject = targetElement->layoutObject())
- targetLayoutObject->setNeedsTransformUpdate();
+ invalidateForAnimateMotionTransformChange(*targetLayoutObject);
if (!isAdditive())
transform->makeIdentity();
@@ -261,9 +259,6 @@ void SVGAnimateMotionElement::applyResultsToTarget() {
if (!targetElement)
return;
- if (LayoutObject* layoutObject = targetElement->layoutObject())
- markForLayoutAndParentResourceInvalidation(layoutObject);
-
AffineTransform* t = targetElement->animateMotionTransform();
if (!t)
return;
@@ -277,10 +272,8 @@ void SVGAnimateMotionElement::applyResultsToTarget() {
if (!transform)
continue;
transform->setMatrix(t->a(), t->b(), t->c(), t->d(), t->e(), t->f());
- if (LayoutObject* layoutObject = shadowTreeElement->layoutObject()) {
- layoutObject->setNeedsTransformUpdate();
- markForLayoutAndParentResourceInvalidation(layoutObject);
- }
+ if (LayoutObject* layoutObject = shadowTreeElement->layoutObject())
+ invalidateForAnimateMotionTransformChange(*layoutObject);
}
}
@@ -303,4 +296,10 @@ void SVGAnimateMotionElement::updateAnimationMode() {
SVGAnimationElement::updateAnimationMode();
}
+void SVGAnimateMotionElement::invalidateForAnimateMotionTransformChange(
+ LayoutObject& object) {
+ object.setNeedsTransformUpdate();
+ markForLayoutAndParentResourceInvalidation(&object);
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGAnimateMotionElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698