140 {
142 return;
143 }
145 double worstStep[256] = {0};
147 int iters = 0;
148 double smallestR2 = 0;
149 double largestR2 = 0;
150 for (int index = 0; index < 1000000000; ++index) {
156 }};
157
162
163
167 double allRoots[3] = {0}, validRoots[3] = {0};
170 if (valid != 1) {
171 continue;
172 }
173 if (realRoots == 1) {
174 continue;
175 }
176 t = validRoots[0];
179 continue;
180 }
181#if 0
182 double R2MinusQ3;
183 if (r2check(
A,
B,
C,
D, &R2MinusQ3)) {
184 smallestR2 = std::min(smallestR2, R2MinusQ3);
185 largestR2 = std::max(largestR2, R2MinusQ3);
186 }
187#endif
188 double largest = std::max(fabs(allRoots[0]), fabs(allRoots[1]));
189 if (realRoots == 3) {
190 largest = std::max(largest, fabs(allRoots[2]));
191 }
192 int largeBits;
193 if (largest <= 1) {
194#if 0
195 SkDebugf(
"realRoots=%d (%1.9g, %1.9g, %1.9g) valid=%d (%1.9g, %1.9g, %1.9g)\n",
196 realRoots, allRoots[0], allRoots[1], allRoots[2], valid, validRoots[0],
197 validRoots[1], validRoots[2]);
198#endif
199 double smallest = std::min(allRoots[0], allRoots[1]);
200 if (realRoots == 3) {
201 smallest = std::min(smallest, allRoots[2]);
202 }
205 largeBits = 0;
206 } else {
207 frexp(largest, &largeBits);
210 }
212 if (largeBits > 21) {
214 } else if (largeBits > 18) {
216 } else if (largeBits > 15) {
218 } else if (largeBits > 12) {
220 } else if (largeBits > 9) {
222 }
223 double diff;
224 do {
226 if (newT >= 0) {
227 diff = fabs(t - newT);
228 break;
229 }
232 } while (true);
233 worstStep[largeBits] = std::max(worstStep[largeBits], diff);
234#if 0
235 {
241 }
242#endif
244 }
245 SkDebugf(
"errors=%d avgIter=%1.9g", errors, (
double) iters / errors);
247 int worstLimit = std::size(worstStep);
248 while (worstStep[--worstLimit] == 0) ;
249 for (int idx2 = 0; idx2 <= worstLimit; ++idx2) {
250 SkDebugf(
"%1.9g ", worstStep[idx2]);
251 }
253 SkDebugf(
"smallestR2=%1.9g largestR2=%1.9g\n", smallestR2, largestR2);
254}
static bool gPathOpsCubicLineIntersectionIdeasVerbose
static double binary_search(const SkDCubic &cubic, double step, const SkDPoint &pt, double t, int *iters)
float nextRangeF(float min, float max)
SkDPoint fPts[kPointCount]
static int RootsReal(double A, double B, double C, double D, double t[3])
static void Coefficients(const double *cubic, double *A, double *B, double *C, double *D)
static int AddValidTs(double s[], int realRoots, double *t)