Respecify SkCanvas::drawArc, consolidate conversion to SkPath, add GM for oddball drawArcs

Allows the arc to wind more than 360 degrees when useCenter is true, specs that nothing draws
if the oval is empty or the sweep angle is 0.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2281653002

Review-Url: https://codereview.chromium.org/2281653002
diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp
index 64d3c0d..1fb3e11 100644
--- a/src/core/SkPath.cpp
+++ b/src/core/SkPath.cpp
@@ -3341,3 +3341,42 @@
     }
     return true;
 }
+
+void SkPathPriv::CreateDrawArcPath(SkPath* path, const SkRect& oval, SkScalar startAngle,
+                                   SkScalar sweepAngle, bool useCenter, bool isFillNoPathEffect) {
+    SkASSERT(!oval.isEmpty());
+    SkASSERT(sweepAngle);
+
+    path->reset();
+    path->setIsVolatile(true);
+    path->setFillType(SkPath::kWinding_FillType);
+    if (isFillNoPathEffect && SkScalarAbs(sweepAngle) >= 360.f) {
+        path->addOval(oval);
+        return;
+    }
+    if (useCenter) {
+        path->moveTo(oval.centerX(), oval.centerY());
+    }
+    // Arc to mods at 360 and drawArc is not supposed to.
+    bool forceMoveTo = !useCenter;
+    while (sweepAngle <= -360.f) {
+        path->arcTo(oval, startAngle, -180.f, forceMoveTo);
+        startAngle -= 180.f;
+        path->arcTo(oval, startAngle, -180.f, false);
+        startAngle -= 180.f;
+        forceMoveTo = false;
+        sweepAngle += 360.f;
+    }
+    while (sweepAngle >= 360.f) {
+        path->arcTo(oval, startAngle, 180.f, forceMoveTo);
+        startAngle += 180.f;
+        path->arcTo(oval, startAngle, 180.f, false);
+        startAngle += 180.f;
+        forceMoveTo = false;
+        sweepAngle -= 360.f;
+    }
+    path->arcTo(oval, startAngle, sweepAngle, forceMoveTo);
+    if (useCenter) {
+        path->close();
+    }
+}