Commit cb0a8400 authored by Fredrik Söderqvist's avatar Fredrik Söderqvist Committed by Chromium LUCI CQ

Fold SVGPoint::MatrixTransform

Said method is only an open-coded version AffineTransform::MapPoint().
Since it only has a single user, fold it into that.

Change-Id: I1bac1d612bfbf2910b574735af5e3cebe51466b4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2643329
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: default avatarStephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#846124}
parent 91f5b7bd
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#include "third_party/blink/renderer/core/svg/svg_point.h" #include "third_party/blink/renderer/core/svg/svg_point.h"
#include "third_party/blink/renderer/platform/heap/heap.h" #include "third_party/blink/renderer/platform/heap/heap.h"
#include "third_party/blink/renderer/platform/transforms/affine_transform.h"
#include "third_party/blink/renderer/platform/wtf/text/string_builder.h" #include "third_party/blink/renderer/platform/wtf/text/string_builder.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h" #include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
...@@ -51,13 +50,6 @@ SVGPropertyBase* SVGPoint::CloneForAnimation(const String& value) const { ...@@ -51,13 +50,6 @@ SVGPropertyBase* SVGPoint::CloneForAnimation(const String& value) const {
return nullptr; return nullptr;
} }
FloatPoint SVGPoint::MatrixTransform(const AffineTransform& transform) const {
double new_x, new_y;
transform.Map(static_cast<double>(X()), static_cast<double>(Y()), new_x,
new_y);
return FloatPoint::NarrowPrecision(new_x, new_y);
}
String SVGPoint::ValueAsString() const { String SVGPoint::ValueAsString() const {
StringBuilder builder; StringBuilder builder;
builder.AppendNumber(X()); builder.AppendNumber(X());
......
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
namespace blink { namespace blink {
class AffineTransform;
class SVGPointTearOff; class SVGPointTearOff;
class SVGPoint final : public SVGListablePropertyBase { class SVGPoint final : public SVGListablePropertyBase {
...@@ -58,8 +57,6 @@ class SVGPoint final : public SVGListablePropertyBase { ...@@ -58,8 +57,6 @@ class SVGPoint final : public SVGListablePropertyBase {
void SetX(float f) { value_.SetX(f); } void SetX(float f) { value_.SetX(f); }
void SetY(float f) { value_.SetY(f); } void SetY(float f) { value_.SetY(f); }
FloatPoint MatrixTransform(const AffineTransform&) const;
String ValueAsString() const override; String ValueAsString() const override;
void Add(const SVGPropertyBase*, const SVGElement*) override; void Add(const SVGPropertyBase*, const SVGElement*) override;
......
...@@ -62,8 +62,7 @@ void SVGPointTearOff::setY(float f, ExceptionState& exception_state) { ...@@ -62,8 +62,7 @@ void SVGPointTearOff::setY(float f, ExceptionState& exception_state) {
} }
SVGPointTearOff* SVGPointTearOff::matrixTransform(SVGMatrixTearOff* matrix) { SVGPointTearOff* SVGPointTearOff::matrixTransform(SVGMatrixTearOff* matrix) {
FloatPoint point = Target()->MatrixTransform(matrix->Value()); return CreateDetached(matrix->Value().MapPoint(Target()->Value()));
return CreateDetached(point);
} }
SVGPointTearOff* SVGPointTearOff::CreateDetached(const FloatPoint& point) { SVGPointTearOff* SVGPointTearOff::CreateDetached(const FloatPoint& point) {
......
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