Correct a small mistake in SkPath::build_arc_conics

In this function, when count is 0, it maps the dst point to start, where
it should really be stop. A test case is also added.

In the test case, it should be drawing three lines, without the change in
SkPath class, it will draw 2 lines only with the top horizontal line
missing because it maps the dst point to the start point, and hence
the horizontal line is not drawn.

BUG=640031
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2409983004

Review-Url: https://chromiumcodereview.appspot.com/2409983004
diff --git a/gm/addarc.cpp b/gm/addarc.cpp
index ff67af2..9aba9c6 100644
--- a/gm/addarc.cpp
+++ b/gm/addarc.cpp
@@ -304,16 +304,32 @@
 
         canvas->translate(50, 50);
 
-        SkPath path;
-        path.moveTo(50, 20);
-        path.lineTo(50, 0);
-        // A combination of tiny sweepAngle + large radius, we should draw a line.
-        html_canvas_arc(&path, 50, 100000, 100000, 270, 270.0f - 0.00572957795f,
-                        false, true);
-        path.lineTo(60, 20);
-        html_canvas_arc(&path, 50, 100000, 99980, 270.0f - 0.00572957795f, 270,
-                        false, false);
-        canvas->drawPath(path, paint);
+        SkScalar outerRadius = 100000.0f;
+        SkScalar innerRadius = outerRadius - 20.0f;
+        SkScalar centerX = 50;
+        SkScalar centerY = outerRadius;
+        SkScalar startAngles[] = { 1.5f * SK_ScalarPI , 1.501f * SK_ScalarPI  };
+        SkScalar sweepAngle = 10.0f / outerRadius;
+
+        for (size_t i = 0; i < SK_ARRAY_COUNT(startAngles); ++i) {
+            SkPath path;
+            SkScalar endAngle = startAngles[i] + sweepAngle;
+            path.moveTo(centerX + innerRadius * sk_float_cos(startAngles[i]),
+                        centerY + innerRadius * sk_float_sin(startAngles[i]));
+            path.lineTo(centerX + outerRadius * sk_float_cos(startAngles[i]),
+                        centerY + outerRadius * sk_float_sin(startAngles[i]));
+            // A combination of tiny sweepAngle + large radius, we should draw a line.
+            html_canvas_arc(&path, centerX, outerRadius, outerRadius,
+                            startAngles[i] * 180 / SK_ScalarPI, endAngle * 180 / SK_ScalarPI,
+                            true, true);
+            path.lineTo(centerX + innerRadius * sk_float_cos(endAngle),
+                        centerY + innerRadius * sk_float_sin(endAngle));
+            html_canvas_arc(&path, centerX, outerRadius, innerRadius,
+                            endAngle * 180 / SK_ScalarPI, startAngles[i] * 180 / SK_ScalarPI,
+                            true, false);
+            canvas->drawPath(path, paint);
+            canvas->translate(20, 0);
+        }
     }
 
 private: