Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2189)

Unified Diff: src/core/SkCubicClipper.cpp

Issue 117053002: remove SK_SCALAR_IS_[FLOAT,FIXED] and assume floats (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/core/SkCubicClipper.cpp
diff --git a/src/core/SkCubicClipper.cpp b/src/core/SkCubicClipper.cpp
index aed681b9f301e78cf73aab0f5ce7cb1be39d306b..81ef18de7afa5e441ff359a804230d3ea12d410a 100644
--- a/src/core/SkCubicClipper.cpp
+++ b/src/core/SkCubicClipper.cpp
@@ -31,11 +31,7 @@ static bool chopMonoCubicAtY(SkPoint pts[4], SkScalar y, SkScalar* t) {
// Initial guess.
// TODO(turk): Check for zero denominator? Shouldn't happen unless the curve
// is not only monotonic but degenerate.
-#ifdef SK_SCALAR_IS_FLOAT
SkScalar t1 = ycrv[0] / (ycrv[0] - ycrv[3]);
-#else // !SK_SCALAR_IS_FLOAT
- SkScalar t1 = SkDivBits(ycrv[0], ycrv[0] - ycrv[3], 16);
-#endif // !SK_SCALAR_IS_FLOAT
// Newton's iterations.
const SkScalar tol = SK_Scalar1 / 16384; // This leaves 2 fixed noise bits.
@@ -53,11 +49,7 @@ static bool chopMonoCubicAtY(SkPoint pts[4], SkScalar y, SkScalar* t) {
SkScalar y0123 = SkScalarInterp(y012, y123, t0);
SkScalar yder = (y123 - y012) * 3;
// TODO(turk): check for yder==0: horizontal.
-#ifdef SK_SCALAR_IS_FLOAT
t1 -= y0123 / yder;
-#else // !SK_SCALAR_IS_FLOAT
- t1 -= SkDivBits(y0123, yder, 16);
-#endif // !SK_SCALAR_IS_FLOAT
converged = SkScalarAbs(t1 - t0) <= tol; // NaN-safe
++iters;
} while (!converged && (iters < maxiters));
« src/core/SkCanvas.cpp ('K') | « src/core/SkCanvas.cpp ('k') | src/core/SkEdge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698