Remove SkScalarSinCos

This differed from the separate versions in that it snapped to zero.
It was also strictly worse than calling the two separate versions.
Most clients don't need the snapping, so just call the two existing
functions. For clients that need the snapping, call new variants of
each that do snap.

Change-Id: Ia4e09fd9651932fe15caeab1399df7f6281bdc17
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205303
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
diff --git a/samplecode/SampleBitmapRect.cpp b/samplecode/SampleBitmapRect.cpp
index fb8771d..d5261ad 100644
--- a/samplecode/SampleBitmapRect.cpp
+++ b/samplecode/SampleBitmapRect.cpp
@@ -43,9 +43,7 @@
 
 static SkPoint unit_vec(int degrees) {
     SkScalar rad = SkDegreesToRadians(SkIntToScalar(degrees));
-    SkScalar s, c;
-    s = SkScalarSinCos(rad, &c);
-    return SkPoint::Make(c, s);
+    return SkPoint::Make(SkScalarCos(rad), SkScalarSin(rad));
 }
 
 static void bounce(SkScalar* value, SkScalar* delta, SkScalar min, SkScalar max) {
diff --git a/samplecode/SampleCircle.cpp b/samplecode/SampleCircle.cpp
index 3063324..fd9f157 100644
--- a/samplecode/SampleCircle.cpp
+++ b/samplecode/SampleCircle.cpp
@@ -79,8 +79,7 @@
         SkScalar angle = 0;
         for (int i = 1; i < n; i++) {
             angle += step;
-            SkScalar c, s = SkScalarSinCos(angle, &c);
-            path->lineTo(c, s);
+            path->lineTo(SkScalarCos(angle), SkScalarSin(angle));
         }
         path->close();
     }
diff --git a/samplecode/SampleLitAtlas.cpp b/samplecode/SampleLitAtlas.cpp
index 6a39a53..2142aff 100644
--- a/samplecode/SampleLitAtlas.cpp
+++ b/samplecode/SampleLitAtlas.cpp
@@ -42,8 +42,9 @@
     }
 
     void rotateLight() {
-        SkScalar c;
-        SkScalar s = SkScalarSinCos(SK_ScalarPI/6.0f, &c);
+        SkScalar r = SK_ScalarPI / 6.0f,
+                 s = SkScalarSin(r),
+                 c = SkScalarCos(r);
 
         SkScalar newX = c * fLightDir.fX - s * fLightDir.fY;
         SkScalar newY = s * fLightDir.fX + c * fLightDir.fY;
@@ -65,8 +66,8 @@
     }
 
     void thrust() {
-        SkScalar c;
-        SkScalar s = SkScalarSinCos(fShip.rot(), &c);
+        SkScalar s = SkScalarSin(fShip.rot()),
+                 c = SkScalarCos(fShip.rot());
 
         SkVector newVel = fShip.velocity();
         newVel.fX += s;
diff --git a/samplecode/SamplePathFill.cpp b/samplecode/SamplePathFill.cpp
index 990daaa..e2e91f4 100644
--- a/samplecode/SamplePathFill.cpp
+++ b/samplecode/SamplePathFill.cpp
@@ -80,8 +80,7 @@
     path->moveTo(c, c - r);
     for (int i = 1; i < n; i++) {
         rad += drad;
-        SkScalar cosV, sinV = SkScalarSinCos(rad, &cosV);
-        path->lineTo(c + cosV * r, c + sinV * r);
+        path->lineTo(c + SkScalarCos(rad) * r, c + SkScalarSin(rad) * r);
     }
     path->close();
     return r * 2 * 6 / 5;
diff --git a/samplecode/SampleSlides.cpp b/samplecode/SampleSlides.cpp
index bd2967b..9e65a63 100644
--- a/samplecode/SampleSlides.cpp
+++ b/samplecode/SampleSlides.cpp
@@ -301,8 +301,9 @@
     v[0].set(0, 0);
     t[0].set(0, 0);
     for (int i = 0; i < n; i++) {
-        SkScalar cos;
-        SkScalar sin = SkScalarSinCos(SK_ScalarPI * 2 * i / n, &cos);
+        SkScalar r   = SK_ScalarPI * 2 * i / n,
+                 sin = SkScalarSin(r),
+                 cos = SkScalarCos(r);
         v[i+1].set(cos, sin);
         t[i+1].set(i*tx/n, ty);
     }
@@ -329,8 +330,9 @@
     SkPoint* t = rec->fTexs;
 
     for (int i = 0; i < n; i++) {
-        SkScalar cos;
-        SkScalar sin = SkScalarSinCos(SK_ScalarPI * 2 * i / n, &cos);
+        SkScalar r   = SK_ScalarPI * 2 * i / n,
+                 sin = SkScalarSin(r),
+                 cos = SkScalarCos(r);
         v[i*2 + 0].set(cos/2, sin/2);
         v[i*2 + 1].set(cos, sin);
 
diff --git a/samplecode/SampleVertices.cpp b/samplecode/SampleVertices.cpp
index 15f2d31..2b86334 100644
--- a/samplecode/SampleVertices.cpp
+++ b/samplecode/SampleVertices.cpp
@@ -158,8 +158,9 @@
         v[0].set(0, 0);
         t[0].set(0, 0);
         for (int i = 0; i < n; i++) {
-            SkScalar cos;
-            SkScalar sin = SkScalarSinCos(SK_ScalarPI * 2 * i / n, &cos);
+            SkScalar r   = SK_ScalarPI * 2 * i / n,
+                     sin = SkScalarSin(r),
+                     cos = SkScalarCos(r);
             v[i+1].set(cos, sin);
             t[i+1].set(i*tx/n, ty);
         }
@@ -186,8 +187,9 @@
         SkPoint* t = rec->fTexs;
 
         for (int i = 0; i < n; i++) {
-            SkScalar cos;
-            SkScalar sin = SkScalarSinCos(SK_ScalarPI * 2 * i / n, &cos);
+            SkScalar r   = SK_ScalarPI * 2 * i / n,
+                     sin = SkScalarSin(r),
+                     cos = SkScalarCos(r);
             v[i*2 + 0].set(cos/2, sin/2);
             v[i*2 + 1].set(cos, sin);