Home | History | Annotate | Download | only in core

Lines Matching refs:roots

119 int SkFindUnitQuadRoots(SkScalar A, SkScalar B, SkScalar C, SkScalar roots[2]) {
120 SkASSERT(roots);
123 return valid_unit_divide(-C, B, roots);
126 SkScalar* r = roots;
129 if (R < 0 || SkScalarIsNaN(R)) { // complex roots
137 if (r - roots == 2) {
138 if (roots[0] > roots[1])
139 SkTSwap<SkScalar>(roots[0], roots[1]);
140 else if (roots[0] == roots[1]) // nearly-equal?
143 return (int)(r - roots);
489 valid_unit_divide in SkChopCubicAt(... tValues[], int roots). The reason is
510 const SkScalar tValues[], int roots) {
513 for (int i = 0; i < roots - 1; i++)
523 if (roots == 0) { // nothing to chop
529 for (int i = 0; i < roots; i++) {
531 if (i == roots - 1) {
588 int roots = SkFindCubicExtrema(src[0].fY, src[1].fY, src[2].fY,
591 SkChopCubicAt(src, dst, tValues, roots);
592 if (dst && roots > 0) {
595 if (roots == 2) {
599 return roots;
604 int roots = SkFindCubicExtrema(src[0].fX, src[1].fX, src[2].fX,
607 SkChopCubicAt(src, dst, tValues, roots);
608 if (dst && roots > 0) {
611 if (roots == 2) {
615 return roots;
730 /* Solve coeff(t) == 0, returning the number of roots that
734 Eliminates repeated roots (so that all tValues are distinct, and are always
759 SkScalar* roots = tValues;
762 if (R2MinusQ3 < 0) { // we have 3 real roots
768 *roots++ = r;
772 *roots++ = r;
776 *roots++ = r;
780 // now sort the roots
781 int count = (int)(roots - tValues);
785 roots = tValues + count; // so we compute the proper count below
797 *roots++ = r;
801 return (int)(roots - tValues);
1018 SkScalar roots[2];
1019 int count = SkFindUnitQuadRoots(A, B, C, roots);
1022 return count == 1 ? roots[0] : 0;
1055 For our purposes, we can ignore the <= 0 roots, but we want to
1056 catch the >= 1 roots (which given our caller, will basically mean
1251 int roots = SkFindUnitQuadRoots(coeff[0], coeff[1], coeff[2], tValues);
1252 SkASSERT(0 == roots || 1 == roots);
1254 if (1 == roots) {