54 for (
int index = 0; index < 10000000; ++index) {
56 for (
int inner = 0; inner < 10; ++inner) {
62 for (
int xIdx = 0; xIdx < 3; ++xIdx) {
63 for (
int yIdx = 0; yIdx < 3; ++yIdx) {
69 int epsilon =
SkTAbs(p1Bits - p2Bits);
70 if (maxEpsilon < epsilon) {
71 SkDebugf(
"line={{0, 0}, {%1.7g, %1.7g}} t=%1.7g pt={%1.7g, %1.7g}"
89 for (
int index = 0; index < 100000; ++index) {
104 double deltaT = moveT / 2;
108 quad[1].fX = dPt.
fX -
line[1].fY * moveT;
109 quad[1].fY = dPt.
fY +
line[1].fX * moveT;
111 i.intersect(quad,
line);
119 }
while (last.
asSkPoint() != quad[1].asSkPoint());
124 int epsilon =
SkTAbs(p1Bits - p2Bits);
125 if (maxEpsilon < epsilon) {
126 SkDebugf(
"line={{0, 0}, {%1.7g, %1.7g}} t=%1.7g/%1.7g/%1.7g moveT=%1.7g"
127 " pt={%1.7g, %1.7g} epsilon=%d\n",
128 line[1].fX,
line[1].fY, t, t2, t3, moveT, last.
fX, last.
fY, epsilon);
129 maxEpsilon = epsilon;
131 double a1 = atan2(
line[1].fY,
line[1].fX);
132 double a2 = atan2(last.
fY, last.
fX);
133 double angle = fabs(a1 - a2);
134 if (maxAngle < angle) {
135 SkDebugf(
"line={{0, 0}, {%1.7g, %1.7g}} t=%1.7g/%1.7g/%1.7g moveT=%1.7g"
136 " pt={%1.7g, %1.7g} angle=%1.7g\n",
137 line[1].fX,
line[1].fY, t, t2, t3, moveT, last.
fX, last.
fY, angle);
146 double absX = fabs(
x);
147 double absY = fabs(
y);
148 double length = absX < absY ? absX / 2 + absY : absX + absY / 2;
150 (void) frexp(
length, &exponent);
151 double epsilon = ldexp(FLT_EPSILON, exponent);
156 double xSlop = epsilon * slopBits;
157 double ySlop =
x *
y < 0 ? -xSlop : xSlop;
158 double x1 =
x - xSlop;
159 double y1 =
y + ySlop;
160 double x_ry1 = x1 * ry;
161 double rx_y1 = rx * y1;
162 less1 = x_ry1 < rx_y1;
163 double x2 =
x + xSlop;
164 double y2 =
y - ySlop;
165 double x_ry2 = x2 * ry;
166 double rx_y2 = rx * y2;
167 less2 = x_ry2 < rx_y2;
168 }
while (less1 == less2 && ++slopBits);
176 return (
x >= 0 ?
y/(
x+
y) : 1-
x/(-
x+
y));
178 return (
x < 0 ? 2-
y/(-
x-
y) : 3+
x/(
x-
y));
183 {-0.058554756452593892, -0.18804585843827226, -0.018568569646021160, -0.059615294434479438},
184 {-0.0013717412948608398, 0.0041152238845825195, -0.00045837944195925573, 0.0013753175735478074},
185 {-2.1033774145221198, -1.4046019261273715e-008, -0.70062688352066704, -1.2706324683777995e-008},
193 const double* slopTest =
slopTests[index];
194 double x = slopTest[0];
195 double y = slopTest[1];
196 double rx = slopTest[2];
197 double ry = slopTest[3];
202 double diff = fabs(angle - rAngle);
203 SkDebugf(
"%s diamond xy=%1.9g rxy=%1.9g diff=%1.9g factor=%d\n", __FUNCTION__,
204 angle, rAngle, diff, (
int) (diff / FLT_EPSILON));
211 return lh.after(&rh);
215 return lh.lineOnOneSide(&rh,
false);
219 return lh.convexHullOverlaps(&rh);
223 return lh.orderable(&rh);
227 return lh.endsIntersect(&rh);
249 { {{{313.0155029296875, 207.90290832519531}, {320.05078125, 227.58743286132812}}}, 2, {} },
250 { {{{313.0155029296875, 207.90290832519531}, {313.98246891063195, 219.33615203830394},
251 {320.05078125, 227.58743286132812}}}, 3, {} },
263 for (
int idx2 = 0; idx2 <
data.fPtCount; ++idx2) {
264 data.fShortPts[idx2] =
data.fPts.fPts[idx2].asSkPoint();
266 switch (
data.fPtCount) {
281 next->debugAddAngle(0, 1);
294 { {{{322.935669,231.030273}, {312.832214,220.393295}, {312.832214,203.454178}}}, 3,
295 0.865309956, 0.154740299, {} },
296 { {{{322.12738,233.397751}, {295.718353,159.505829}}}, 2,
297 0.345028807, 0.0786326511, {} },
298 { {{{322.935669,231.030273}, {312.832214,220.393295}, {312.832214,203.454178}}}, 3,
299 0.865309956, 1, {} },
300 { {{{322.12738,233.397751}, {295.718353,159.505829}}}, 2,
301 0.345028807, 1, {} },
305 { {{{364.390686,157.898193}, {375.281769,136.674606}, {396.039917,136.674606}}}, 3,
306 0.578520747, 1, {} },
307 { {{{364.390686,157.898193}, {375.281769,136.674606}, {396.039917,136.674606}}}, 3,
308 0.578520747, 0.536512973, {} },
309 { {{{366.608826,151.196014}, {378.803101,136.674606}, {398.164948,136.674606}}}, 3,
310 0.490456543, 1, {} },
314 { {{{2.000000,0.000000}, {1.33333333,0.66666667}}}, 2, 1, 0, {} },
315 { {{{1.33333333,0.66666667}, {0.000000,2.000000}}}, 2, 0, 0.25, {} },
316 { {{{2.000000,2.000000}, {1.33333333,0.66666667}}}, 2, 1, 0, {} },
320 { {{{1.3333333,0.6666667}, {0.000,2.000}}}, 2, 0.250000006, 0, {} },
321 { {{{1.000,0.000}, {1.000,1.000}}}, 2, 1, 0, {} },
322 { {{{1.000,1.000}, {0.000,0.000}}}, 2, 0, 1, {} },
326 { {{{0.000,0.000}, {1.000,0.000}, {1.000,1.000}}}, 3, 1, 0.666666667, {} },
327 { {{{0.000,0.000}, {2.000,1.000}, {0.000,2.000}}}, 3, 0.5, 1, {} },
328 { {{{0.000,0.000}, {2.000,1.000}, {0.000,2.000}}}, 3, 0.5, 0, {} },
332 { {{{0.000,1.000}, {3.000,4.000}, {1.000,0.000}, {3.000,0.000}}}, 4, 0.0925339054, 0, {} },
333 { {{{0.000,1.000}, {0.000,3.000}, {1.000,0.000}, {4.000,3.000}}}, 4, 0.453872386, 0, {} },
334 { {{{0.000,1.000}, {3.000,4.000}, {1.000,0.000}, {3.000,0.000}}}, 4, 0.0925339054, 0.417096368, {} },
338 { {{{2.000,1.000}, {0.000,1.000}}}, 2, 0.5, 0, {} },
339 { {{{2.000,0.000}, {0.000,2.000}}}, 2, 0.5, 1, {} },
340 { {{{0.000,1.000}, {0.000,2.000}, {2.000,0.000}, {2.000,1.000}}}, 4, 0.5, 1, {} },
344 { {{{0.000,1.000}, {2.000,3.000}, {5.000,1.000}, {4.000,3.000}}}, 4, 0.311007457, 0.285714286, {} },
345 { {{{1.000,5.000}, {3.000,4.000}, {1.000,0.000}, {3.000,2.000}}}, 4, 0.589885081, 0.999982974, {} },
346 { {{{1.000,5.000}, {3.000,4.000}, {1.000,0.000}, {3.000,2.000}}}, 4, 0.589885081, 0.576935809, {} },
350 { {{{0.000,1.000}, {2.000,3.000}, {5.000,1.000}, {4.000,3.000}}}, 4, 0.476627072, 0.311007457, {} },
351 { {{{1.000,5.000}, {3.000,4.000}, {1.000,0.000}, {3.000,2.000}}}, 4, 0.999982974, 1, {} },
352 { {{{0.000,1.000}, {2.000,3.000}, {5.000,1.000}, {4.000,3.000}}}, 4, 0.476627072, 1, {} },
356 { {{{0.000,1.000}, {1.000,6.000}, {1.000,0.000}, {1.000,0.000}}}, 4, 0.788195121, 0.726275769, {} },
357 { {{{0.000,1.000}, {0.000,1.000}, {1.000,0.000}, {6.000,1.000}}}, 4, 0.473378977, 1, {} },
358 { {{{0.000,1.000}, {1.000,6.000}, {1.000,0.000}, {1.000,0.000}}}, 4, 0.788195121, 1, {} },
362 { {{{979.305,561.000}, {1036.695,291.000}}}, 2, 0.888888874, 0.11111108, {} },
363 { {{{1006.695,291.000}, {1023.264,291.000}, {1033.840,304.431}, {1030.318,321.000}}}, 4, 1, 0, {} },
364 { {{{979.305,561.000}, {1036.695,291.000}}}, 2, 0.888888874, 1, {} },
368 { {{{67.000,912.000}, {67.000,913.000}}}, 2, 1, 0, {} },
369 { {{{67.000,913.000}, {67.000,917.389}, {67.224,921.726}, {67.662,926.000}}}, 4, 0, 1, {} },
370 { {{{194.000,1041.000}, {123.860,1041.000}, {67.000,983.692}, {67.000,913.000}}}, 4, 1, 0, {} },
374 { {{{6.000,0.000}, {0.000,4.000}}}, 2, 0.625, 0.25, {} },
375 { {{{0.000,1.000}, {0.000,6.000}, {4.000,0.000}, {6.000,1.000}}}, 4, 0.5, 0.833333333, {} },
376 { {{{0.000,1.000}, {0.000,6.000}, {4.000,0.000}, {6.000,1.000}}}, 4, 0.5, 0.379043969, {} },
380 { {{{0.000,1.000}, {4.000,6.000}, {2.000,1.000}, {2.000,0.000}}}, 4, 0.0756502183, 0.0594570973, {} },
381 { {{{1.000,2.000}, {0.000,2.000}, {1.000,0.000}, {6.000,4.000}}}, 4, 0.0756502184, 0, {} },
382 { {{{0.000,1.000}, {4.000,6.000}, {2.000,1.000}, {2.000,0.000}}}, 4, 0.0756502183, 0.531917258, {} },
386 { {{{490.435,879.407}, {405.593,909.436}}}, 2, 0.500554405, 1, {} },
387 { {{{447.967,894.438}, {448.007,894.424}, {448.014,894.422}}}, 3, 0, 1, {} },
388 { {{{490.435,879.407}, {405.593,909.436}}}, 2, 0.500554405, 0.500000273, {} },
392 { {{{1.000,4.000}, {4.000,5.000}, {3.000,2.000}, {6.000,3.000}}}, 4, 0.5, 0, {} },
393 { {{{2.000,3.000}, {3.000,6.000}, {4.000,1.000}, {5.000,4.000}}}, 4, 0.5, 0.112701665, {} },
394 { {{{5.000,4.000}, {2.000,3.000}}}, 2, 0.5, 0, {} },
399 { {{{270.974121f, 770.025879f}, {234.948273f, 734}, {184, 734}}}
400 , 3, 0.74590454, 0.547660352, {} },
401 { {{{185, 734}, {252.93103f, 734}, {308, 789.06897f}, {308, 857}}}
402 , 4, 0.12052623, 0, {} },
403 { {{{270.974121f, 770.025879f}, {234.948273f, 734}, {184, 734}}}
404 , 3, 0.74590454, 1, {} },
408 { {{{270.974121f, 770.025879f}, {234.948273f, 734}, {184, 734}}}
409 , 3, 0.74590454, 1, {} },
410 { {{{185, 734}, {252.93103f, 734}, {308, 789.06897f}, {308, 857}}}
411 , 4, 0.12052623, 0.217351928, {} },
412 { {{{270.974121f, 770.025879f}, {234.948273f, 734}, {184, 734}}}
413 , 3, 0.74590454, 0.547660352, {} },
417 { {{{0, 1}, {3, 5}, {2, 1}, {3, 1}}}
418 , 4, 0.135148995, 0.134791946, {} },
419 { {{{1, 2}, {1, 2.15061641f}, {1, 2.21049166f}, {1.01366711f, 2.21379328f}}}
420 , 4, 0.956740456, 0.894913214, {} },
421 { {{{0, 1}, {3, 5}, {2, 1}, {3, 1}}}
422 , 4, 0.135148995, 0.551812363, {} },
425#define I(x) intersectDataSet##x
428 I(1),
I(2),
I(3),
I(4),
I(5),
I(6),
I(7),
I(8),
I(9),
I(10),
429 I(11),
I(12),
I(13),
I(14),
I(15),
I(16),
I(17),
I(18),
I(19),
433#define I(x) (int) std::size(intersectDataSet##x)
436 I(1),
I(2),
I(3),
I(4),
I(5),
I(6),
I(7),
I(8),
I(9),
I(10),
437 I(11),
I(12),
I(13),
I(14),
I(15),
I(16),
I(17),
I(18),
I(19),
452 for (
int index2 = 0; index2 < dataSize - 2; ++index2) {
457 for (
int index3 = 0; index3 < 3; ++index3) {
460 for (
int idx2 = 0; idx2 <
data.fPtCount; ++idx2) {
461 temp[idx2] =
data.fPts.fPts[idx2].asSkPoint();
463 switch (
data.fPtCount) {
476 seg1->
debugAddAngle(dataArray[index2 + 0].fTStart, dataArray[index2 + 0].fTEnd);
478 seg2->
debugAddAngle(dataArray[index2 + 1].fTStart, dataArray[index2 + 1].fTEnd);
480 seg3->
debugAddAngle(dataArray[index2 + 2].fTStart, dataArray[index2 + 2].fTEnd);
499 SkPoint conicPts[3] = {{494.37100219726562f, 224.66200256347656f},
500 {494.37360910682298f, 224.6729026561527f},
501 {494.37600708007813f, 224.68400573730469f}};
502 SkPoint linePts[2] = {{494.371002f, 224.662003f}, {494.375000f, 224.675995f}};
503 for (
int i = 10;
i >= 0; --
i) {
504 SkPoint modLinePts[2] = { linePts[0], linePts[1] };
505 modLinePts[1].
fX +=
i * .1f;
512 next->debugAddAngle(0, 1);
static const int circleDataSetSize
static IntersectData intersectDataSet14[]
static IntersectData intersectDataSet2[]
static IntersectData intersectDataSet9[]
static IntersectData * intersectDataSets[]
static IntersectData intersectDataSet5[]
static CircleData circleDataSet[]
static IntersectData intersectDataSet16[]
static IntersectData intersectDataSet11[]
static float next(float f)
static IntersectData intersectDataSet12[]
DEF_TEST(PathOpsAngleFindCrossEpsilon, reporter)
static IntersectData intersectDataSet7[]
static IntersectData intersectDataSet17[]
static const int intersectDataSetsSize
static IntersectData intersectDataSet18[]
static IntersectData intersectDataSet8[]
static IntersectData intersectDataSet1[]
static const int intersectDataSetSizes[]
static float prev(float f)
static IntersectData intersectDataSet3[]
static IntersectData intersectDataSet13[]
static double diamond_angle(double y, double x)
static const double slopTests[][4]
static IntersectData intersectDataSet10[]
static bool gDisableAngleTests
static IntersectData intersectDataSet19[]
static IntersectData intersectDataSet4[]
static IntersectData intersectDataSet15[]
static IntersectData intersectDataSet6[]
static int find_slop(double x, double y, double rx, double ry)
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static int32_t SkFloatAs2sCompliment(float x)
static float Sk2sComplimentAsFloat(int32_t x)
#define SkDEBUGPARAMS(...)
#define SkDoubleToScalar(x)
SkDEBUGCODE(SK_SPI) SkThreadID SkGetThreadID()
#define REPORTER_ASSERT(r, cond,...)
static void SetNext(SkOpAngle &lh, SkOpAngle &rh)
static int After(SkOpAngle &lh, SkOpAngle &rh)
static int ConvexHullOverlaps(SkOpAngle &lh, SkOpAngle &rh)
static int Orderable(SkOpAngle &lh, SkOpAngle &rh)
static int AllOnOneSide(SkOpAngle &lh, SkOpAngle &rh)
static int EndsIntersect(SkOpAngle &lh, SkOpAngle &rh)
static void DebugReset(SkOpSegment *segment)
auto make(Ctor &&ctor) -> decltype(ctor(nullptr))
SkOpAngle * debugLastAngle()
void debugAddAngle(double startT, double endT)
SkOpSegment * next() const
float nextRangeF(float min, float max)
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
SkDPoint fPts[kPointCount]
SkPoint asSkPoint() const
void debugSet(const SkDPoint *pts)
std::shared_ptr< const fml::Mapping > data