diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-12-17 16:44:46 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-12-17 16:44:46 +0000 |
commit | 8f4d2306fa866a26f9448048ff63f692b2ba43aa (patch) | |
tree | 7a48d817cb5220f87e81781320b002eead2495a0 /src/core/SkLineClipper.cpp | |
parent | a34b638b909f58dd7c66546a0f49923112f7f785 (diff) |
remove SK_SCALAR_IS_[FLOAT,FIXED] and assume floats
To keep the CL (slightly) managable, this does not make any changes to
existing macros (e.g. SkScalarMul). Just tackling #ifdef constructs this
time around.
BUG=
R=bsalomon@google.com, caryclark@google.com
Review URL: https://codereview.chromium.org/117053002
git-svn-id: http://skia.googlecode.com/svn/trunk@12712 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core/SkLineClipper.cpp')
-rw-r--r-- | src/core/SkLineClipper.cpp | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/src/core/SkLineClipper.cpp b/src/core/SkLineClipper.cpp index 911cd974da..634de0d1e7 100644 --- a/src/core/SkLineClipper.cpp +++ b/src/core/SkLineClipper.cpp @@ -28,7 +28,6 @@ static SkScalar sect_with_horizontal(const SkPoint src[2], SkScalar Y) { if (SkScalarNearlyZero(dy)) { return SkScalarAve(src[0].fX, src[1].fX); } else { -#ifdef SK_SCALAR_IS_FLOAT // need the extra precision so we don't compute a value that exceeds // our original limits double X0 = src[0].fX; @@ -41,10 +40,6 @@ static SkScalar sect_with_horizontal(const SkPoint src[2], SkScalar Y) { // when the doubles were added and subtracted, so we have to pin the // answer :( return (float)pin_unsorted(result, X0, X1); -#else - return src[0].fX + SkScalarMulDiv(Y - src[0].fY, src[1].fX - src[0].fX, - dy); -#endif } } @@ -54,7 +49,6 @@ static SkScalar sect_with_vertical(const SkPoint src[2], SkScalar X) { if (SkScalarNearlyZero(dx)) { return SkScalarAve(src[0].fY, src[1].fY); } else { -#ifdef SK_SCALAR_IS_FLOAT // need the extra precision so we don't compute a value that exceeds // our original limits double X0 = src[0].fX; @@ -63,10 +57,6 @@ static SkScalar sect_with_vertical(const SkPoint src[2], SkScalar X) { double Y1 = src[1].fY; double result = Y0 + ((double)X - X0) * (Y1 - Y0) / (X1 - X0); return (float)result; -#else - return src[0].fY + SkScalarMulDiv(X - src[0].fX, src[1].fY - src[0].fY, - dx); -#endif } } @@ -167,7 +157,6 @@ static bool is_between_unsorted(SkScalar value, } #endif -#ifdef SK_SCALAR_IS_FLOAT #ifdef SK_DEBUG // This is an example of why we need to pin the result computed in // sect_with_horizontal. If we didn't explicitly pin, is_between_unsorted would @@ -182,11 +171,9 @@ static void sect_with_horizontal_test_for_pin_results() { SkASSERT(is_between_unsorted(x, pts[0].fX, pts[1].fX)); } #endif -#endif int SkLineClipper::ClipLine(const SkPoint pts[], const SkRect& clip, SkPoint lines[]) { -#ifdef SK_SCALAR_IS_FLOAT #ifdef SK_DEBUG { static bool gOnce; @@ -196,7 +183,6 @@ int SkLineClipper::ClipLine(const SkPoint pts[], const SkRect& clip, } } #endif -#endif int index0, index1; |