aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-06-11 21:21:26 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-06-11 21:21:26 +0000
commit7886ad3de1aa523d5c71f1fa9f355dfcb2412d1d (patch)
tree592ef48bd8dbfbdfe72fa5721fe5527fc9442d9b /include
parenta0116d541d6fee722cc159b99de6867c9ee379a5 (diff)
remove SK_CAN_USE_FLOAT (deprecated)
git-svn-id: http://skia.googlecode.com/svn/trunk@4232 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r--include/config/SkUserConfig.h7
-rw-r--r--include/core/SkFixed.h14
-rw-r--r--include/core/SkFloatBits.h4
-rw-r--r--include/core/SkFloatingPoint.h3
-rw-r--r--include/core/SkPostConfig.h11
-rw-r--r--include/core/SkPreConfig.h1
-rw-r--r--include/core/SkScalar.h10
-rw-r--r--include/core/SkString.h2
8 files changed, 10 insertions, 42 deletions
diff --git a/include/config/SkUserConfig.h b/include/config/SkUserConfig.h
index 9fdbd0a367..e7f781d733 100644
--- a/include/config/SkUserConfig.h
+++ b/include/config/SkUserConfig.h
@@ -45,13 +45,6 @@
//#define SK_SCALAR_IS_FIXED
-/* Somewhat independent of how SkScalar is implemented, Skia also wants to know
- if it can use floats at all. Naturally, if SK_SCALAR_IS_FLOAT is defined,
- SK_CAN_USE_FLOAT must be too; but if scalars are fixed, SK_CAN_USE_FLOAT
- can go either way.
- */
-//#define SK_CAN_USE_FLOAT
-
/* For some performance-critical scalar operations, skia will optionally work
around the standard float operators if it knows that the CPU does not have
native support for floats. If your environment uses software floating point,
diff --git a/include/core/SkFixed.h b/include/core/SkFixed.h
index 2040f14de8..96225e20c2 100644
--- a/include/core/SkFixed.h
+++ b/include/core/SkFixed.h
@@ -30,8 +30,7 @@ typedef int32_t SkFixed;
#define SK_FixedTanPIOver8 (0x6A0A)
#define SK_FixedRoot2Over2 (0xB505)
-#ifdef SK_CAN_USE_FLOAT
- #define SkFixedToFloat(x) ((x) * 1.5258789e-5f)
+#define SkFixedToFloat(x) ((x) * 1.5258789e-5f)
#if 1
#define SkFloatToFixed(x) ((SkFixed)((x) * SK_Fixed1))
#else
@@ -42,9 +41,8 @@ typedef int32_t SkFixed;
}
#endif
- #define SkFixedToDouble(x) ((x) * 1.5258789e-5)
- #define SkDoubleToFixed(x) ((SkFixed)((x) * SK_Fixed1))
-#endif
+#define SkFixedToDouble(x) ((x) * 1.5258789e-5)
+#define SkDoubleToFixed(x) ((SkFixed)((x) * SK_Fixed1))
/** 32 bit signed integer used to represent fractions values with 30 bits to the right of the decimal point
*/
@@ -53,10 +51,8 @@ typedef int32_t SkFract;
#define Sk_FracHalf (1 << 29)
#define SK_FractPIOver180 (0x11DF46A)
-#ifdef SK_CAN_USE_FLOAT
- #define SkFractToFloat(x) ((float)(x) * 0.00000000093132257f)
- #define SkFloatToFract(x) ((SkFract)((x) * SK_Fract1))
-#endif
+#define SkFractToFloat(x) ((float)(x) * 0.00000000093132257f)
+#define SkFloatToFract(x) ((SkFract)((x) * SK_Fract1))
/** Converts an integer to a SkFixed, asserting that the result does not overflow
a 32 bit signed integer
diff --git a/include/core/SkFloatBits.h b/include/core/SkFloatBits.h
index e6fc5b5616..3c725fe3c6 100644
--- a/include/core/SkFloatBits.h
+++ b/include/core/SkFloatBits.h
@@ -57,8 +57,6 @@ SK_API int32_t SkFloatBits_toIntRound(int32_t floatBits);
SK_API int32_t SkFloatBits_toIntCeil(int32_t floatBits);
-#ifdef SK_CAN_USE_FLOAT
-
union SkFloatIntUnion {
float fFloat;
int32_t fSignBitInt;
@@ -127,8 +125,6 @@ static inline int32_t SkFloatToIntCeil(float x) {
return SkFloatBits_toIntCeil(SkFloat2Bits(x));
}
-#endif
-
// Scalar wrappers for float-bit routines
#ifdef SK_SCALAR_IS_FLOAT
diff --git a/include/core/SkFloatingPoint.h b/include/core/SkFloatingPoint.h
index ee91cd9799..9f354fbfae 100644
--- a/include/core/SkFloatingPoint.h
+++ b/include/core/SkFloatingPoint.h
@@ -12,8 +12,6 @@
#include "SkTypes.h"
-#ifdef SK_CAN_USE_FLOAT
-
#include <math.h>
#include <float.h>
#include "SkFloatBits.h"
@@ -89,4 +87,3 @@ static inline float sk_float_copysign(float x, float y) {
#endif
#endif
-#endif
diff --git a/include/core/SkPostConfig.h b/include/core/SkPostConfig.h
index 8316f7a0a4..aea7982bfa 100644
--- a/include/core/SkPostConfig.h
+++ b/include/core/SkPostConfig.h
@@ -27,16 +27,7 @@
#if defined(SK_SCALAR_IS_FIXED) && defined(SK_SCALAR_IS_FLOAT)
#error "cannot define both SK_SCALAR_IS_FIXED and SK_SCALAR_IS_FLOAT"
#elif !defined(SK_SCALAR_IS_FIXED) && !defined(SK_SCALAR_IS_FLOAT)
- #ifdef SK_CAN_USE_FLOAT
- #define SK_SCALAR_IS_FLOAT
- #else
- #define SK_SCALAR_IS_FIXED
- #endif
-#endif
-
-#if defined(SK_SCALAR_IS_FLOAT) && !defined(SK_CAN_USE_FLOAT)
- #define SK_CAN_USE_FLOAT
- // we do nothing in the else case: fixed-scalars can have floats or not
+ #define SK_SCALAR_IS_FLOAT
#endif
#if defined(SK_CPU_LENDIAN) && defined(SK_CPU_BENDIAN)
diff --git a/include/core/SkPreConfig.h b/include/core/SkPreConfig.h
index 46c69298c5..ff19806cc8 100644
--- a/include/core/SkPreConfig.h
+++ b/include/core/SkPreConfig.h
@@ -88,7 +88,6 @@
#if !defined(SK_SCALAR_IS_FLOAT) && !defined(SK_SCALAR_IS_FIXED)
#define SK_SCALAR_IS_FLOAT
- #define SK_CAN_USE_FLOAT
#endif
//////////////////////////////////////////////////////////////////////
diff --git a/include/core/SkScalar.h b/include/core/SkScalar.h
index 0744079f11..c87342c152 100644
--- a/include/core/SkScalar.h
+++ b/include/core/SkScalar.h
@@ -222,13 +222,11 @@
#define SkIntToScalar(n) SkIntToFixed(n)
#define SkFixedToScalar(x) (x)
#define SkScalarToFixed(x) (x)
- #ifdef SK_CAN_USE_FLOAT
- #define SkScalarToFloat(n) SkFixedToFloat(n)
- #define SkFloatToScalar(n) SkFloatToFixed(n)
+ #define SkScalarToFloat(n) SkFixedToFloat(n)
+ #define SkFloatToScalar(n) SkFloatToFixed(n)
- #define SkScalarToDouble(n) SkFixedToDouble(n)
- #define SkDoubleToScalar(n) SkDoubleToFixed(n)
- #endif
+ #define SkScalarToDouble(n) SkFixedToDouble(n)
+ #define SkDoubleToScalar(n) SkDoubleToFixed(n)
#define SkScalarFraction(x) SkFixedFraction(x)
#define SkScalarFloorToScalar(x) SkFixedFloorToFixed(x)
diff --git a/include/core/SkString.h b/include/core/SkString.h
index 3dd89a5c9a..baabf0f543 100644
--- a/include/core/SkString.h
+++ b/include/core/SkString.h
@@ -55,9 +55,7 @@ char* SkStrAppendS64(char buffer[], int64_t, int minDigits);
#define SkStrAppendScalar SkStrAppendFixed
#endif
-#ifdef SK_CAN_USE_FLOAT
char* SkStrAppendFloat(char buffer[], float);
-#endif
char* SkStrAppendFixed(char buffer[], SkFixed);
/** \class SkString