| Index: Source/core/platform/graphics/Path.cpp
|
| diff --git a/Source/core/platform/graphics/Path.cpp b/Source/core/platform/graphics/Path.cpp
|
| index 57479a3b747535e0324b7ff1123f0a12c21f830a..03c87c28e4b49e48e34321ec05c8f856c3bf397c 100644
|
| --- a/Source/core/platform/graphics/Path.cpp
|
| +++ b/Source/core/platform/graphics/Path.cpp
|
| @@ -359,6 +359,28 @@ void Path::addRect(const FloatRect& rect)
|
| ensureSkPath()->addRect(rect);
|
| }
|
|
|
| +void Path::addEllipse(const FloatPoint& p, float radiusX, float radiusY, float rotation, float startAngle, float endAngle, bool anticlockwise)
|
| +{
|
| + if (!radiusX || !radiusY || startAngle == endAngle) {
|
| + // The ellipse is empty but we still need to draw the connecting line to start point.
|
| + FloatPoint p1(p.x() + radiusX * cosf(startAngle + rotation), p.y() + radiusY * sinf(startAngle + rotation));
|
| + if (!hasCurrentPoint())
|
| + moveTo(p1);
|
| + else if (p1 != currentPoint())
|
| + addLineTo(p1);
|
| + return;
|
| + }
|
| +
|
| + // Add an arc after the relevant transform.
|
| + AffineTransform ellipseTransform = AffineTransform().rotate(rad2deg(rotation)).scale(radiusX, radiusY);
|
| + ASSERT(ellipseTransform.isInvertible());
|
| + AffineTransform inverseEllipseTransform = ellipseTransform.inverse();
|
| + transform(inverseEllipseTransform);
|
| + float unitCircleRadius = 1.;
|
| + addArc(inverseEllipseTransform.mapPoint(p), unitCircleRadius, startAngle, endAngle, anticlockwise);
|
| + transform(ellipseTransform);
|
| +}
|
| +
|
| void Path::addEllipse(const FloatRect& rect)
|
| {
|
| ensureSkPath()->addOval(rect);
|
|
|