Remove Sk(Float|Double)PinToFixed functions, only used in tests.

These were triggering compile-time floating point overflow for one user,
and we don't use them.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1952303005

Review-Url: https://codereview.chromium.org/1952303005
diff --git a/include/private/SkFixed.h b/include/private/SkFixed.h
index dade239..640f0e7 100644
--- a/include/private/SkFixed.h
+++ b/include/private/SkFixed.h
@@ -33,17 +33,6 @@
 #define SkFixedToFloat(x)   ((x) * 1.52587890625e-5f)
 #define SkFloatToFixed(x)   ((SkFixed)((x) * SK_Fixed1))
 
-// Pins over/under flows to SK_FixedMax/SK_FixedMin (slower than just a cast).
-static inline SkFixed SkFloatPinToFixed(float x) {
-    x *= SK_Fixed1;
-    // Casting float to int outside the range of the target type (int32_t) is undefined behavior.
-    if (x >= SK_FixedMax) return SK_FixedMax;
-    if (x <= SK_FixedMin) return SK_FixedMin;
-    const SkFixed result = static_cast<SkFixed>(x);
-    SkASSERT(truncf(x) == static_cast<float>(result));
-    return result;
-}
-
 #ifdef SK_DEBUG
     static inline SkFixed SkFloatToFixed_Check(float x) {
         int64_t n64 = (int64_t)(x * SK_Fixed1);
@@ -58,17 +47,6 @@
 #define SkFixedToDouble(x)  ((x) * 1.52587890625e-5)
 #define SkDoubleToFixed(x)  ((SkFixed)((x) * SK_Fixed1))
 
-// Pins over/under flows to SK_FixedMax/SK_FixedMin (slower than just a cast).
-static inline SkFixed SkDoublePinToFixed(double x) {
-    x *= SK_Fixed1;
-    // Casting double to int outside the range of the target type (int32_t) is undefined behavior.
-    if (x >= SK_FixedMax) return SK_FixedMax;
-    if (x <= SK_FixedMin) return SK_FixedMin;
-    const SkFixed result = static_cast<SkFixed>(x);
-    SkASSERT(trunc(x) == static_cast<double>(result));
-    return result;
-}
-
 /** Converts an integer to a SkFixed, asserting that the result does not overflow
     a 32 bit signed integer
 */
@@ -158,13 +136,11 @@
 
 #define SkFixedToScalar(x)          SkFixedToFloat(x)
 #define SkScalarToFixed(x)          SkFloatToFixed(x)
-#define SkScalarPinToFixed(x)       SkFloatPinToFixed(x)
 
 #else   // SK_SCALAR_IS_DOUBLE
 
 #define SkFixedToScalar(x)          SkFixedToDouble(x)
 #define SkScalarToFixed(x)          SkDoubleToFixed(x)
-#define SkScalarPinToFixed(x)       SkDoublePinToFixed(x)
 
 #endif
 
diff --git a/tests/MathTest.cpp b/tests/MathTest.cpp
index 9343277..ec1f936 100644
--- a/tests/MathTest.cpp
+++ b/tests/MathTest.cpp
@@ -699,41 +699,3 @@
 DEF_TEST(divmod_s64, r) {
     test_divmod<int64_t>(r);
 }
-
-DEF_TEST(PinToFixed, reporter) {
-    // double
-    REPORTER_ASSERT(reporter, 0 == SkDoublePinToFixed(0.0));
-    REPORTER_ASSERT(reporter, 0x10000 == SkDoublePinToFixed(1.0));
-    REPORTER_ASSERT(reporter, 0x7FFFFFFE == SkDoublePinToFixed(32767.999984741));
-    REPORTER_ASSERT(reporter, 0x7FFFFFFF == SkDoublePinToFixed(32767.999984742));
-    REPORTER_ASSERT(reporter, 0x7FFFFFFF == SkDoublePinToFixed(32767.999999999));
-    REPORTER_ASSERT(reporter, 0x7FFFFFFF == SkDoublePinToFixed(32768.0));
-    REPORTER_ASSERT(reporter, 0x7FFFFFFF == SkDoublePinToFixed(5e10));
-    REPORTER_ASSERT(reporter, 0x7FFFFFFF == SkDoublePinToFixed(DBL_MAX));
-    REPORTER_ASSERT(reporter, -0x10000 == SkDoublePinToFixed(-1.0));
-    // SK_FixedMin is defined to be -SK_FixedMax.
-    REPORTER_ASSERT(reporter, -0x7FFFFFFE == SkDoublePinToFixed(-32767.999984741));
-    REPORTER_ASSERT(reporter, -0x7FFFFFFF == SkDoublePinToFixed(-32767.999984742));
-    REPORTER_ASSERT(reporter, -0x7FFFFFFF == SkDoublePinToFixed(-32767.999999999));
-    REPORTER_ASSERT(reporter, -0x7FFFFFFF == SkDoublePinToFixed(-32768.0));
-    REPORTER_ASSERT(reporter, -0x7FFFFFFF == SkDoublePinToFixed(-5e10));
-    REPORTER_ASSERT(reporter, -0x7FFFFFFF == SkDoublePinToFixed(-DBL_MAX));
-
-    // float
-    REPORTER_ASSERT(reporter, 0 == SkFloatPinToFixed(0.0f));
-    REPORTER_ASSERT(reporter, 0x10000 == SkFloatPinToFixed(1.0f));
-    // SkFixed has more precision than float near SK_FixedMax, so SkFloatPinToFixed will never
-    // produce output between 0x7FFFFF80 and 0x7FFFFFFF.
-    REPORTER_ASSERT(reporter, 0x7FFFFF80 == SkFloatPinToFixed(32767.9990f));
-    REPORTER_ASSERT(reporter, 0x7FFFFFFF == SkFloatPinToFixed(32767.9991f));
-    REPORTER_ASSERT(reporter, 0x7FFFFFFF == SkFloatPinToFixed(32768.0f));
-    REPORTER_ASSERT(reporter, 0x7FFFFFFF == SkFloatPinToFixed(5e10f));
-    REPORTER_ASSERT(reporter, 0x7FFFFFFF == SkFloatPinToFixed(FLT_MAX));
-    REPORTER_ASSERT(reporter, -0x10000 == SkFloatPinToFixed(-1.0f));
-    // SK_FixedMin is defined to be -SK_FixedMax.
-    REPORTER_ASSERT(reporter, -0x7FFFFF80 == SkFloatPinToFixed(-32767.9990f));
-    REPORTER_ASSERT(reporter, -0x7FFFFFFF == SkFloatPinToFixed(-32767.9991f));
-    REPORTER_ASSERT(reporter, -0x7FFFFFFF == SkFloatPinToFixed(-32768.0f));
-    REPORTER_ASSERT(reporter, -0x7FFFFFFF == SkFloatPinToFixed(-5e10f));
-    REPORTER_ASSERT(reporter, -0x7FFFFFFF == SkFloatPinToFixed(-FLT_MAX));
-}