diff options
author | 2015-04-15 19:57:54 -0700 | |
---|---|---|
committer | 2015-04-15 19:57:54 -0700 | |
commit | 0b71278679f1ce2bdbabe117285bc1b3166d372a (patch) | |
tree | 579014ca6e6de894f28f8f14a444b917b6b98863 /src | |
parent | 6983f66d8b3a489133b751e2cef03e72a03bfeae (diff) |
remove older version of cubic->coeff
BUG=skia:
TBR=
Review URL: https://codereview.chromium.org/1084623004
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkGeometry.cpp | 18 | ||||
-rw-r--r-- | src/core/SkGeometry.h | 5 | ||||
-rw-r--r-- | src/utils/SkPatchUtils.cpp | 14 |
3 files changed, 2 insertions, 35 deletions
diff --git a/src/core/SkGeometry.cpp b/src/core/SkGeometry.cpp index 5979615425..b9366f3dd9 100644 --- a/src/core/SkGeometry.cpp +++ b/src/core/SkGeometry.cpp @@ -341,24 +341,6 @@ void SkConvertQuadToCubic(const SkPoint src[3], SkPoint dst[4]) { ///// CUBICS // CUBICS // CUBICS // CUBICS // CUBICS // CUBICS // CUBICS ///// ////////////////////////////////////////////////////////////////////////////// -static void get_cubic_coeff(const SkScalar pt[], SkScalar coeff[4]) { - coeff[0] = pt[6] + 3*(pt[2] - pt[4]) - pt[0]; - coeff[1] = 3*(pt[4] - pt[2] - pt[2] + pt[0]); - coeff[2] = 3*(pt[2] - pt[0]); - coeff[3] = pt[0]; -} - -void SkGetCubicCoeff(const SkPoint pts[4], SkScalar cx[4], SkScalar cy[4]) { - SkASSERT(pts); - - if (cx) { - get_cubic_coeff(&pts[0].fX, cx); - } - if (cy) { - get_cubic_coeff(&pts[0].fY, cy); - } -} - static SkScalar eval_cubic(const SkScalar src[], SkScalar t) { SkASSERT(src); SkASSERT(t >= 0 && t <= SK_Scalar1); diff --git a/src/core/SkGeometry.h b/src/core/SkGeometry.h index 9ddd91f750..811678eeec 100644 --- a/src/core/SkGeometry.h +++ b/src/core/SkGeometry.h @@ -104,11 +104,6 @@ SK_API void SkConvertQuadToCubic(const SkPoint src[3], SkPoint dst[4]); /////////////////////////////////////////////////////////////////////////////// -/** Convert from parametric from (pts) to polynomial coefficients - coeff[0]*T^3 + coeff[1]*T^2 + coeff[2]*T + coeff[3] -*/ -void SkGetCubicCoeff(const SkPoint pts[4], SkScalar cx[4], SkScalar cy[4]); - /** Set pt to the point on the src cubic specified by t. t must be 0 <= t <= 1.0 */ diff --git a/src/utils/SkPatchUtils.cpp b/src/utils/SkPatchUtils.cpp index c9c526e456..08fd4389d3 100644 --- a/src/utils/SkPatchUtils.cpp +++ b/src/utils/SkPatchUtils.cpp @@ -48,12 +48,7 @@ public: fPoints[2] = c; fPoints[3] = d; - SkScalar cx[4], cy[4]; - SkGetCubicCoeff(fPoints, cx, cy); - fCoefs[0].set(cx[0], cy[0]); - fCoefs[1].set(cx[1], cy[1]); - fCoefs[2].set(cx[2], cy[2]); - fCoefs[3].set(cx[3], cy[3]); + SkCubicToCoeff(fPoints, fCoefs); this->restart(1); } @@ -61,12 +56,7 @@ public: explicit FwDCubicEvaluator(const SkPoint points[4]) { memcpy(fPoints, points, 4 * sizeof(SkPoint)); - SkScalar cx[4], cy[4]; - SkGetCubicCoeff(fPoints, cx, cy); - fCoefs[0].set(cx[0], cy[0]); - fCoefs[1].set(cx[1], cy[1]); - fCoefs[2].set(cx[2], cy[2]); - fCoefs[3].set(cx[3], cy[3]); + SkCubicToCoeff(fPoints, fCoefs); this->restart(1); } |