Lines Matching full:roots
135 int SkFindUnitQuadRoots(SkScalar A, SkScalar B, SkScalar C, SkScalar roots[2])
137 SkASSERT(roots);
140 return valid_unit_divide(-C, B, roots);
142 SkScalar* r = roots;
146 if (R < 0 || SkScalarIsNaN(R)) { // complex roots
165 if (r - roots == 2)
167 if (roots[0] > roots[1])
168 SkTSwap<SkScalar>(roots[0], roots[1]);
169 else if (roots[0] == roots[1]) // nearly-equal?
172 return (int)(r - roots);
179 static int Sk64FindFixedQuadRoots(const Sk64& A, const Sk64& B, const Sk64& C, SkFixed roots[2])
188 return SkFindUnitQuadRoots(A.getShiftRight(shift), B.getShiftRight(shift), C.getShiftRight(shift), roots);
598 valid_unit_divide in SkChopCubicAt(... tValues[], int roots). The reason is
618 void SkChopCubicAt(const SkPoint src[4], SkPoint dst[], const SkScalar tValues[], int roots)
622 for (int i = 0; i < roots - 1; i++)
633 if (roots == 0) // nothing to chop
640 for (int i = 0; i < roots; i++)
643 if (i == roots - 1)
701 int roots = SkFindCubicExtrema(src[0].fY, src[1].fY, src[2].fY,
704 SkChopCubicAt(src, dst, tValues, roots);
705 if (dst && roots > 0) {
708 if (roots == 2) {
712 return roots;
717 int roots = SkFindCubicExtrema(src[0].fX, src[1].fX, src[2].fX,
720 SkChopCubicAt(src, dst, tValues, roots);
721 if (dst && roots > 0) {
724 if (roots == 2) {
728 return roots;
900 /* Solve coeff(t) == 0, returning the number of roots that
904 Eliminates repeated roots (so that all tValues are distinct, and are always
939 SkScalar* roots = tValues;
942 if (SkFPLT(R2MinusQ3, 0)) // we have 3 real roots
950 *roots++ = r;
954 *roots++ = r;
958 *roots++ = r;
962 // now sort the roots
963 int count = (int)(roots - tValues);
967 roots = tValues + count; // so we compute the proper count below
981 *roots++ = r;
984 return (int)(roots - tValues);
1200 SkScalar roots[2];
1201 int count = SkFindUnitQuadRoots(A, B, C, roots);
1204 return count == 1 ? roots[0] : 0;
1239 For our purposes, we can ignore the <= 0 roots, but we want to
1240 catch the >= 1 roots (which given our caller, will basically mean
1454 int roots = SkFindUnitQuadRoots(coeff[0], coeff[1], coeff[2], tValues);
1455 SkASSERT(0 == roots || 1 == roots);
1457 if (1 == roots) {