Index: third_party/WebKit/Source/core/layout/svg/LayoutSVGViewportContainer.cpp |
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGViewportContainer.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGViewportContainer.cpp |
index b4ab298affd99d79346b5c3546521f41a6603a7b..e4662411b9258937c5cf25bf98e7bf117c5d2b0a 100644 |
--- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGViewportContainer.cpp |
+++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGViewportContainer.cpp |
@@ -70,21 +70,15 @@ void LayoutSVGViewportContainer::setNeedsTransformUpdate() |
m_needsTransformUpdate = true; |
} |
-static std::pair<double, double> scaleReference(const AffineTransform& transform) |
-{ |
- return std::make_pair(transform.xScaleSquared(), transform.yScaleSquared()); |
-} |
- |
-LayoutSVGContainer::TransformChange LayoutSVGViewportContainer::calculateLocalTransform() |
+SVGTransformChange LayoutSVGViewportContainer::calculateLocalTransform() |
{ |
if (!m_needsTransformUpdate) |
- return TransformChange::None; |
+ return SVGTransformChange::None; |
- std::pair<double, double> oldScale = scaleReference(m_localToParentTransform); |
+ SVGTransformChangeDetector changeDetector(m_localToParentTransform); |
m_localToParentTransform = AffineTransform::translation(m_viewport.x(), m_viewport.y()) * viewportTransform(); |
m_needsTransformUpdate = false; |
- return scaleReference(m_localToParentTransform) != oldScale |
- ? TransformChange::Full : TransformChange::ScaleInvariant; |
+ return changeDetector.computeChange(m_localToParentTransform); |
} |
AffineTransform LayoutSVGViewportContainer::viewportTransform() const |