Revert "Revert "SkScalar: delete code that doesn't compile.""
authorHal Canary <halcanary@google.com>
Thu, 2 Feb 2017 15:03:22 +0000 (10:03 -0500)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Thu, 2 Feb 2017 15:43:08 +0000 (15:43 +0000)
This reverts commit 8233fc82b00763d37a7b0db7890b15c7d58939d4.

Change-Id: Ia32ccdb3b385ed28e1b41e553c7d80cf803522cc
Reviewed-on: https://skia-review.googlesource.com/7899
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>

include/core/SkScalar.h
include/private/SkFixed.h
src/gpu/gl/GrGLPath.cpp

index 922840f..c4bfce8 100644 (file)
 
 #include "../private/SkFloatingPoint.h"
 
-// TODO: move this sort of check into SkPostConfig.h
-#define SK_SCALAR_IS_DOUBLE 0
 #undef SK_SCALAR_IS_FLOAT
 #define SK_SCALAR_IS_FLOAT  1
 
-
-#if SK_SCALAR_IS_FLOAT
-
 typedef float SkScalar;
 
 #define SK_Scalar1                  1.0f
@@ -56,48 +51,6 @@ typedef float SkScalar;
 #define SkScalarLog(x)              (float)sk_float_log(x)
 #define SkScalarLog2(x)             (float)sk_float_log2(x)
 
-#else   // SK_SCALAR_IS_DOUBLE
-
-typedef double SkScalar;
-
-#define SK_Scalar1                  1.0
-#define SK_ScalarHalf               0.5
-#define SK_ScalarSqrt2              1.414213562373095
-#define SK_ScalarPI                 3.141592653589793
-#define SK_ScalarTanPIOver8         0.4142135623731
-#define SK_ScalarRoot2Over2         0.70710678118655
-#define SK_ScalarMax                1.7976931348623157+308
-#define SK_ScalarInfinity           SK_DoubleInfinity
-#define SK_ScalarNegativeInfinity   SK_DoubleNegativeInfinity
-#define SK_ScalarNaN                SK_DoubleNaN
-
-#define SkScalarFloorToScalar(x)    floor(x)
-#define SkScalarCeilToScalar(x)     ceil(x)
-#define SkScalarRoundToScalar(x)    floor((x) + 0.5)
-#define SkScalarTruncToScalar(x)    trunc(x)
-
-#define SkScalarFloorToInt(x)       (int)floor(x)
-#define SkScalarCeilToInt(x)        (int)ceil(x)
-#define SkScalarRoundToInt(x)       (int)floor((x) + 0.5)
-
-#define SkScalarAbs(x)              abs(x)
-#define SkScalarCopySign(x, y)      copysign(x, y)
-#define SkScalarMod(x, y)           fmod(x,y)
-#define SkScalarSqrt(x)             sqrt(x)
-#define SkScalarPow(b, e)           pow(b, e)
-
-#define SkScalarSin(radians)        sin(radians)
-#define SkScalarCos(radians)        cos(radians)
-#define SkScalarTan(radians)        tan(radians)
-#define SkScalarASin(val)           asin(val)
-#define SkScalarACos(val)           acos(val)
-#define SkScalarATan2(y, x)         atan2(y,x)
-#define SkScalarExp(x)              exp(x)
-#define SkScalarLog(x)              log(x)
-#define SkScalarLog2(x)             log2(x)
-
-#endif
-
 //////////////////////////////////////////////////////////////////////////////////////////////////
 
 #define SkIntToScalar(x)        static_cast<SkScalar>(x)
index 07ac9d2..2ef8fff 100644 (file)
@@ -138,18 +138,9 @@ inline SkFixed SkFixedMul_longlong(SkFixed a, SkFixed b) {
 
 ///////////////////////////////////////////////////////////////////////////////
 
-#if SK_SCALAR_IS_FLOAT
-
 #define SkFixedToScalar(x)          SkFixedToFloat(x)
 #define SkScalarToFixed(x)          SkFloatToFixed(x)
 
-#else   // SK_SCALAR_IS_DOUBLE
-
-#define SkFixedToScalar(x)          SkFixedToDouble(x)
-#define SkScalarToFixed(x)          SkDoubleToFixed(x)
-
-#endif
-
 ///////////////////////////////////////////////////////////////////////////////
 
 typedef int64_t SkFixed3232;   // 32.32
index 0546018..f7e6bd1 100644 (file)
@@ -218,7 +218,7 @@ void GrGLPath::InitPathObjectPathData(GrGLGpu* gpu,
                                       const SkPath& skPath) {
     SkASSERT(!skPath.isEmpty());
 
-#ifdef SK_SCALAR_IS_FLOAT
+#if 1  //  SK_SCALAR_IS_FLOAT
     // This branch does type punning, converting SkPoint* to GrGLfloat*.
     if ((skPath.getSegmentMasks() & SkPath::kConic_SegmentMask) == 0) {
         int verbCnt = skPath.countVerbs();