aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar caryclark <caryclark@google.com>2014-08-19 07:39:40 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-08-19 07:39:41 -0700
commit38dd9f2e41748953f46e5daaf341971a851b247d (patch)
tree935bca93c87a846b608671dd634f5fed11c73951
parent3ba54fa0adb0a9bb81c09ef18d6f8cebea311a6f (diff)
remove unused SkIntToFloatCast_NoOverflowCheck
R=reed@google.com, reed BUG=skia:2849 Author: caryclark@google.com Review URL: https://codereview.chromium.org/483273003
-rw-r--r--include/core/SkFloatBits.h1
-rw-r--r--src/core/SkFloatBits.cpp20
-rw-r--r--tests/MathTest.cpp2
3 files changed, 0 insertions, 23 deletions
diff --git a/include/core/SkFloatBits.h b/include/core/SkFloatBits.h
index 552e712f53..3ddb9ef564 100644
--- a/include/core/SkFloatBits.h
+++ b/include/core/SkFloatBits.h
@@ -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
diff --git a/src/core/SkFloatBits.cpp b/src/core/SkFloatBits.cpp
index 6b35a75c88..8d89dfef22 100644
--- a/src/core/SkFloatBits.cpp
+++ b/src/core/SkFloatBits.cpp
@@ -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;
-}
diff --git a/tests/MathTest.cpp b/tests/MathTest.cpp
index 4205ce6cf5..20539369b8 100644
--- a/tests/MathTest.cpp
+++ b/tests/MathTest.cpp
@@ -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) {