aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkMath.cpp
diff options
context:
space:
mode:
authorGravatar rmistry@google.com <rmistry@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-23 18:09:54 +0000
committerGravatar rmistry@google.com <rmistry@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-23 18:09:54 +0000
commitfbfcd5602128ec010c82cb733c9cdc0a3254f9f3 (patch)
treed8b4815d15946c32ee9d254e932411e93be942bb /src/core/SkMath.cpp
parent2abed834789bb64c7da740df4c47efc142b7311a (diff)
Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/)
This CL is part I of IV (I broke down the 1280 files into 4 CLs). Review URL: https://codereview.appspot.com/6485054 git-svn-id: http://skia.googlecode.com/svn/trunk@5262 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core/SkMath.cpp')
-rw-r--r--src/core/SkMath.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/core/SkMath.cpp b/src/core/SkMath.cpp
index a149625297..ccd96e939a 100644
--- a/src/core/SkMath.cpp
+++ b/src/core/SkMath.cpp
@@ -20,7 +20,7 @@
#define sub_shift(zeros, x, n) \
zeros -= n; \
x >>= n
-
+
int SkCLZ_portable(uint32_t x) {
if (x == 0) {
return 32;
@@ -229,7 +229,7 @@ SkFixed SkFixedFastInvert(SkFixed x) {
int lz = SkCLZ(a);
a = a << lz >> 16;
- // compute 1/a approximation (0.5 <= a < 1.0)
+ // compute 1/a approximation (0.5 <= a < 1.0)
uint32_t r = 0x17400 - a; // (2.90625 (~2.914) - 2*a) >> 1
// Newton-Raphson iteration:
@@ -253,13 +253,13 @@ SkFixed SkFixedFastInvert(SkFixed x) {
case n: \
if ((numer = (numer << 1) - denom) >= 0) \
result |= 1 << (n - 1); else numer += denom
-
+
int32_t SkDivBits(int32_t numer, int32_t denom, int shift_bias) {
SkASSERT(denom != 0);
if (numer == 0) {
return 0;
}
-
+
// make numer and denom positive, and sign hold the resulting sign
int32_t sign = SkExtractSign(numer ^ denom);
numer = SkAbs32(numer);
@@ -278,16 +278,16 @@ int32_t SkDivBits(int32_t numer, int32_t denom, int shift_bias) {
denom <<= dbits;
numer <<= nbits;
-
+
SkFixed result = 0;
-
+
// do the first one
if ((numer -= denom) >= 0) {
result = 1;
} else {
numer += denom;
}
-
+
// Now fall into our switch statement if there are more bits to compute
if (bits > 0) {
// make room for the rest of the answer bits
@@ -324,7 +324,7 @@ SkFixed SkFixedMod(SkFixed numer, SkFixed denom) {
numer = SkApplySign(numer, sn);
denom = SkApplySign(denom, sd);
-
+
if (numer < denom) {
return SkApplySign(numer, sn);
} else if (numer == denom) {
@@ -387,7 +387,7 @@ int32_t SkCubeRootBits(int32_t value, int bits) {
SkFixed SkFixedMean(SkFixed a, SkFixed b) {
Sk64 tmp;
-
+
tmp.setMul(a, b);
return tmp.getSqrt();
}