remove unused SkIntToFloatCast_NoOverflowCheck
authorcaryclark <caryclark@google.com>
Tue, 19 Aug 2014 14:39:40 +0000 (07:39 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 19 Aug 2014 14:39:41 +0000 (07:39 -0700)
R=reed@google.com, reed
BUG=skia:2849

Author: caryclark@google.com

Review URL: https://codereview.chromium.org/483273003

include/core/SkFloatBits.h
src/core/SkFloatBits.cpp
tests/MathTest.cpp

index 552e712..3ddb9ef 100644 (file)
@@ -95,7 +95,6 @@ static inline float Sk2sComplimentAsFloat(int32_t x) {
 /** Return x cast to a float (i.e. (float)x)
 */
 float SkIntToFloatCast(int x);
-float SkIntToFloatCast_NoOverflowCheck(int x);
 
 /** Return the float cast to an int.
     If the value is out of range, or NaN, return +/- SK_MaxS32
index 6b35a75..8d89dfe 100644 (file)
@@ -203,23 +203,3 @@ float SkIntToFloatCast(int32_t value) {
     data.fSignBitInt = (sign << 31) | (shift << 23) | (value & ~MATISSA_MAGIC_BIG);
     return data.fFloat;
 }
-
-float SkIntToFloatCast_NoOverflowCheck(int32_t value) {
-    if (0 == value) {
-        return 0;
-    }
-
-    int shift = EXP_BIAS;
-
-    // record the sign and make value positive
-    int sign = SkExtractSign(value);
-    value = SkApplySign(value, sign);
-
-    int zeros = SkCLZ(value << 8);
-    value <<= zeros;
-    shift -= zeros;
-
-    SkFloatIntUnion data;
-    data.fSignBitInt = (sign << 31) | (shift << 23) | (value & ~MATISSA_MAGIC_BIG);
-    return data.fFloat;
-}
index 4205ce6..2053936 100644 (file)
@@ -264,9 +264,7 @@ static void test_float_conversions(skiatest::Reporter* reporter, float x) {
 static void test_int2float(skiatest::Reporter* reporter, int ival) {
     float x0 = (float)ival;
     float x1 = SkIntToFloatCast(ival);
-    float x2 = SkIntToFloatCast_NoOverflowCheck(ival);
     REPORTER_ASSERT(reporter, x0 == x1);
-    REPORTER_ASSERT(reporter, x0 == x2);
 }
 
 static void unittest_fastfloat(skiatest::Reporter* reporter) {