23#define DEBUG_SIMPLIFY_FAILS 0
36 for (
int x = 0;
x <
set.fColumns; ++
x) {
37 for (
int y = 0;
y <
set.fRows; ++
y) {
38 for (
SkScalar r = 0; r < 360; r += 360.f /
set.fRotations) {
42 matrix.postRotate(r, 0, 0);
51 openClip.
setRect({-16000, -16000, 16000, 16000});
52 rgnB.
setPath(rotated, openClip);
66 SkPath oval, regionResult, builderResult, opResult;
92 r.
setSeed(col * 100000000 + row * 10000000 + rot * 1000000 + trial);
95 OvalSet set = {{0, 0, 0, 0}, col, row, rot, xOffset, yOffset};
96 set.fBounds.setXYWH(5, 5,
102 "Offset the test by this value. This permits multiple processes "
103 "to exercise the same test in parallel with different test values.");
105 "Test iteration count. This permits multiple processes "
106 "to exercise the same test in parallel with different test values.");
107static DEFINE_int(trialRuns, 100,
"Run this many tests (defaults to 100).");
110 bool skipOneOffs =
false;
111 int trialRuns = FLAGS_trialRuns / FLAGS_processCount;
112 for (
int col = 1; col <= 2; ++col) {
113 for (
int row = 1; row <= 3; ++row) {
114 for (
int rot = 2; rot <= 9; ++rot) {
115 for (
int trial = FLAGS_processOffset * trialRuns; --trialRuns >= 0; ++trial) {
119 && trial ==
oneOff.fTrial) {
139#if DEBUG_SIMPLIFY_FAILS
156 while (subsetContours.subset(failed, &minimal)) {
157 failed = simplify_fails(
reporter, minimal);
158 SkDebugf(
" %s\n", failed ?
"failed" :
"");
160 lastFailed = minimal;
163 failed = simplify_fails(
reporter, lastFailed);
166 while (subsetVerbs.subset(failed, &minimal)) {
167 failed = simplify_fails(
reporter, minimal);
168 SkDebugf(
" %s\n", failed ?
"failed" :
"");
170 lastFailed = minimal;
396#if DEBUG_SIMPLIFY_FAILS
399 if (failed == lastFailed) {
410path.moveTo(377.219f, -141.981f);
411path.conicTo(40.5787f, -201.34f, 23.1855f, -102.698f, 0.707107f);
412path.lineTo(377.219f, -141.981f);
414path.moveTo(306.588f, -227.984f);
415path.conicTo(212.465f, -262.242f, 95.5512f, 58.9764f, 0.707107f);
416path.lineTo(306.588f, -227.984f);
424path.moveTo(11.1722f, -8.10398f);
425path.conicTo(22.9143f, -10.3787f, 23.7764f, -7.72542f, 1.00863f);
426path.conicTo(24.6671f, -4.98406f, 13.8147f, 0.0166066f, 0.973016f);
427path.conicTo(24.6378f, 5.07425f, 23.7764f, 7.72542f, 1.00888f);
428path.conicTo(22.8777f, 10.4915f, 11.1648f, 8.13034f, 0.960143f);
429path.conicTo(16.9503f, 18.5866f, 14.6946f, 20.2254f, 1.00881f);
430path.conicTo(12.4417f, 21.8623f, 4.29722f, 13.1468f, 1.0092f);
431path.conicTo(2.92708f, 25, 0, 25, 0.955692f);
432path.conicTo(-2.79361f, 25, -4.258f, 13.1048f, 1.00818f);
433path.conicTo(-4.27813f, 13.1264f, -4.29822f, 13.1479f, 1.03158f);
434path.conicTo(-12.44f, 21.8635f, -14.6946f, 20.2254f, 1.00811f);
435path.conicTo(-16.9933f, 18.5554f, -11.1722f, 8.10398f, 0.989875f);
436path.conicTo(-22.9143f, 10.3787f, -23.7764f, 7.72542f, 1.00863f);
437path.conicTo(-24.6671f, 4.98406f, -13.8147f, -0.0166066f, 0.973016f);
438path.conicTo(-24.6378f, -5.07425f, -23.7764f, -7.72542f, 1.00888f);
439path.conicTo(-22.8777f, -10.4915f, -11.1648f, -8.13034f, 0.960143f);
440path.conicTo(-16.9503f, -18.5866f, -14.6946f, -20.2254f, 1.00881f);
441path.conicTo(-12.4417f, -21.8623f, -4.29722f, -13.1468f, 1.0092f);
442path.conicTo(-2.92708f, -25, 0, -25, 0.955692f);
443path.conicTo(2.79361f, -25, 4.258f, -13.1048f, 1.00818f);
444path.conicTo(4.27813f, -13.1264f, 4.29822f, -13.1479f, 1.03158f);
445path.conicTo(12.44f, -21.8635f, 14.6946f, -20.2254f, 1.00811f);
446path.conicTo(16.9933f, -18.5554f, 11.1722f, -8.10398f, 0.989875f);
451path.moveTo(-1.54509f, -4.75528f);
452path.conicTo(22.2313f, -12.4807f, 23.7764f, -7.72543f, 0.707107f);
453path.conicTo(25.3215f, -2.97014f, 1.54509f, 4.75528f, 0.707107f);
454path.conicTo(-22.2313f, 12.4807f, -23.7764f, 7.72543f, 0.707107f);
455path.conicTo(-25.3215f, 2.97014f, -1.54509f, -4.75528f, 0.707107f);
505" Q 146.4187316894531 139.8508911132812 146.4066772460938 143.19775390625"
506" Q 146.3946533203125 146.5446166992188 146.3705749511719 149.8793640136719"
507" Q 146.3465270996094 153.214111328125 146.3104858398438 156.5287170410156"
508" Q 146.2744750976562 159.8433227539062 146.2265930175781 163.1298217773438"
509" Q 146.1786804199219 166.4163208007812 146.1190490722656 169.6668090820312"
510" Q 146.0593872070312 172.9172973632812 145.9881286621094 176.1238708496094"
511" Q 145.9168701171875 179.3304443359375 145.8341674804688 182.4854736328125"
512" Q 145.75146484375 185.6404418945312 145.6575317382812 188.7362670898438"
513" Q 145.5635681152344 191.8320922851562 145.4586181640625 194.8612365722656"
514" Q 145.3536682128906 197.8904113769531 145.2379455566406 200.8456420898438"
515" Q 145.1222229003906 203.8008422851562 144.9960021972656 206.6750183105469"
516" Q 144.8698120117188 209.5491638183594 144.7334289550781 212.3353271484375"
517" Q 144.5970458984375 215.1214599609375 144.4508056640625 217.8129272460938"
518" Q 144.3045654296875 220.50439453125 144.1488342285156 223.0946655273438"
519" Q 143.9931030273438 225.6849365234375 143.8282470703125 228.1677856445312"
520" Q 143.6633911132812 230.650634765625 143.4898071289062 233.0200805664062"
521" Q 143.3162231445312 235.3894958496094 143.1343078613281 237.6398315429688"
522" Q 142.9524230957031 239.89013671875 142.7626647949219 242.0159301757812"
523" Q 142.5729064941406 244.1417236328125 142.375732421875 246.1378173828125"
524" Q 142.1785583496094 248.1339111328125 141.9744262695312 249.99560546875"
525" Q 141.7703247070312 251.8572387695312 141.5597534179688 253.5799255371094"
526" Q 141.3492126464844 255.3026428222656 141.1326904296875 256.8822326660156"
527" Q 140.9161987304688 258.4617919921875 140.6942749023438 259.8945007324219"
528" Q 140.4723510742188 261.3271789550781 140.2455749511719 262.6095275878906"
529" Q 140.0187683105469 263.8918762207031 139.7876281738281 265.020751953125"
530" Q 139.5564880371094 266.1496276855469 139.3215637207031 267.1223449707031"
531" Q 139.086669921875 268.0950622558594 138.8485412597656 268.9092712402344"
532" Q 138.6104125976562 269.7234497070312 138.36962890625 270.3771667480469"
533" Q 138.1288757324219 271.0308837890625 137.8860473632812 271.5225830078125"
534" Q 137.6432189941406 272.0142822265625 137.3988952636719 272.3427124023438"
535" Q 137.1546020507812 272.6711730957031 136.9093933105469 272.8355712890625"
536" Q 136.6642150878906 272.9999694824219 136.4187316894531 273"
537" Q 136.1732482910156 272.9999694824219 135.9280700683594 272.8355712890625"
538" Q 135.682861328125 272.6711730957031 135.4385681152344 272.3427124023438"
539" Q 135.1942443847656 272.0142822265625 134.951416015625 271.5225830078125"
540" Q 134.7085876464844 271.0308837890625 134.4678344726562 270.3771667480469"
541" Q 134.22705078125 269.7234497070312 133.9889221191406 268.9092407226562"
542" Q 133.7507934570312 268.0950622558594 133.5158996582031 267.122314453125"
543" Q 133.2809753417969 266.1495971679688 133.0498352050781 265.020751953125"
544" Q 132.8186950683594 263.8918762207031 132.5918884277344 262.6095275878906"
545" Q 132.3651123046875 261.3271789550781 132.1431884765625 259.8945007324219"
546" Q 131.9212646484375 258.4617919921875 131.7047729492188 256.8822326660156"
547" Q 131.4882507324219 255.3026428222656 131.2777099609375 253.5799560546875"
548" Q 131.067138671875 251.8572387695312 130.863037109375 249.99560546875"
549" Q 130.6589050292969 248.1339111328125 130.4617309570312 246.1378173828125"
550" Q 130.2645568847656 244.1417236328125 130.0747985839844 242.0159301757812"
551" Q 129.8850402832031 239.89013671875 129.7031555175781 237.6398315429688"
552" Q 129.521240234375 235.3894958496094 129.34765625 233.0200805664062"
553" Q 129.174072265625 230.650634765625 129.0092163085938 228.1677856445312"
554" Q 128.8443603515625 225.6849365234375 128.6886291503906 223.0946655273438"
555" Q 128.5328979492188 220.50439453125 128.3866577148438 217.8129272460938"
556" Q 128.2404174804688 215.1214599609375 128.1040344238281 212.3353271484375"
557" Q 127.9676513671875 209.5491333007812 127.8414306640625 206.6749877929688"
558" Q 127.7152404785156 203.8008422851562 127.5995178222656 200.8456420898438"
559" Q 127.4837951660156 197.8904113769531 127.3788452148438 194.8612365722656"
560" Q 127.2738647460938 191.8320922851562 127.179931640625 188.7362670898438"
561" Q 127.0859985351562 185.6404418945312 127.0032958984375 182.4854431152344"
562" Q 126.9205932617188 179.3304443359375 126.8493347167969 176.1238708496094"
563" Q 126.778076171875 172.9172973632812 126.7184143066406 169.6668090820312"
564" Q 126.6587829589844 166.4163208007812 126.6108703613281 163.1298217773438"
565" Q 126.56298828125 159.8433227539062 126.5269775390625 156.5287170410156"
566" Q 126.4909362792969 153.214111328125 126.4668884277344 149.8793640136719"
567" Q 126.4428100585938 146.5446166992188 126.4307861328125 143.19775390625"
568" Q 126.4187316894531 139.8508911132812 126.4187316894531 136.5"
569" Q 126.4187316894531 133.1491088867188 126.4307861328125 129.8022613525391"
570" Q 126.4428100585938 126.4554138183594 126.4668884277344 123.1206665039062"
571" Q 126.4909362792969 119.7859039306641 126.5269775390625 116.4712829589844"
572" Q 126.56298828125 113.1566619873047 126.6108703613281 109.8701629638672"
573" Q 126.6587829589844 106.5836639404297 126.7184143066406 103.3331909179688"
574" Q 126.778076171875 100.0827331542969 126.8493347167969 96.87612915039062"
575" Q 126.9205932617188 93.66952514648438 127.0032958984375 90.5145263671875"
576" Q 127.0859985351562 87.35951232910156 127.179931640625 84.26370239257812"
577" Q 127.2738647460938 81.16787719726562 127.3788452148438 78.13871765136719"
578" Q 127.4837951660156 75.10955810546875 127.5995178222656 72.15434265136719"
579" Q 127.7152404785156 69.19912719726562 127.8414306640625 66.32498168945312"
580" Q 127.9676513671875 63.45082092285156 128.1040344238281 60.66465759277344"
581" Q 128.2404174804688 57.87849426269531 128.3866577148438 55.18704223632812"
582" Q 128.5328979492188 52.49559020996094 128.6886291503906 49.90530395507812"
583" Q 128.8443603515625 47.31504821777344 129.0092163085938 44.83219909667969"
584" Q 129.174072265625 42.349365234375 129.34765625 39.97991943359375"
585" Q 129.521240234375 37.61048889160156 129.7031555175781 35.36016845703125"
586" Q 129.8850402832031 33.10984802246094 130.0747985839844 30.98406982421875"
587" Q 130.2645568847656 28.85829162597656 130.4617309570312 26.86216735839844"
588" Q 130.6589050292969 24.86604309082031 130.863037109375 23.00439453125"
589" Q 131.067138671875 21.14274597167969 131.2777099609375 19.4200439453125"
590" Q 131.4882507324219 17.69734191894531 131.7047729492188 16.11775207519531"
591" Q 131.9212646484375 14.53814697265625 132.1431884765625 13.10545349121094"
592" Q 132.3651123046875 11.67277526855469 132.5918884277344 10.39044189453125"
593" Q 132.8186950683594 9.108108520507812 133.0498352050781 7.979232788085938"
594" Q 133.2809753417969 6.850357055664062 133.5158996582031 5.877639770507812"
595" Q 133.7507934570312 4.904937744140625 133.9889221191406 4.090728759765625"
596" Q 134.22705078125 3.276535034179688 134.4678344726562 2.622810363769531"
597" Q 134.7085876464844 1.969085693359375 134.951416015625 1.477409362792969"
598" Q 135.1942443847656 0.9857254028320312 135.4385681152344 0.65728759765625"
599" Q 135.682861328125 0.3288421630859375 135.9280700683594 0.1644210815429688"
600" Q 136.1732482910156 0 136.4187316894531 0"
601" Q 136.6642150878906 0 136.9093933105469 0.1644210815429688"
602" Q 137.1546020507812 0.3288421630859375 137.3988952636719 0.65728759765625"
603" Q 137.6432189941406 0.9857254028320312 137.8860473632812 1.477409362792969"
604" Q 138.1288757324219 1.969085693359375 138.36962890625 2.622810363769531"
605" Q 138.6104125976562 3.276535034179688 138.8485412597656 4.090728759765625"
606" Q 139.086669921875 4.904937744140625 139.3215637207031 5.877639770507812"
607" Q 139.5564880371094 6.850357055664062 139.7876281738281 7.979232788085938"
608" Q 140.0187683105469 9.108108520507812 140.2455749511719 10.39044189453125"
609" Q 140.4723510742188 11.67277526855469 140.6942749023438 13.10545349121094"
610" Q 140.9161987304688 14.53814697265625 141.1326904296875 16.11775207519531"
611" Q 141.3492126464844 17.69734191894531 141.5597534179688 19.4200439453125"
612" Q 141.7703247070312 21.14274597167969 141.9744262695312 23.00439453125"
613" Q 142.1785583496094 24.86604309082031 142.375732421875 26.86216735839844"
614" Q 142.5729064941406 28.85829162597656 142.7626647949219 30.98406982421875"
615" Q 142.9524230957031 33.10984802246094 143.1343078613281 35.36016845703125"
616" Q 143.3162231445312 37.61048889160156 143.4898071289062 39.97991943359375"
617" Q 143.6633911132812 42.349365234375 143.8282470703125 44.83219909667969"
618" Q 143.9931030273438 47.31504821777344 144.1488342285156 49.90531921386719"
619" Q 144.3045654296875 52.49559020996094 144.4508056640625 55.18704223632812"
620" Q 144.5970458984375 57.87849426269531 144.7334289550781 60.66465759277344"
621" Q 144.8698120117188 63.45082092285156 144.9960021972656 66.32498168945312"
622" Q 145.1222229003906 69.19912719726562 145.2379455566406 72.15434265136719"
623" Q 145.3536682128906 75.10955810546875 145.4586181640625 78.13871765136719"
624" Q 145.5635681152344 81.16787719726562 145.6575317382812 84.26370239257812"
625" Q 145.75146484375 87.35951232910156 145.8341674804688 90.5145263671875"
626" Q 145.9168701171875 93.66952514648438 145.9881286621094 96.87614440917969"
627" Q 146.0593872070312 100.0827331542969 146.1190490722656 103.3332061767578"
628" Q 146.1786804199219 106.5836639404297 146.2265930175781 109.8701629638672"
629" Q 146.2744750976562 113.1566619873047 146.3104858398438 116.4712829589844"
630" Q 146.3465270996094 119.785888671875 146.3705749511719 123.1206665039062"
631" Q 146.3946533203125 126.4554138183594 146.4066772460938 129.8022613525391"
632" Q 146.4187316894531 133.1491088867188 146.4187316894531 136.5 Z";
647 OvalSet set = {{0, 0, 0, 0}, 2, 3, 9, 100, 100};
static void testOne(skiatest::Reporter *reporter, const OvalSet &set)
DEF_TEST(SixtyOvals, reporter)
struct OvalSetOneOff oneOffs[]
static void testOvalSet(const OvalSet &set, const SkPath &oval, SkOpBuilder *builder, SkRegion *region, SkPath *result)
static DEFINE_int(processOffset, 0, "Offset the test by this value. This permits multiple processes " "to exercise the same test in parallel with different test values.")
static void setupOne(skiatest::Reporter *reporter, int col, int row, int rot, int trial)
const char ovalsAsQuads[]
static void oneOff(skiatest::Reporter *reporter, const ConicPts &conic1, const ConicPts &conic2, bool coin)
bool testSimplify(SkPath &path, bool useXor, SkPath &out, PathOpsThreadState &state, const char *pathStr)
int comparePaths(skiatest::Reporter *reporter, const char *filename, const SkPath &one, const SkPath &two, SkBitmap &bitmap)
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static float SkBits2Float(uint32_t bits)
@ kUnion_SkPathOp
union (inclusive-or) the two paths
bool SK_API Simplify(const SkPath &path, SkPath *result)
static bool FromSVGString(const char str[], SkPath *)
SkScalar nextRangeScalar(SkScalar min, SkScalar max)
void setSeed(uint32_t seed)
bool getBoundaryPath(SkPath *path) const
@ kUnion_Op
target unioned with operand
bool op(const SkIRect &rect, Op op)
bool setRect(const SkIRect &rect)
bool setPath(const SkPath &path, const SkRegion &clip)
unsigned useCenter Optional< SkMatrix > matrix
ClipOpAndAA opAA SkRegion region
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not set