aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/Sk64.cpp
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-12-19 14:22:03 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-12-19 14:22:03 +0000
commit1915fd09f3b60eb907f5ab155e8379b589e2bae1 (patch)
tree24dbb06f840516cafff4d7c7d0266bd46d959ab1 /src/core/Sk64.cpp
parent4fa237f2fb66e7f3be003add06e719e1ca1fe643 (diff)
remove unused SkFixed and SkFract functions
BUG= R=caryclark@google.com Review URL: https://codereview.chromium.org/113873008 git-svn-id: http://skia.googlecode.com/svn/trunk@12767 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core/Sk64.cpp')
-rw-r--r--src/core/Sk64.cpp54
1 files changed, 2 insertions, 52 deletions
diff --git a/src/core/Sk64.cpp b/src/core/Sk64.cpp
index 54b30221c9..1fb0454ae2 100644
--- a/src/core/Sk64.cpp
+++ b/src/core/Sk64.cpp
@@ -133,19 +133,14 @@ void Sk64::abs()
}
}
+#if 0
SkBool Sk64::isFixed() const
{
Sk64 tmp = *this;
tmp.roundRight(16);
return tmp.is32();
}
-
-SkFract Sk64::getFract() const
-{
- Sk64 tmp = *this;
- tmp.roundRight(30);
- return tmp.get32();
-}
+#endif
void Sk64::sub(const Sk64& a)
{
@@ -298,48 +293,3 @@ int32_t Sk64::getSqrt() const
return value | fLo;
}
#endif
-
-SkFixed Sk64::getFixedDiv(const Sk64& denom) const
-{
- Sk64 N = *this;
- Sk64 D = denom;
- int32_t sign = SkExtractSign(N.fHi ^ D.fHi);
- SkFixed result;
-
- N.abs();
- D.abs();
-
- // need to knock D down to just 31 bits
- // either by rounding it to the right, or shifting N to the left
- // then we can just call 64/32 div
-
- int nclz = N.fHi ? SkCLZ(N.fHi) : 32;
- int dclz = D.fHi ? SkCLZ(D.fHi) : (33 - (D.fLo >> 31));
-
- int shiftN = nclz - 1;
- SkASSERT(shiftN >= 0);
- int shiftD = 33 - dclz;
- SkASSERT(shiftD >= 0);
-
- if (shiftD + shiftN < 16)
- shiftD = 16 - shiftN;
- else
- shiftN = 16 - shiftD;
-
- D.roundRight(shiftD);
- if (D.isZero())
- result = SK_MaxS32;
- else
- {
- if (shiftN >= 0)
- N.shiftLeft(shiftN);
- else
- N.roundRight(-shiftN);
- N.div(D.get32(), Sk64::kTrunc_DivOption);
- if (N.is32())
- result = N.get32();
- else
- result = SK_MaxS32;
- }
- return SkApplySign(result, sign);
-}