58#include <initializer_list>
64 radii[index].
set(rad, rad);
82 path.quadTo(20, 50, 80, 50);
83 path.quadTo(20, 50, 20, 80);
92 const float rad = 33436320;
98 for (
int i = 0;
i < 4; ++
i) {
107 path->moveTo(3.747501373f, 2.724499941f);
108 path->lineTo(3.747501373f, 3.75f);
109 path->cubicTo(3.747501373f, 3.88774991f, 3.635501385f, 4.0f, 3.497501373f, 4.0f);
110 path->lineTo(0.7475013733f, 4.0f);
111 path->cubicTo(0.6095013618f, 4.0f, 0.4975013733f, 3.88774991f, 0.4975013733f, 3.75f);
112 path->lineTo(0.4975013733f, 1.0f);
113 path->cubicTo(0.4975013733f, 0.8622499704f, 0.6095013618f, 0.75f, 0.7475013733f,0.75f);
114 path->lineTo(3.497501373f, 0.75f);
115 path->cubicTo(3.50275135f, 0.75f, 3.5070014f, 0.7527500391f, 3.513001442f, 0.753000021f);
116 path->lineTo(3.715001345f, 0.5512499809f);
117 path->cubicTo(3.648251295f, 0.5194999576f, 3.575501442f, 0.4999999702f, 3.497501373f, 0.4999999702f);
118 path->lineTo(0.7475013733f, 0.4999999702f);
119 path->cubicTo(0.4715013802f, 0.4999999702f, 0.2475013733f, 0.7239999771f, 0.2475013733f, 1.0f);
120 path->lineTo(0.2475013733f, 3.75f);
121 path->cubicTo(0.2475013733f, 4.026000023f, 0.4715013504f, 4.25f, 0.7475013733f, 4.25f);
122 path->lineTo(3.497501373f, 4.25f);
123 path->cubicTo(3.773501396f, 4.25f, 3.997501373f, 4.026000023f, 3.997501373f, 3.75f);
124 path->lineTo(3.997501373f, 2.474750042f);
125 path->lineTo(3.747501373f, 2.724499941f);
130 path->moveTo(3.747501373f, 2.724499941f);
131 path->cubicTo(3.648251295f, 0.5194999576f, 3.575501442f, 0.4999999702f, 3.497501373f, 0.4999999702f);
140 path.moveTo(-540000, -720000);
141 path.lineTo(-9.10000017e-05f, 9.99999996e-13f);
157 path.moveTo(-478.805145f, 153.862549f);
158 path.lineTo(6.27216804e+19f, 6.27216804e+19f);
159 path.lineTo(-666.754272f, 155.086304f);
184 paint.setAntiAlias(
true);
226 paint.setAntiAlias(
true);
287 path->cubicTo(p1, p2, p3);
312 path->moveTo(146.939f, 1012.84f);
313 path->lineTo(181.747f, 1009.18f);
314 path->lineTo(182.165f, 1013.16f);
315 path->lineTo(147.357f, 1016.82f);
316 path->lineTo(146.939f, 1012.84f);
340 clip.setRect({0, 0, 1255, 1925});
348 path.toggleInverseFillType();
353#ifdef SK_BUILD_FOR_WIN
354 #define SUPPRESS_VISIBILITY_WARNING
356 #define SUPPRESS_VISIBILITY_WARNING __attribute__((visibility("hidden")))
366 path.rLineTo(0, 100);
367 path.rLineTo(100, 0);
369 path.rLineTo(50, 50);
371 path.getLastPt(&last);
377 path.rLineTo(0, 100);
378 path.rLineTo(100, 0);
380 path.rQuadTo(50, 50, 75, 75);
382 path.getLastPt(&last);
388 path.rLineTo(0, 100);
389 path.rLineTo(100, 0);
391 path.rConicTo(50, 50, 85, 85, 2);
393 path.getLastPt(&last);
399 path.rLineTo(0, 100);
400 path.rLineTo(100, 0);
402 path.rCubicTo(50, 50, 85, 85, 95, 95);
404 path.getLastPt(&last);
414 const uint32_t z =
a.getGenerationID();
421 const uint32_t
y =
a.getGenerationID();
425 const uint32_t
x =
b.getGenerationID();
443#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
444 static bool kExpectGenIDToIgnoreFill =
false;
446 static bool kExpectGenIDToIgnoreFill =
true;
460 path.moveTo(13.8509f, 3.16858f);
461 path.cubicTo(-2.35893e+08f, -4.21044e+08f,
462 -2.38991e+08f, -4.26573e+08f,
463 -2.41016e+08f, -4.30188e+08f);
469 { 4595.91064f, -11596.9873f },
470 { 4597.2168f, -11595.9414f },
471 { 4598.52344f, -11594.8955f },
472 { 4599.83008f, -11593.8496f },
477 path.cubicTo(pts[1], pts[2], pts[3]);
481 paint.setStrokeWidth(20);
490 path.moveTo(17.9459f, 21.6344f);
491 path.lineTo(139.545f, -47.8105f);
492 path.lineTo(139.545f, -47.8105f);
493 path.lineTo(131.07f, -47.3888f);
494 path.lineTo(131.07f, -47.3888f);
495 path.lineTo(122.586f, -46.9532f);
496 path.lineTo(122.586f, -46.9532f);
497 path.lineTo(18076.6f, 31390.9f);
498 path.lineTo(18076.6f, 31390.9f);
499 path.lineTo(18085.1f, 31390.5f);
500 path.lineTo(18085.1f, 31390.5f);
501 path.lineTo(18076.6f, 31390.9f);
502 path.lineTo(18076.6f, 31390.9f);
503 path.lineTo(17955, 31460.3f);
504 path.lineTo(17955, 31460.3f);
505 path.lineTo(17963.5f, 31459.9f);
506 path.lineTo(17963.5f, 31459.9f);
507 path.lineTo(17971.9f, 31459.5f);
508 path.lineTo(17971.9f, 31459.5f);
509 path.lineTo(17.9551f, 21.6205f);
510 path.lineTo(17.9551f, 21.6205f);
511 path.lineTo(9.47091f, 22.0561f);
512 path.lineTo(9.47091f, 22.0561f);
513 path.lineTo(17.9459f, 21.6344f);
514 path.lineTo(17.9459f, 21.6344f);
515 path.close();
path.moveTo(0.995934f, 22.4779f);
516 path.lineTo(0.986725f, 22.4918f);
517 path.lineTo(0.986725f, 22.4918f);
518 path.lineTo(17955, 31460.4f);
519 path.lineTo(17955, 31460.4f);
520 path.lineTo(17971.9f, 31459.5f);
521 path.lineTo(17971.9f, 31459.5f);
522 path.lineTo(18093.6f, 31390.1f);
523 path.lineTo(18093.6f, 31390.1f);
524 path.lineTo(18093.6f, 31390);
525 path.lineTo(18093.6f, 31390);
526 path.lineTo(139.555f, -47.8244f);
527 path.lineTo(139.555f, -47.8244f);
528 path.lineTo(122.595f, -46.9671f);
529 path.lineTo(122.595f, -46.9671f);
530 path.lineTo(0.995934f, 22.4779f);
531 path.lineTo(0.995934f, 22.4779f);
533 path.moveTo(5.43941f, 25.5223f);
534 path.lineTo(798267, -28871.1f);
535 path.lineTo(798267, -28871.1f);
536 path.lineTo(3.12512e+06f, -113102);
537 path.lineTo(3.12512e+06f, -113102);
538 path.cubicTo(5.16324e+06f, -186882, 8.15247e+06f, -295092, 1.1957e+07f, -432813);
539 path.cubicTo(1.95659e+07f, -708257, 3.04359e+07f, -1.10175e+06f, 4.34798e+07f, -1.57394e+06f);
540 path.cubicTo(6.95677e+07f, -2.51831e+06f, 1.04352e+08f, -3.77748e+06f, 1.39135e+08f, -5.03666e+06f);
541 path.cubicTo(1.73919e+08f, -6.29583e+06f, 2.08703e+08f, -7.555e+06f, 2.34791e+08f, -8.49938e+06f);
542 path.cubicTo(2.47835e+08f, -8.97157e+06f, 2.58705e+08f, -9.36506e+06f, 2.66314e+08f, -9.6405e+06f);
543 path.cubicTo(2.70118e+08f, -9.77823e+06f, 2.73108e+08f, -9.88644e+06f, 2.75146e+08f, -9.96022e+06f);
544 path.cubicTo(2.76165e+08f, -9.99711e+06f, 2.76946e+08f, -1.00254e+07f, 2.77473e+08f, -1.00444e+07f);
545 path.lineTo(2.78271e+08f, -1.00733e+07f);
546 path.lineTo(2.78271e+08f, -1.00733e+07f);
547 path.cubicTo(2.78271e+08f, -1.00733e+07f, 2.08703e+08f, -7.555e+06f, 135.238f, 23.3517f);
548 path.cubicTo(131.191f, 23.4981f, 125.995f, 23.7976f, 123.631f, 24.0206f);
549 path.cubicTo(121.267f, 24.2436f, 122.631f, 24.3056f, 126.677f, 24.1591f);
550 path.cubicTo(2.08703e+08f, -7.555e+06f, 2.78271e+08f, -1.00733e+07f, 2.78271e+08f, -1.00733e+07f);
551 path.lineTo(2.77473e+08f, -1.00444e+07f);
552 path.lineTo(2.77473e+08f, -1.00444e+07f);
553 path.cubicTo(2.76946e+08f, -1.00254e+07f, 2.76165e+08f, -9.99711e+06f, 2.75146e+08f, -9.96022e+06f);
554 path.cubicTo(2.73108e+08f, -9.88644e+06f, 2.70118e+08f, -9.77823e+06f, 2.66314e+08f, -9.6405e+06f);
555 path.cubicTo(2.58705e+08f, -9.36506e+06f, 2.47835e+08f, -8.97157e+06f, 2.34791e+08f, -8.49938e+06f);
556 path.cubicTo(2.08703e+08f, -7.555e+06f, 1.73919e+08f, -6.29583e+06f, 1.39135e+08f, -5.03666e+06f);
557 path.cubicTo(1.04352e+08f, -3.77749e+06f, 6.95677e+07f, -2.51831e+06f, 4.34798e+07f, -1.57394e+06f);
558 path.cubicTo(3.04359e+07f, -1.10175e+06f, 1.95659e+07f, -708258, 1.1957e+07f, -432814);
559 path.cubicTo(8.15248e+06f, -295092, 5.16324e+06f, -186883, 3.12513e+06f, -113103);
560 path.lineTo(798284, -28872);
561 path.lineTo(798284, -28872);
562 path.lineTo(22.4044f, 24.6677f);
563 path.lineTo(22.4044f, 24.6677f);
564 path.cubicTo(22.5186f, 24.5432f, 18.8134f, 24.6337f, 14.1287f, 24.8697f);
565 path.cubicTo(9.4439f, 25.1057f, 5.55359f, 25.3978f, 5.43941f, 25.5223f);
570 path.moveTo(126.677f, 24.1591f);
571 path.cubicTo(2.08703e+08f, -7.555e+06f, 2.78271e+08f, -1.00733e+07f, 2.78271e+08f, -1.00733e+07f);
591 bool smallConvex = smallPath.
isConvex();
596 matrix.preTranslate(100, 100);
599 bool largeConvex = largePath.
isConvex();
604 const char reducedCase[] =
612 const char originalFiddleData[] =
613 "M-0.3383152268862998,-0.11217565719203619L-0.33846085183212765,-0.11212264406895281"
614 "L-0.338509393480737,-0.11210607966681395L-0.33857792286700894,-0.1121889121487573"
615 "L-0.3383866116636664,-0.11228834570924921L-0.33842087635680235,-0.11246078673250548"
616 "L-0.33809536177201055,-0.11245415228342878L-0.33797257995493996,-0.11216571641452182"
617 "L-0.33802112160354925,-0.11201996164188659L-0.33819815585141844,-0.11218559834671019Z";
623 const char originalFiddleData[] =
624 "M-0.34004273849857214,-0.11332803232216355L-0.34008271397389744,-0.11324483772714951"
625 "L-0.3401940742265893,-0.11324483772714951L-0.34017694188002134,-0.11329807920275889"
626 "L-0.3402026403998733,-0.11333468903941245L-0.34029972369709194,-0.11334134592705701"
627 "L-0.3403054344792813,-0.11344121970007795L-0.3403140006525653,-0.11351115418399343"
628 "L-0.34024261587519866,-0.11353446986281181L-0.3402197727464413,-0.11360442946144192"
629 "L-0.34013696640469604,-0.11359110237029302L-0.34009128014718143,-0.1135877707043939"
630 "L-0.3400598708451401,-0.11360776134112742L-0.34004273849857214,-0.11355112520064405"
631 "L-0.3400113291965308,-0.11355112520064405L-0.3399970522410575,-0.11359110237029302"
632 "L-0.33997135372120546,-0.11355112520064405L-0.3399627875479215,-0.11353780084493197"
633 "L-0.3399485105924481,-0.11350782354357004L-0.3400027630232468,-0.11346452910331437"
634 "L-0.3399485105924481,-0.11340126558629839L-0.33993994441916414,-0.11340126558629839"
635 "L-0.33988283659727087,-0.11331804756574679L-0.33989140277055485,-0.11324483772714951"
636 "L-0.33997991989448945,-0.11324483772714951L-0.3399856306766788,-0.11324483772714951"
637 "L-0.34002560615200417,-0.11334467443478255ZM-0.3400684370184241,-0.11338461985124307"
638 "L-0.340154098751264,-0.11341791238732665L-0.340162664924548,-0.1134378899559977"
639 "L-0.34017979727111597,-0.11340126558629839L-0.3401655203156427,-0.11338129083212668"
640 "L-0.34012268944922275,-0.11332137577529414L-0.34007414780061346,-0.11334467443478255Z"
641 "M-0.3400027630232468,-0.11290567901106024L-0.3400113291965308,-0.11298876531245433"
642 "L-0.33997991989448945,-0.11301535852306784L-0.33990282433493346,-0.11296217481488612"
643 "L-0.33993994441916414,-0.11288906492739594Z";
650 path.conicTo(-6.62478e-08f, 4.13885e-08f, -6.36935e-08f, 3.97927e-08f, 0.729058f);
651 path.quadTo(2.28206e-09f, -1.42572e-09f, 3.91919e-09f, -2.44852e-09f);
652 path.cubicTo(-16752.2f, -26792.9f, -21.4673f, 10.9347f, -8.57322f, -7.22739f);
656 path.contains(-1.84817e-08f, 1.15465e-08f);
666 path.lineTo(FLT_EPSILON, FLT_EPSILON);
671 path.quadTo(0, 0, 0, 0);
676 path.conicTo(0, 0, 0, 0, 0.5f);
681 path.cubicTo(0, 0, 0, 0, 0, 0);
709 path->moveTo(577330, 1971.72f);
710 path->cubicTo(10.7082f, -116.596f, 262.057f, 45.6468f, 294.694f, 1.96237f);
712 path->moveTo(60.1631f, 7.70567f);
713 path->quadTo(60.1631f, 7.70567f, 0.99474f, 0.901199f);
714 path->lineTo(577379, 1977.77f);
715 path->quadTo(577364, 1979.57f, 577325, 1980.26f);
716 path->quadTo(577286, 1980.95f, 577245, 1980.13f);
717 path->quadTo(577205, 1979.3f, 577187, 1977.45f);
718 path->quadTo(577168, 1975.6f, 577183, 1973.8f);
719 path->quadTo(577198, 1972, 577238, 1971.31f);
720 path->quadTo(577277, 1970.62f, 577317, 1971.45f);
721 path->quadTo(577330, 1971.72f, 577341, 1972.11f);
722 path->cubicTo(10.7082f, -116.596f, 262.057f, 45.6468f, 294.694f, 1.96237f);
723 path->moveTo(306.718f, -32.912f);
724 path->cubicTo(30.531f, 10.0005f, 1502.47f, 13.2804f, 84.3088f, 9.99601f);
735 for (
int doReducedCase = 0; doReducedCase <= 1; ++doReducedCase) {
739 for (
int doAA = 0; doAA <= 1; ++doAA) {
748 ERRORF(
reporter,
"path.getBounds() returned [%g %g %g %g], but expected [%g %g %g %g]",
786 path.conicTo(3.58732e-43f, 2.72084f, 3.00392f, 3.00392f, 8.46e+37f);
804 path.cubicTo(pts[1], pts[2], pts[3]);
812 path.quadTo(157, 366, 286, 208);
813 path.arcTo(37, 442, 315, 163, 957494590897113.0f);
816 matrix.setScale(1000*1000, 1000*1000);
822 while (
path.isFinite()) {
845 arcRect.
setLTRB(-rx, -ry, rx, ry);
884 for (
int i = 0;
i < 5000; ++
i) {
911 for (
int i = 0;
i < 5000; ++
i) {
982 path.moveTo(inf, negInf);
1002 path.lineTo(100, 100);
1004 path.moveTo(200, 200);
1020 const SkPoint srcPts[],
bool expectClose) {
1021 bool firstTime =
true;
1022 bool foundClose =
false;
1065 for (
int doClose = 0; doClose <= 1; ++doClose) {
1119 static const char* gDegen[] = {
1123 "M 10 10 L 10 10 L 10 10",
1124 "M 10 10 Q 10 10 10 10",
1125 "M 10 10 C 10 10 10 10 10 10",
1135 static const char* gCW[] = {
1136 "M 10 10 L 10 10 Q 20 10 20 20",
1137 "M 10 10 C 20 10 20 20 20 20",
1138 "M 20 10 Q 20 20 30 20 L 10 20",
1141 "M 10 10 C 10 0 10 0 20 0 L 40 0 C 50 0 50 0 50 10",
1142 "M 20 10 L 0 10 Q 10 10 20 0",
1151 static const char* gCCW[] = {
1152 "M 10 10 L 10 10 Q 20 10 20 -20",
1153 "M 10 10 C 20 10 20 -20 20 -20",
1154 "M 20 10 Q 20 20 10 20 L 30 20",
1157 "M 50 10 C 50 0 50 0 40 0 L 20 0 C 10 0 10 0 10 10",
1158 "M 10 10 L 30 10 Q 20 10 10 0",
1188 path.conicTo(20, 0, 20, 20, 0.5f);
1193 path.lineTo(1, 1e7f);
1194 path.lineTo(1e7f, 2e7f);
1209 static const SkRect rects[] = {
1227 path.moveTo(pts[0]);
1228 path.cubicTo(pts[1], pts[2], pts[3]);
1253 { 372.0007f, 92.000755f },
1254 { 371.99927f, 92.003922f },
1255 { 371.99826f, 92.003899f },
1262 for (
int i = 0;
i < 2; ++
i) {
1358 bool expectedConvexity) {
1361 bool convexity =
copy.isConvex();
1366 SkPath tinyConvexPolygon;
1367 tinyConvexPolygon.
moveTo(600.131559f, 800.112512f);
1368 tinyConvexPolygon.
lineTo(600.161735f, 800.118627f);
1369 tinyConvexPolygon.
lineTo(600.148962f, 800.142338f);
1370 tinyConvexPolygon.
lineTo(600.134891f, 800.137724f);
1371 tinyConvexPolygon.
close();
1376 platTriangle.
moveTo(0, 0);
1377 platTriangle.
lineTo(200, 0);
1378 platTriangle.
lineTo(100, 0.04f);
1379 platTriangle.
close();
1383 platTriangle.
reset();
1384 platTriangle.
moveTo(0, 0);
1385 platTriangle.
lineTo(200, 0);
1386 platTriangle.
lineTo(100, 0.03f);
1387 platTriangle.
close();
1432 redundantSquare.
moveTo(0, 0);
1433 redundantSquare.
lineTo(0, 0);
1434 redundantSquare.
lineTo(0, 0);
1444 redundantSquare.
close();
1489 for (
int i = 0;
i < 2000;
i++) {
1500 stroke.applyToPath(&strokedSin, strokedSin);
1505 SkPath degenerateConcave;
1506 degenerateConcave.
moveTo(148.67912f, 191.875f);
1507 degenerateConcave.
lineTo(470.37695f, 7.5f);
1508 degenerateConcave.
lineTo(148.67912f, 191.875f);
1509 degenerateConcave.
lineTo(41.446522f, 376.25f);
1510 degenerateConcave.
lineTo(-55.971577f, 460.0f);
1511 degenerateConcave.
lineTo(41.446522f, 376.25f);
1517 badFirstVector.
moveTo(501.087708f, 319.610352f);
1518 badFirstVector.
lineTo(501.087708f, 319.610352f);
1519 badFirstVector.
cubicTo(501.087677f, 319.610321f, 449.271606f, 258.078674f, 395.084564f, 198.711182f);
1520 badFirstVector.
cubicTo(358.967072f, 159.140717f, 321.910553f, 120.650436f, 298.442322f, 101.955399f);
1521 badFirstVector.
lineTo(301.557678f, 98.044601f);
1522 badFirstVector.
cubicTo(325.283844f, 116.945084f, 362.615204f, 155.720825f, 398.777557f, 195.340454f);
1523 badFirstVector.
cubicTo(453.031860f, 254.781662f, 504.912262f, 316.389618f, 504.912292f, 316.389648f);
1524 badFirstVector.
lineTo(504.912292f, 316.389648f);
1525 badFirstVector.
lineTo(501.087708f, 319.610352f);
1526 badFirstVector.
close();
1531 falseBackEdge.
moveTo(-217.83430557928145f, -382.14948768484857f);
1532 falseBackEdge.
lineTo(-227.73867866614847f, -399.52485512718323f);
1533 falseBackEdge.
cubicTo(-158.3541047666846f, -439.0757140459542f,
1534 -79.8654464485281f, -459.875f,
1535 -1.1368683772161603e-13f, -459.875f);
1536 falseBackEdge.
lineTo(-8.08037266162413e-14f, -439.875f);
1537 falseBackEdge.
lineTo(-8.526512829121202e-14f, -439.87499999999994f);
1538 falseBackEdge.
cubicTo(-76.39209188702645f, -439.87499999999994f,
1539 -151.46727226799754f, -419.98027663161537f,
1540 -217.83430557928145f, -382.14948768484857f);
1541 falseBackEdge.
close();
1559 doubleback.
quadTo(1, 1, 2, 2);
1562 doubleback.
quadTo(1, 0, 2, 0);
1564 doubleback.
quadTo(1, 0, 0, 0);
1576 doubleback.
lineTo(-1, 0);
1577 doubleback.
lineTo(-1, 1);
1578 doubleback.
lineTo(-1, 0);
1581 for (
int i = 0;
i < 4; ++
i) {
1585 doubleback.
lineTo(-1, -1);
1600 doubleback.
lineTo(-1, -1);
1627 if (
nullptr == str) {
1661 path.quadTo(100, 100, 50, 50);
1664 static const struct {
1665 const char* fPathStr;
1666 bool fExpectedIsConvex;
1715 static const SkPoint axisAlignedPts[] = {
1722 const size_t axisAlignedPtsCount =
sizeof(axisAlignedPts) /
sizeof(axisAlignedPts[0]);
1726 int f = (
int) (index % axisAlignedPtsCount);
1727 int g = (
int) ((
f + 1) % axisAlignedPtsCount);
1729 switch (index % 13) {
1748 for (
int index = 0; index < (
int) (11 * axisAlignedPtsCount); ++index) {
1749 int f = (
int) (index % axisAlignedPtsCount);
1750 int g = (
int) ((
f + 1) % axisAlignedPtsCount);
1752 int curveSelect = index % 11;
1753 switch (curveSelect) {
1754 case 0:
path.moveTo(axisAlignedPts[
f]);
break;
1755 case 1:
path.lineTo(axisAlignedPts[
f]);
break;
1756 case 2:
path.quadTo(axisAlignedPts[
f], axisAlignedPts[
f]);
break;
1757 case 3:
path.quadTo(axisAlignedPts[
f], axisAlignedPts[g]);
break;
1758 case 4:
path.quadTo(axisAlignedPts[g], axisAlignedPts[
f]);
break;
1759 case 5:
path.cubicTo(axisAlignedPts[
f], axisAlignedPts[
f], axisAlignedPts[
f]);
break;
1760 case 6:
path.cubicTo(axisAlignedPts[
f], axisAlignedPts[
f], axisAlignedPts[g]);
break;
1761 case 7:
path.cubicTo(axisAlignedPts[
f], axisAlignedPts[g], axisAlignedPts[
f]);
break;
1762 case 8:
path.cubicTo(axisAlignedPts[
f], axisAlignedPts[g], axisAlignedPts[g]);
break;
1763 case 9:
path.cubicTo(axisAlignedPts[g], axisAlignedPts[
f], axisAlignedPts[
f]);
break;
1764 case 10:
path.cubicTo(axisAlignedPts[g], axisAlignedPts[
f], axisAlignedPts[g]);
break;
1766 if (curveSelect == 0 || curveSelect == 1 || curveSelect == 2 || curveSelect == 5) {
1775 static const SkPoint diagonalPts[] = {
1780 const size_t diagonalPtsCount =
sizeof(diagonalPts) /
sizeof(diagonalPts[0]);
1782 for (
int index = 0; index < (
int) (7 * diagonalPtsCount); ++index) {
1783 int f = (
int) (index % diagonalPtsCount);
1784 int g = (
int) ((
f + 1) % diagonalPtsCount);
1786 int curveSelect = index % 11;
1787 switch (curveSelect) {
1788 case 0:
path.moveTo(diagonalPts[
f]);
break;
1789 case 1:
path.lineTo(diagonalPts[
f]);
break;
1790 case 2:
path.quadTo(diagonalPts[
f], diagonalPts[
f]);
break;
1791 case 3:
path.quadTo(axisAlignedPts[
f], diagonalPts[g]);
break;
1792 case 4:
path.quadTo(diagonalPts[g], axisAlignedPts[
f]);
break;
1793 case 5:
path.cubicTo(diagonalPts[
f], diagonalPts[
f], diagonalPts[
f]);
break;
1794 case 6:
path.cubicTo(diagonalPts[
f], diagonalPts[
f], axisAlignedPts[g]);
break;
1795 case 7:
path.cubicTo(diagonalPts[
f], axisAlignedPts[g], diagonalPts[
f]);
break;
1796 case 8:
path.cubicTo(axisAlignedPts[
f], diagonalPts[g], diagonalPts[g]);
break;
1797 case 9:
path.cubicTo(diagonalPts[g], diagonalPts[
f], axisAlignedPts[
f]);
break;
1798 case 10:
path.cubicTo(diagonalPts[g], axisAlignedPts[
f], diagonalPts[g]);
break;
1800 if (curveSelect == 0) {
1841 path.moveTo(moveX, moveY);
1852 path.lineTo(lineX, lineY);
1868 path.quadTo(1, 1, 2, 2);
1880 circleR *= 1.75f / 2;
1893 {kBaseRect,
true,
true,
false,
false},
1900 true,
true,
true,
true},
1905 false,
true,
false,
false},
1908 false,
true,
false,
false},
1911 false,
true,
false,
false},
1914 false,
true,
false,
false},
1917 false,
true,
false,
false},
1920 false,
true,
false,
false},
1923 false,
true,
false,
false},
1934 false,
false,
false,
false},
1940 false,
false,
false,
false},
1945 true,
true,
true,
true},
1949 true,
true,
true,
true},
1954 false,
true,
false,
false},
1959 false,
true,
false,
false},
1963 for (
size_t q = 0; q <
std::size(kQueries); ++q) {
1964 SkRect qRect = kQueries[q].fQueryRect;
1973 for (
int d = 0;
d < 2; ++
d) {
1978 path.conservativelyContainsRect(qRect));
1981 path.addCircle(kCircleC.
fX, kCircleC.
fY, circleR,
dir);
1983 path.conservativelyContainsRect(qRect));
1986 path.addRoundRect(kBaseRect, kRRRadii[0], kRRRadii[1],
dir);
1988 path.conservativelyContainsRect(qRect));
1992 path.cubicTo(kBaseRect.
fLeft + kRRRadii[0] / 2, kBaseRect.
fTop,
1993 kBaseRect.
fLeft, kBaseRect.
fTop + kRRRadii[1] / 2,
1994 kBaseRect.
fLeft, kBaseRect.
fTop + kRRRadii[1]);
2000 path.conservativelyContainsRect(qRect));
2052 path.moveTo(100, 100);
2069 path.moveTo(100, 100);
2091 path.lineTo(100, 100);
2102 path.moveTo(50, 50);
2103 path.cubicTo(0, 0, 100, 0, 50, 50);
2110 path.moveTo(50, 50);
2111 path.quadTo(100, 100, 50, 50);
2120 path.moveTo(0, 0);
path.lineTo(1, 0);
path.lineTo(1, 1);
path.lineTo(0, 1);
2133 SkPoint r1[] = {{0, 0}, {1, 0}, {1, 1}, {0, 1}};
2134 SkPoint r2[] = {{1, 0}, {1, 1}, {0, 1}, {0, 0}};
2135 SkPoint r3[] = {{1, 1}, {0, 1}, {0, 0}, {1, 0}};
2136 SkPoint r4[] = {{0, 1}, {0, 0}, {1, 0}, {1, 1}};
2137 SkPoint r5[] = {{0, 0}, {0, 1}, {1, 1}, {1, 0}};
2138 SkPoint r6[] = {{0, 1}, {1, 1}, {1, 0}, {0, 0}};
2139 SkPoint r7[] = {{1, 1}, {1, 0}, {0, 0}, {0, 1}};
2140 SkPoint r8[] = {{1, 0}, {0, 0}, {0, 1}, {1, 1}};
2141 SkPoint r9[] = {{0, 1}, {1, 1}, {1, 0}, {0, 0}};
2142 SkPoint ra[] = {{0, 0}, {0, .5f}, {0, 1}, {.5f, 1}, {1, 1}, {1, .5f}, {1, 0}, {.5f, 0}};
2143 SkPoint rb[] = {{0, 0}, {.5f, 0}, {1, 0}, {1, .5f}, {1, 1}, {.5f, 1}, {0, 1}, {0, .5f}};
2144 SkPoint rc[] = {{0, 0}, {1, 0}, {1, 1}, {0, 1}, {0, 0}};
2145 SkPoint rd[] = {{0, 0}, {0, 1}, {1, 1}, {1, 0}, {0, 0}};
2146 SkPoint re[] = {{0, 0}, {1, 0}, {1, 0}, {1, 1}, {0, 1}};
2147 SkPoint rf[] = {{1, 0}, {8, 0}, {8, 8}, {0, 8}, {0, 0}};
2150 SkPoint f1[] = {{0, 0}, {1, 0}, {1, 1}};
2151 SkPoint f2[] = {{0, 0}, {1, 1}, {0, 1}, {1, 0}};
2152 SkPoint f3[] = {{0, 0}, {1, 0}, {1, 1}, {0, 1}, {0, 0}, {1, 0}};
2153 SkPoint f4[] = {{0, 0}, {1, 0}, {0, 0}, {1, 0}, {1, 1}, {0, 1}};
2154 SkPoint f5[] = {{0, 0}, {1, 0}, {1, 1}, {2, 0}};
2155 SkPoint f6[] = {{0, 0}, {1, 0}, {1, 1}, {0, 1}, {0, 2}};
2156 SkPoint f7[] = {{0, 0}, {1, 0}, {1, 1}, {0, 2}};
2157 SkPoint f8[] = {{0, 0}, {1, 0}, {1, 1}, {1, 0}};
2158 SkPoint f9[] = {{1, 0}, {8, 0}, {8, 8}, {0, 8}, {0, 0}, {2, 0}};
2159 SkPoint fa[] = {{1, 0}, {8, 0}, {8, 8}, {0, 8}, {0, -1}, {1, -1}};
2160 SkPoint fb[] = {{1, 0}, {8, 0}, {8, 8}, {0, 8}, {0, 1}};
2163 SkPoint c1[] = {{0, 0}, {1, 0}, {1, 1}, {0, 1}};
2164 SkPoint c2[] = {{0, 0}, {1, 0}, {1, 2}, {0, 2}, {0, 1}};
2165 SkPoint c3[] = {{0, 0}, {1, 0}, {1, 2}, {0, 2}, {0, 1}, {0, 0}};
2168 SkPoint d1[] = {{0, 0}, {1, 0}, {1, 2}, {0, 2}, {0, 1}, {0, 2}};
2170 SkPoint d2[] = {{0, 0}, {1, 0}, {1, 2}, {0, 2}, {0, -1}};
2171 SkPoint d3[] = {{0, 0}, {1, 0}, {1, 2}, {0, 2}, {0, -1}, {0, 0}};
2218 for (
size_t testIndex = 0; testIndex <
testCount; ++testIndex) {
2220 path.moveTo(
tests[testIndex].fPoints[0].fX,
tests[testIndex].fPoints[0].fY);
2221 for (index = 1; index <
tests[testIndex].fPointCount; ++index) {
2222 path.lineTo(
tests[testIndex].fPoints[index].fX,
tests[testIndex].fPoints[index].fY);
2224 if (
tests[testIndex].fClose) {
2229 if (
tests[testIndex].fIsRect) {
2230 SkRect computed, expected;
2233 int pointCount =
tests[testIndex].fPointCount - (d2 ==
tests[testIndex].fPoints);
2243 computed.
setLTRB(123, 456, 789, 1011);
2244 for (
auto c : {
true,
false})
2359 firstPt = verbPts[0];
2383 SkRect degenRect = testRect;
2389 degenRect = testRect;
2399 static constexpr unsigned kXSwapStarts[] = { 1, 0, 3, 2 };
2400 static constexpr unsigned kYSwapStarts[] = { 3, 2, 1, 0 };
2401 SkRect swapRect = testRect;
2406 swapRect = testRect;
2464 const SkScalar kStartAngles[] = { -270, -135, -45, 0, 10, 70, 180, 350 };
2465 const SkScalar kSweepAngles[] = { -350, -190, -90, -5, 5, 89, 180, 270, 350 };
2507 mutator = (mutator + 1) % 5;
2516 path.addArc(kOvals[0], kStartAngles[0], kSweepAngles[0]);
2524 path.addArc(kOvals[0], kStartAngles[0], kSweepAngles[0]);
2535 SkPoint r1[] = {{0, 0}, {1, 0}, {1, 1}, {0, 1}};
2536 SkPoint r2[] = {{1, 0}, {1, 1}, {0, 1}, {0, 0}};
2537 SkPoint r3[] = {{1, 1}, {0, 1}, {0, 0}, {1, 0}};
2538 SkPoint r4[] = {{0, 1}, {0, 0}, {1, 0}, {1, 1}};
2539 SkPoint r5[] = {{0, 0}, {0, 1}, {1, 1}, {1, 0}};
2540 SkPoint r6[] = {{0, 1}, {1, 1}, {1, 0}, {0, 0}};
2541 SkPoint r7[] = {{1, 1}, {1, 0}, {0, 0}, {0, 1}};
2542 SkPoint r8[] = {{1, 0}, {0, 0}, {0, 1}, {1, 1}};
2543 SkPoint r9[] = {{0, 1}, {1, 1}, {1, 0}, {0, 0}};
2544 SkPoint ra[] = {{0, 0}, {0, .5f}, {0, 1}, {.5f, 1}, {1, 1}, {1, .5f}, {1, 0}, {.5f, 0}};
2545 SkPoint rb[] = {{0, 0}, {.5f, 0}, {1, 0}, {1, .5f}, {1, 1}, {.5f, 1}, {0, 1}, {0, .5f}};
2546 SkPoint rc[] = {{0, 0}, {1, 0}, {1, 1}, {0, 1}, {0, 0}};
2547 SkPoint rd[] = {{0, 0}, {0, 1}, {1, 1}, {1, 0}, {0, 0}};
2548 SkPoint re[] = {{0, 0}, {1, 0}, {1, 0}, {1, 1}, {0, 1}};
2551 SkPoint f1[] = {{0, 0}, {1, 0}, {1, 1}};
2552 SkPoint f2[] = {{0, 0}, {1, 1}, {0, 1}, {1, 0}};
2553 SkPoint f3[] = {{0, 0}, {1, 0}, {1, 1}, {0, 1}, {0, 0}, {1, 0}};
2554 SkPoint f4[] = {{0, 0}, {1, 0}, {0, 0}, {1, 0}, {1, 1}, {0, 1}};
2555 SkPoint f5[] = {{0, 0}, {1, 0}, {1, 1}, {2, 0}};
2556 SkPoint f6[] = {{0, 0}, {1, 0}, {1, 1}, {0, 1}, {0, 2}};
2557 SkPoint f7[] = {{0, 0}, {1, 0}, {1, 1}, {0, 2}};
2558 SkPoint f8[] = {{0, 0}, {1, 0}, {1, 1}, {1, 0}};
2561 SkPoint c1[] = {{0, 0}, {1, 0}, {1, 1}, {0, 1}};
2562 SkPoint c2[] = {{0, 0}, {1, 0}, {1, 2}, {0, 2}, {0, 1}};
2564 struct IsNestedRectTest {
2601 for (
int rectFirst = 0; rectFirst <= 1; ++rectFirst) {
2602 for (
size_t testIndex = 0; testIndex <
testCount; ++testIndex) {
2607 path.moveTo(
tests[testIndex].fPoints[0].fX,
tests[testIndex].fPoints[0].fY);
2608 for (index = 1; index <
tests[testIndex].fPointCount; ++index) {
2609 path.lineTo(
tests[testIndex].fPoints[index].fX,
tests[testIndex].fPoints[index].fY);
2611 if (
tests[testIndex].fClose) {
2619 if (
tests[testIndex].fIsNestedRect) {
2620 SkRect expected[2], computed[2];
2626 expected[1] = testBounds;
2632 expectedDirs[1] =
tests[testIndex].fDirection;
2737 path.lineTo(10, 10);
2761 size_t size = writer.bytesWritten();
2763 writer.writeToMemory(storage.
get());
2776 unsigned start0, start1;
2792 const SkRect& origBounds =
p.getBounds();
2801 static const SkPoint pts[] = {
2809 p.quadTo(pts[2], pts[3]);
2810 p.cubicTo(pts[4], pts[5], pts[6]);
2817 size_t size1 =
p.writeToMemory(
nullptr);
2818 size_t size2 =
p.writeToMemory(
buffer);
2851#define CONIC_PERSPECTIVE_BUG_FIXED 0
2852 static const SkPoint pts[] = {
2857#if CONIC_PERSPECTIVE_BUG_FIXED
2865 p.quadTo(pts[2], pts[3]);
2866 p.cubicTo(pts[4], pts[5], pts[6]);
2867#if CONIC_PERSPECTIVE_BUG_FIXED
2868 p.conicTo(pts[4], pts[5], 0.5f);
2908 SkRect pBounds =
p.getBounds();
2943 matrix.setAll(1, 1, 0, 1, 1, 0, 0, 0, 1);
2953 p1.
addRect({ 10, 20, 30, 40 });
2955 p2.
addRect({ 10, 20, 30, 40 });
2974 const char* testPath;
2975 const size_t numResultPts;
2976 const SkRect resultBound;
2978 const size_t numResultVerbs;
3003 static const struct zeroPathTestData gZeroLengthTests[] = {
3004 {
"M 1 1", 1, {1, 1, 1, 1}, resultVerbs1,
std::size(resultVerbs1) },
3006 {
"M 1 1 z", 1, {1, 1, 1, 1}, resultVerbs3,
std::size(resultVerbs3) },
3026 for (
size_t i = 0;
i <
std::size(gZeroLengthTests); ++
i) {
3034 for (
size_t j = 0; j < gZeroLengthTests[
i].numResultVerbs; ++j) {
3045#define kCurveSegmentMask (SkPath::kQuad_SegmentMask | SkPath::kCubic_SegmentMask)
3051 p.quadTo(100, 100, 200, 200);
3056 p.cubicTo(100, 100, 200, 200, 300, 300);
3064 p.cubicTo(100, 100, 200, 200, 300, 300);
3097 struct iterTestData {
3098 const char* testPath;
3099 const bool forceClose;
3100 const size_t* numResultPtsPerVerb;
3103 const size_t numResultVerbs;
3113 static const size_t resultPtsSizes1[] = { 0 };
3114 static const size_t resultPtsSizes2[] = { 1, 2, 1, 1, 0 };
3115 static const size_t resultPtsSizes3[] = { 1, 2, 1, 1, 1, 0 };
3116 static const SkPoint* resultPts1 =
nullptr;
3117 static const SkPoint resultPts2[] = {
3120 static const SkPoint resultPts3[] = {
3121 {
SK_Scalar1, 0 }, {
SK_Scalar1, 0 }, {
SK_Scalar1, 0 }, {
SK_Scalar1, 0 }, { 0, 0 }, { 0, 0 }
3123 static const struct iterTestData gIterTests[] = {
3124 {
"M 1 0",
false, resultPtsSizes1, resultPts1, resultVerbs1,
std::size(resultVerbs1) },
3125 {
"z",
false, resultPtsSizes1, resultPts1, resultVerbs1,
std::size(resultVerbs1) },
3126 {
"z",
true, resultPtsSizes1, resultPts1, resultVerbs1,
std::size(resultVerbs1) },
3127 {
"M 1 0 L 1 0 M 0 0 z",
false, resultPtsSizes2, resultPts2, resultVerbs2,
std::size(resultVerbs2) },
3128 {
"M 1 0 L 1 0 M 0 0 z",
true, resultPtsSizes3, resultPts3, resultVerbs3,
std::size(resultVerbs3) }
3135 iter.
setPath(
p, gIterTests[
i].forceClose);
3139 for (
int k = 0; k < (
int)gIterTests[
i].numResultPtsPerVerb[j]; ++k) {
3166 for (
int setNaN = 0; setNaN < 4; ++setNaN) {
3177 p.quadTo(0, 0, 0, 0);
3183 p.conicTo(0, 0, 0, 0, 0.5f);
3189 p.cubicTo(0, 0, 0, 0, 0, 0);
3202 const SkVector radii[4] = { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 100, 100 } };
3229 auto [verb, pts,
w] = *iter++;
3240 iter = iterate.
begin();
3242 auto [verb, pts,
w] = *iter++;
3248 auto [verb, pts,
w] = *iter++;
3254 auto [verb, pts,
w] = *iter++;
3279 iter = iterate.
begin();
3281 auto [verb, pts,
w] = *iter++;
3287 auto [verb, pts,
w] = *iter++;
3291 auto [verb, pts,
w] = *iter++;
3297 auto [verb, pts,
w] = *iter++;
3301 auto [verb, pts,
w] = *iter++;
3307 auto [verb, pts,
w] = *iter++;
3313 auto [verb, pts,
w] = *iter++;
3320 for (
int i = 0;
i < 5; ++
i) {
3321 for (
int j = 0; j < 5; ++j) {
3332 for (
int i = 0;
i < 500; ++
i) {
3334 bool lastWasClose =
true;
3335 bool haveMoveTo =
false;
3336 SkPoint lastMoveToPt = { 0, 0 };
3338 int numVerbs = (rand.
nextU() >> 16) % 10;
3339 int numIterVerbs = 0;
3340 for (
int j = 0; j < numVerbs; ++j) {
3346 expectedPts[numPoints] = randomPts[(rand.
nextU() >> 16) % 25];
3347 path.moveTo(expectedPts[numPoints]);
3348 lastMoveToPt = expectedPts[numPoints];
3350 lastWasClose =
false;
3355 expectedPts[numPoints++] = lastMoveToPt;
3359 expectedPts[numPoints] = randomPts[(rand.
nextU() >> 16) % 25];
3360 path.lineTo(expectedPts[numPoints]);
3362 lastWasClose =
false;
3366 expectedPts[numPoints++] = lastMoveToPt;
3370 expectedPts[numPoints] = randomPts[(rand.
nextU() >> 16) % 25];
3371 expectedPts[numPoints + 1] = randomPts[(rand.
nextU() >> 16) % 25];
3372 path.quadTo(expectedPts[numPoints], expectedPts[numPoints + 1]);
3374 lastWasClose =
false;
3378 expectedPts[numPoints++] = lastMoveToPt;
3382 expectedPts[numPoints] = randomPts[(rand.
nextU() >> 16) % 25];
3383 expectedPts[numPoints + 1] = randomPts[(rand.
nextU() >> 16) % 25];
3384 path.conicTo(expectedPts[numPoints], expectedPts[numPoints + 1],
3387 lastWasClose =
false;
3391 expectedPts[numPoints++] = lastMoveToPt;
3395 expectedPts[numPoints] = randomPts[(rand.
nextU() >> 16) % 25];
3396 expectedPts[numPoints + 1] = randomPts[(rand.
nextU() >> 16) % 25];
3397 expectedPts[numPoints + 2] = randomPts[(rand.
nextU() >> 16) % 25];
3398 path.cubicTo(expectedPts[numPoints], expectedPts[numPoints + 1],
3399 expectedPts[numPoints + 2]);
3401 lastWasClose =
false;
3406 lastWasClose =
true;
3411 expectedVerbs[numIterVerbs++] = nextVerb;
3414 numVerbs = numIterVerbs;
3419 lastMoveTo.
set(0, 0);
3428 lastPt = lastMoveTo = pts[0];
3457 lastPt = lastMoveTo;
3470 bool expectedCircle,
3475 unsigned isOvalStart;
3493 path.transform(
m, &tmp);
3512 path.transform(
m, &tmp);
3520 path.transform(
m, &tmp);
3527 for (
int angle = 0; angle < 360; ++angle) {
3531 path.transform(
m, &tmp);
3536 if (angle % 90 == 0) {
3551 path.transform(
m, &tmp);
3568 path.transform(
m, &tmp);
3588 path.transform(
m, &tmp);
3656 path.addPath(circle, translate);
3716 path.transform(
m, &tmp);
3726 path.transform(
m, &tmp);
3734 path.transform(
m, &tmp);
3786 path.transform(
m, &tmp);
3798 path.transform(
m, &tmp);
3865 SkVector radii[] = {{1, 2}, {3, 4}, {5, 6}, {7, 8}};
3866 SkRect r = {10, 20, 30, 40};
3872 p.addRoundRect(r, &radii[0].fX);
3876 p.addRoundRect(r, radii[1].fX, radii[1].fY);
3888 p.addRoundRect(r, 0, 0);
3893 SkVector zeroRadii[] = {{0, 0}, {0, 0}, {0, 0}, {0, 0}};
3910 SkRect emptyR = {10, 20, 10, 30};
3930 SkRect emptyOval = {10, 20, 30, 20};
3932 p.addArc(emptyOval, 1, 2);
3936 p.addArc(
oval, 1, 0);
3941 p.addArc(
oval, 0, 360);
3946 p.addArc(
oval, 0, -360);
3949 p.addArc(
oval, 1, 180);
3975 while (angle < 0.f) {
3978 while (angle >= 360.f) {
4000 for (
SkScalar sweep : {-720.f, -540.f, -360.f, 360.f, 432.f, 720.f}) {
4006 if (std::fmod(
start, 90.f) == 0) {
4013 for (
float start : {-180.f, -90.f, 90.f, 180.f}) {
4025 auto [v, pts,
w] = *(*iter)++;
4033 auto [v, pts,
w] = *(*iter)++;
4041 auto [v, pts,
w] = *(*iter)++;
4050 auto [v, pts,
w] = *(*iter)++;
4141 p.arcTo(0, 0, 1, 2, 1);
4143 p.arcTo(1, 2, 1, 2, 1);
4145 p.arcTo(1, 2, 3, 4, 0);
4147 p.arcTo(1, 2, 0, 0, 1);
4149 p.arcTo(1, 0, 1, 1, 1);
4153 p.arcTo(1, 0, 1, -1, 1);
4157 p.arcTo(
oval, 0, 0,
true);
4159 p.arcTo(
oval, 0, 0,
false);
4161 p.arcTo(
oval, 360, 0,
true);
4163 p.arcTo(
oval, 360, 0,
false);
4166 for (
float sweep = 359,
delta = 0.5f; sweep != (
float) (sweep +
delta); ) {
4167 p.arcTo(
oval, 0, sweep,
false);
4172 for (
float sweep = 361,
delta = 0.5f; sweep != (
float) (sweep -
delta);) {
4173 p.arcTo(
oval, 0, sweep,
false);
4178 SkRect noOvalWidth = {1, 2, 0, 3};
4180 p.arcTo(noOvalWidth, 0, 360,
false);
4183 SkRect noOvalHeight = {1, 2, 3, 1};
4185 p.arcTo(noOvalHeight, 0, 360,
false);
4196 int n =
p.countPoints();
4214 p.addPath(q, -4, -4);
4215 SkRect expected = {0, 0, 4, 4};
4218 p.reverseAddPath(q);
4219 SkRect reverseExpected = {4, 4, 8, 8};
4225 if (explicitMoveTo) {
4229 if (explicitMoveTo) {
4235 int verbcount =
p.getVerbs(verbs, 4);
4253 int verbcount =
p.getVerbs(verbs, 7);
4287 p.conicTo(1, 2, 3, 4, -1);
4291 p.conicTo(1, 2, 3, 4, 1);
4301 p.setLastPt(10, 10);
4318 (void)
p.contains(-77.2027664f, 15.3066053f);
4395 p.quadTo(6, 6, 8, 8);
4396 p.quadTo(6, 8, 4, 8);
4397 p.quadTo(4, 6, 4, 4);
4410 const SkPoint qPts[] = {{6, 6}, {8, 8}, {6, 8}, {4, 8}, {4, 6}, {4, 4}, {6, 6}};
4412 for (
int index = 1; index < (
int)
std::size(qPts); index += 2) {
4413 p.quadTo(qPts[index], qPts[index + 1]);
4419 for (
int index = 0; index < (
int)
std::size(qPts) - 2; index += 2) {
4426 const SkPoint kPts[] = {{4, 4}, {6, 6}, {8, 8}, {6, 8}, {4, 8}, {4, 6}, {4, 4}};
4429 p.conicTo(
kPts[index],
kPts[index + 1], 0.5f);
4436 halfway =
conic.evalAt(0.5f);
4445 SkPoint pts[] = {{5, 4}, {6, 5}, {7, 6}, {6, 6}, {4, 6}, {5, 7}, {5, 5}, {5, 4}, {6, 5}, {7, 6}};
4446 for (
int i = 0;
i < 3; ++
i) {
4449 p.moveTo(pts[
i].fX, pts[
i].fY);
4450 p.cubicTo(pts[
i + 1].fX, pts[
i + 1].fY, pts[
i + 2].fX, pts[
i + 2].fY, pts[
i + 3].fX, pts[
i + 3].fY);
4451 p.cubicTo(pts[
i + 4].fX, pts[
i + 4].fY, pts[
i + 5].fX, pts[
i + 5].fY, pts[
i + 6].fX, pts[
i + 6].fY);
4471 + (ref.fVerbs.
capacity() - ref.fVerbs.
size()) *
sizeof(uint8_t);
4475 static const int kRepeatCnt = 10;
4486 for (
int i = 0;
i < kRepeatCnt; ++
i) {
4497 for (
int i = 0;
i < kRepeatCnt; ++
i) {
4508 for (
int i = 0;
i < kRepeatCnt; ++
i) {
4522 for (
int i = 0;
i < kRepeatCnt; ++
i) {
4533 for (
int i = 0;
i < kRepeatCnt; ++
i) {
4565 path.dump(&wStream, dumpAsHex);
4568 if (strlen(str) > 0) {
4581 "path.moveTo(1, 2);\n"
4582 "path.lineTo(3, 4);\n");
4586 p.quadTo(3, 4, 5, 6);
4588 "path.moveTo(1, 2);\n"
4589 "path.quadTo(3, 4, 5, 6);\n");
4593 p.conicTo(3, 4, 5, 6, 0.5f);
4595 "path.moveTo(1, 2);\n"
4596 "path.conicTo(3, 4, 5, 6, 0.5f);\n");
4600 p.cubicTo(3, 4, 5, 6, 7, 8);
4602 "path.moveTo(1, 2);\n"
4603 "path.cubicTo(3, 4, 5, 6, 7, 8);\n");
4609 "path.setFillType(SkPathFillType::kWinding);\n"
4610 "path.moveTo(SkBits2Float(0x3f800000), SkBits2Float(0x40000000)); // 1, 2\n"
4611 "path.lineTo(SkBits2Float(0x40400000), SkBits2Float(0x40800000)); // 3, 4\n");
4616 "path.moveTo(1, 2);\n"
4617 "path.lineTo(3, 4);\n");
4624 ChangeListener(
bool *changed) : fChanged(changed) { *fChanged =
false; }
4625 ~ChangeListener()
override {}
4626 void changed()
override { *fChanged =
true; }
4654 SkRect reverseExpected = {-4, -4, 8, 8};
4661 bool changed =
false;
4737 paint.setAntiAlias(
true);
4746 paint.setAntiAlias(
true);
4778 {{125.126022f, -0.499872506f}, {125.288895f, -0.499338806f},
4779 {125.299316f, -0.499290764f}, {126.294594f, 0.505449712f},
4780 {125.999992f, 62.5047531f}, {124.0f, 62.4980202f},
4781 {124.122749f, 0.498142242f}, {125.126022f, -0.499872506f},
4782 {125.119476f, 1.50011659f}, {125.122749f, 0.50012207f},
4783 {126.122749f, 0.502101898f}, {126.0f, 62.5019798f},
4784 {125.0f, 62.5f}, {124.000008f, 62.4952469f},
4785 {124.294609f, 0.495946467f}, {125.294601f, 0.50069809f},
4786 {125.289886f, 1.50068688f}, {125.282349f, 1.50065041f},
4787 {125.119476f, 1.50011659f}};
4792 kMove, kLine, kLine, kLine, kLine, kLine, kLine, kLine, kLine, kLine, kLine,
kClose};
4794 for(
auto verb : verbs) {
4826 path.moveTo(10, 10);
4827 path.cubicTo(10, 20, 10, 30, 30, 30);
4828 path.lineTo(50, 20);
4829 path.lineTo(50, 10);
5048 path.moveTo(0, 512);
5126 int count =
p.getPoints(pts, 4);
5130 p.getVerbs(verbs, 5);
5250 path.conservativelyContainsRect({ -211747, 12.1115f, -197893, 25.0321f });
5256 for (
int i = 0;
i < n; ++
i) {
5286 for (
int i = 0;
i < 1000; ++
i) {
5287 for (
int n = 1; n <= 10; n += 9) {
5304 SkRect ri = { 0.18554693f, 195.26283f, 0.185784385f, 752.644409f };
5306 { 1.81159976e-09f, 7.58768801e-05f },
5307 { 0.000118725002f, 0.000118725002f },
5308 { 0.000118725002f, 0.000118725002f },
5309 { 0.000118725002f, 0.486297607f }
5313 SkRect ro = { 9.18354821e-39f, 2.1710848e+9f, 2.16945843e+9f, 3.47808128e+9f };
5316 { 0.0103298295f, 0.185887396f },
5317 { 2.52999727e-29f, 169.001938f },
5318 { 195.262741f, 195.161255f }
5327 const size_t numMoves = 5;
5328 const size_t numConics = 7;
5329 const size_t numPoints = numMoves + 2 * numConics;
5330 const size_t numVerbs = numMoves + numConics;
5331 for (
size_t i = 0;
i < numMoves; ++
i)
path.moveTo(1, 2);
5332 for (
size_t i = 0;
i < numConics; ++
i)
path.conicTo(1, 2, 3, 4, 5);
5338 size_t bytesWritten =
data->size();
5365 const char*
tests[] = {
5366 "M50,0A50,50,0,0 1 100,50 L100,85 A15,15,0,0 1 85,100 L50,100 A50,50,0,0 1 50,0z",
5367 (
"M50,0L92,0 A8,8,0,0 1 100,8 L100,92 A8,8,0,0 1 92,100 L8,100"
5368 " A8,8,0,0 1 0,92 L 0,8 A8,8,0,0 1 8,0z"),
5369 "M50 0A50 50,0,1,1,50 100A50 50,0,1,1,50 0"
5376 SkPath scalePath = aPath;
5383 SkPath scalePath = aPath;
5397 auto canvas = surf->getCanvas();
5399 const bool aas[] = {
false,
true };
5413 for (
auto aa : aas) {
5414 paint.setAntiAlias(aa);
5415 for (
auto style : styles) {
5416 paint.setStyle(style);
5417 canvas->drawRect(r,
paint);
5418 canvas->drawOval(r,
paint);
5429 SkCanvas* canvas = surf->getCanvas();
5432 for (
bool aa : {
false,
true}) {
5438 if (
bits & 1) p0.
fX = -bad;
5439 if (
bits & 2) p0.
fY = -bad;
5440 if (
bits & 4) p1.
fX = bad;
5441 if (
bits & 8) p1.
fY = bad;
5446 path.setFillType(ft);
5462 for (
size_t index = 0; index <
count; ++index) {
5472 for (
size_t index = 0; index <
count; ++index) {
5473 switch (verbs[index]) {
5491 SkPoint points[] = { {10, 10}, {75, 75}, {150, 75}, {150, 150}, {75, 150} };
5498 SkPoint points3[] = { {75, 50}, {100, 75}, {150, 75}, {150, 150}, {75, 150}, {75, 50} };
5502 SkPoint points9[] = { {10, 10}, {75, 75}, {150, 75}, {150, 150}, {75, 150} };
5510 SkPoint points11[] = { {75, 150}, {75, 75}, {150, 75}, {150, 150}, {75, 150}, {75, 150} };
5520 SkPoint points14[] = { {250, 75}, {250, 75}, {250, 75}, {100, 75},
5521 {150, 75}, {150, 150}, {75, 150}, {75, 75}, {0, 0} };
5527 SkPoint points15[] = { {75, 75}, {150, 75}, {150, 150}, {75, 150}, {250, 75} };
5533 SkPoint points17[] = { {75, 10}, {75, 75}, {150, 75}, {150, 150}, {75, 150}, {75, 10} };
5541 SkPoint points19[] = { {75, 75}, {75, 75}, {75, 75}, {75, 75}, {150, 75}, {150, 150},
5542 {75, 150}, {10, 10}, {30, 10}, {10, 30} };
5549 SkPoint points23[] = { {75, 75}, {75, 75}, {75, 75}, {75, 75}, {150, 75}, {150, 150},
5559 SkPoint points29[] = { {75, 75}, {150, 75}, {150, 150}, {75, 150}, {75, 250}, {75, 75} };
5566 SkPoint points31[] = { {75, 75}, {150, 75}, {150, 150}, {75, 150}, {75, 10}, {75, 75} };
5569 compare.setBounds(&points31[0], 4);
5574 SkPoint points36[] = { {75, 75}, {150, 75}, {150, 150}, {10, 150}, {75, 75}, {75, 75} };
5580 SkPoint points39[] = { {150, 75}, {150, 150}, {75, 150}, {75, 100} };
5587 SkPoint pointsAA[] = { {32, 9.5f}, {32, 9.5f}, {32, 17}, {17, 17}, {17, 9.5f}, {17, 2},
5597 SkPoint points41[] = { {75, 75}, {150, 75}, {150, 150}, {140, 150}, {140, 75}, {75, 75} };
5600 compare.setBounds(&points41[1], 4);
5606 SkPoint points53[] = { {75, 75}, {150, 75}, {150, 150}, {140, 150}, {140, 75}, {75, 75} };
5609 compare.setBounds(&points53[1], 4);
5627 for (
int add = 0; add <
count; ++add) {
5629 path.moveTo(1, 2).lineTo(3, 4).cubicTo(1,2,3,4,5,6).conicTo(1,2,3,4,5);
5641 path.addPoly(pts, 3,
false);
5654 { 0.499069244f, 9.63295173f },
5655 { 0.499402374f, 7.88207579f },
5656 { 10.2363272f, 0.49999997f }
5670 { 0.327190518f, -114.945152f },
5671 { -0.5f, 1.00003874f },
5672 { 0.666425824f, 4304.26172f },
5681 case 0:
path->lineTo(10, 20);
break;
5682 case 1:
path->quadTo(5, 6, 7, 8);
break;
5683 case 2:
path->conicTo(1, 2, 3, 4, 0.5f);
break;
5684 case 3:
path->cubicTo(2, 4, 6, 8, 10, 12);
break;
5692 for (
int verbs = 0; verbs < 100; ++verbs) {
5693 SkPath unique_path, shared_path;
5704 uint32_t cID =
copy.getGenerationID();
5778template <
typename ISA>
5794 path->transform(
x.fIM);
5802 path->transform(
x.fTM);
5810 path->transform(
x.fSM);
5820 path->transform(
x.fRM);
5834 path.addRect({10, 10, 40, 50});
5838 path.addOval({10, 10, 40, 50});
5847 path.moveTo(0, 0).lineTo(100, 0).lineTo(70, 100).lineTo(30, 100);
5857 const char text[] =
"hello";
5858 constexpr size_t len =
sizeof(
text) - 1;
5871 SkScalar radii[] = { 80, 100, 0, 0, 40, 60, 0, 0 };
5873 path.addRoundRect({10, 10, 110, 110}, radii);
5874 path.offset(0, 5, &(copyPath));
5876 copyPath.
rConicTo(1, 1, 3, 3, 0.707107f);
5880 const std::initializer_list<SkPath::Verb>& in,
5881 const std::initializer_list<SkPath::Verb>& expected) {
5894 for (
auto v : expected) {
5895 auto e = iter.
next();
5903 const SkPath&
path,
const std::initializer_list<SkPoint>& list) {
5904 const SkPoint* expected = list.begin();
5906 for (
size_t i = 0;;) {
5908 switch (iter.
next(pts)) {
5928 const SkRect r = {1, 2, 3, 4};
5937 for (
int i = 0;
i < 4; ++
i) {
5943 for (
int j = 0; j < 4; ++j) {
5944 int index = (
i + j*increment) % 4;
5948 e[0],
e[1],
e[2],
e[3]
5954 e[0],
e[1],
e[2],
e[3],
5969 p[2],
p[3],
p[0],
p[1],
6000 const SkPoint newLineTo = {1234, 5678};
6001 path.lineTo(newLineTo);
6003 p =
path.getPoint(
path.countPoints() - 2);
6006 p =
path.getPoint(
path.countPoints() - 1);
6032 test_before_after_lineto(path1c, {20,50}, {20,30});
6033 test_before_after_lineto(
path2, {20,50}, {20,30});
6034 test_before_after_lineto(path2c, {20,50}, {20,30});
6040 test_before_after_lineto(
path1, {20,50}, {20,50});
6041 test_before_after_lineto(
path3, {20,50}, {20,50});
6042 test_before_after_lineto(path3c, {20,50}, {20,50});
6059 test_edger(r, {
M,
L,
L,
M,
L,
L }, {
L,
L,
L,
L,
L,
L });
6070 p1.
addRect({143,226,200,241});
6073 SkPoint rectangleStart = {143, 226};
6105 SkRect rects[] = {{207.0f, 237.0f, 300.0f, 237.0f},
6106 {207.0f, 237.0f, 300.0f, 267.0f}};
6109 for (
int numExtraMoveTos : {0, 1, 2, 3}) {
6113 for (
int i = 0;
i < numExtraMoveTos; ++
i) {
6142 path.moveTo(3.25f, 115.5f);
6143 path.conicTo(9.98099e+17f, 2.83874e+15f, 1.75098e-30f, 1.75097e-30f, 1.05385e+18f);
6144 path.conicTo(9.96938e+17f, 6.3804e+19f, 9.96934e+17f, 1.75096e-30f, 1.75096e-30f);
6145 path.quadTo(1.28886e+10f, 9.9647e+17f, 9.98101e+17f, 2.61006e+15f);
6148 SkPath pathWithExtraMoveTo;
6150 pathWithExtraMoveTo.
moveTo(5.90043e-39f, 1.34525e-43f);
6162 path.moveTo(0.00665998459f, 2);
6163 path.quadTo(0.00665998459f, 4, -1.99334002f, 4);
6164 path.quadTo(-3.99334002f, 4, -3.99334002f, 2);
6165 path.quadTo(-3.99334002f, 0, -1.99334002f, 0);
6166 path.quadTo(0.00665998459f, 0, 0.00665998459f, 2);
6170 paint.setAntiAlias(
true);
static SkM44 inv(const SkM44 &m)
static const struct @223 gRec[]
sk_bzero(glyphs, sizeof(glyphs))
SkAssertResult(font.textToGlyphs("Hello", 5, SkTextEncoding::kUTF8, glyphs, std::size(glyphs))==count)
static const int points[]
static const size_t testCount
static const SkPoint nonFinitePts[]
const size_t nonFinitePtsCount
static void test_circle_translate(skiatest::Reporter *reporter, const SkPath &path, SkPathFirstDirection dir)
static void test_arb_round_rect_is_convex(skiatest::Reporter *reporter)
static void test_transform(skiatest::Reporter *reporter)
static void test_fuzz_crbug_638223()
static void test_arc_ovals(skiatest::Reporter *reporter)
static void test_addPath_and_injected_moveTo(skiatest::Reporter *reporter)
static void check_convex_bounds(skiatest::Reporter *reporter, const SkPath &p, const SkRect &bounds)
static void test_bad_cubic_crbug229478()
static void test_skbug_6947()
static void test_arcTo(skiatest::Reporter *reporter)
static void test_conicTo_special_case(skiatest::Reporter *reporter)
static void test_isNestedFillRects(skiatest::Reporter *reporter)
static void test_interp(skiatest::Reporter *reporter)
static bool conditional_convex(const SkPath &path, bool is_convex)
static void test_arb_zero_rad_round_rect_is_rect(skiatest::Reporter *reporter)
static void test_range_iter(skiatest::Reporter *reporter)
static void test_path_crbug389050(skiatest::Reporter *reporter)
static void test_isRect_open_close(skiatest::Reporter *reporter)
static void write_and_read_back(skiatest::Reporter *reporter, const SkPath &p)
void survive(SkPath *path, const Xforms &x, bool isAxisAligned, skiatest::Reporter *reporter, ISA isa_proc)
static void make_arb_round_rect(SkPath *path, const SkRect &r, SkScalar xCorner, SkScalar yCorner)
static void test_rMoveTo(skiatest::Reporter *reporter)
static SkScalar oval_start_index_to_angle(unsigned start)
static void test_iterative_intersect_line()
static void add_rect(SkPath *path, const SkRect &r)
static bool nearly_equal(const SkRect &a, const SkRect &b)
static void test_get_point(skiatest::Reporter *reporter)
#define kCurveSegmentMask
static void test_is_closed_rect(skiatest::Reporter *reporter)
static void test_circle(skiatest::Reporter *reporter)
static void test_direction(skiatest::Reporter *reporter)
static void test_circle_rotate(skiatest::Reporter *reporter, const SkPath &path, SkPathFirstDirection dir)
static void test_addPathMode(skiatest::Reporter *reporter, bool explicitMoveTo, bool extend)
static void check_convexity(skiatest::Reporter *reporter, const SkPath &path, bool expectedConvexity)
static void test_bad_cubic_crbug234190()
static void test_bounds_crbug_513799(skiatest::Reporter *reporter)
static void test_convexity(skiatest::Reporter *reporter)
static void stroke_tiny_cubic()
static void test_dump(skiatest::Reporter *reporter)
static void dump_if_ne(skiatest::Reporter *reporter, const SkRect &expected, const SkRect &bounds)
static void test_fuzz_crbug_627414(skiatest::Reporter *reporter)
static void test_zero_length_paths(skiatest::Reporter *reporter)
static void test_isLine(skiatest::Reporter *reporter)
static void test_fuzz_crbug_643933()
static void test_mask_overflow()
static void test_rect_isfinite(skiatest::Reporter *reporter)
static void test_path_crbugskia5995()
static void test_open_oval(skiatest::Reporter *reporter)
static void test_empty(skiatest::Reporter *reporter, const SkPath &p)
static void test_addrect_isfinite(skiatest::Reporter *reporter)
static void test_convexity2(skiatest::Reporter *reporter)
static SkScalar canonical_start_angle(float angle)
static void test_rrect_convexity_is_unknown(skiatest::Reporter *reporter, SkPath *path, SkPathDirection dir)
static void test_add_rrect(skiatest::Reporter *reporter, const SkRect &bounds, const SkVector radii[4])
static void test_poly(skiatest::Reporter *reporter, const SkPath &path, const SkPoint srcPts[], bool expectClose)
static void compare_dump(skiatest::Reporter *reporter, const SkPath &path, bool dumpAsHex, const char *str)
static void test_iter(skiatest::Reporter *reporter)
static void build_path_170666(SkPath &path)
static void test_fuzz_crbug_668907()
static void stroke_cubic(const SkPoint pts[4])
DEF_TEST(PathInterp, reporter)
static void check_done_and_reset(skiatest::Reporter *reporter, SkPath *p, SkPathPriv::RangeIter *iter)
static void check_line(skiatest::Reporter *reporter, SkPathPriv::RangeIter *iter, SkScalar x1, SkScalar y1)
static void test_fuzz_crbug_662780()
static void test_close(skiatest::Reporter *reporter)
static void test_isArc(skiatest::Reporter *reporter)
static void test_arc(skiatest::Reporter *reporter)
static void make_path_crbug364224(SkPath *path)
static void test_skbug_7435()
static void test_isRect(skiatest::Reporter *reporter)
static void check_path_is_line_pair_and_reset(skiatest::Reporter *reporter, SkPath *p, SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2)
static void draw_triangle(SkCanvas *canvas, const SkPoint pts[])
static void test_crbug_629455(skiatest::Reporter *reporter)
static void test_clipped_cubic()
static void check_direction(skiatest::Reporter *reporter, const SkPath &path, SkPathFirstDirection expected)
static void test_edger(skiatest::Reporter *r, const std::initializer_list< SkPath::Verb > &in, const std::initializer_list< SkPath::Verb > &expected)
static void test_extendClosedPath(skiatest::Reporter *reporter)
static void test_isfinite_after_transform(skiatest::Reporter *reporter)
static void test_skbug_3469(skiatest::Reporter *reporter)
static void build_path_simple_170666(SkPath &path)
static void test_contains(skiatest::Reporter *reporter)
static void test_draw_AA_path(int width, int height, const SkPath &path)
static void test_circle_with_add_paths(skiatest::Reporter *reporter)
static void make_path0(SkPath *path)
static void test_crbug_493450(skiatest::Reporter *reporter)
static void assert_points(skiatest::Reporter *reporter, const SkPath &path, const std::initializer_list< SkPoint > &list)
static void test_operatorEqual(skiatest::Reporter *reporter)
static void test_islastcontourclosed(skiatest::Reporter *reporter)
static void check_quad(skiatest::Reporter *reporter, SkPathPriv::RangeIter *iter, SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2)
static void test_circle_mirror_x(skiatest::Reporter *reporter, const SkPath &path, SkPathFirstDirection dir)
static void test_addrect(skiatest::Reporter *reporter)
static void test_circle_mirror_xy(skiatest::Reporter *reporter, const SkPath &path, SkPathFirstDirection dir)
static void test_bounds(skiatest::Reporter *reporter)
static void test_skbug_7015()
static void test_tricky_cubic()
static void check_path_is_line(skiatest::Reporter *reporter, SkPath *p, SkScalar x1, SkScalar y1)
static void test_addPoly(skiatest::Reporter *reporter)
#define SUPPRESS_VISIBILITY_WARNING
static void test_segment_masks(skiatest::Reporter *reporter)
static void test_strokerec(skiatest::Reporter *reporter)
static void make_path1(SkPath *path)
static void test_isfinite(skiatest::Reporter *reporter)
static void add_verbs(SkPath *path, int count)
static void test_circle_mirror_y(skiatest::Reporter *reporter, const SkPath &path, SkPathFirstDirection dir)
static void add_corner_arc(SkPath *path, const SkRect &rect, SkScalar xIn, SkScalar yIn, int startAngle)
static void test_fuzz_crbug_662730(skiatest::Reporter *reporter)
static void test_skbug_7051()
static void check_path_is_move_and_reset(skiatest::Reporter *reporter, SkPath *p, SkScalar x0, SkScalar y0)
static void check_done(skiatest::Reporter *reporter, SkPath *p, SkPathPriv::RangeIter *iter)
static void test_fuzz_crbug_662952(skiatest::Reporter *reporter)
static void test_convexity_doubleback(skiatest::Reporter *reporter)
static void check_simple_rect(skiatest::Reporter *reporter, const SkPath &path, bool isClosed, const SkRect &rect, SkPathDirection dir, unsigned start)
static void test_skbug_3239(skiatest::Reporter *reporter)
static void test_path_crbugskia2820(skiatest::Reporter *reporter)
static void set_radii(SkVector radii[4], int index, float rad)
static void test_oval(skiatest::Reporter *reporter)
static void check_for_circle(skiatest::Reporter *reporter, const SkPath &path, bool expectedCircle, SkPathFirstDirection expectedDir)
static void test_circle_with_direction(skiatest::Reporter *reporter, SkPathDirection inDir)
static void test_path_close_issue1474(skiatest::Reporter *reporter)
static void test_rrect(skiatest::Reporter *reporter)
static void build_big_path(SkPath *path, bool reducedCase)
static void test_crbug_613918()
static void check_path_is_line_and_reset(skiatest::Reporter *reporter, SkPath *p, SkScalar x1, SkScalar y1)
static void test_crbug_170666()
static void make_path_crbug364224_simplified(SkPath *path)
static void test_fuzz_crbug_647922()
static void rand_path(SkPath *path, SkRandom &rand, SkPath::Verb verb, int n)
static void test_addEmptyPath(skiatest::Reporter *reporter, SkPath::AddPathMode mode)
void(* PathProc)(SkPath *)
static void test_crbug_495894(skiatest::Reporter *reporter)
static void test_gen_id(skiatest::Reporter *reporter)
static void test_flattening(skiatest::Reporter *reporter)
static void test_rrect_is_convex(skiatest::Reporter *reporter, SkPath *path, SkPathDirection dir)
static void check_oval_arc(skiatest::Reporter *reporter, SkScalar start, SkScalar sweep, const SkPath &path)
static void test_addPath(skiatest::Reporter *reporter)
static void test_path_isfinite(skiatest::Reporter *reporter)
static void test_addRect_and_trailing_lineTo(skiatest::Reporter *reporter)
const SkPathFirstDirection kDontCheckDir
static void make_path_crbugskia2820(SkPath *path, skiatest::Reporter *reporter)
static void test_path_to_region(skiatest::Reporter *reporter)
static void test_path_crbugskia6003()
static void check_path_is_quad_and_reset(skiatest::Reporter *reporter, SkPath *p, SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2)
static void setFromString(SkPath *path, const char str[])
static void test_sect_with_horizontal_needs_pinning()
static void test_path_crbug364224()
static void check_move(skiatest::Reporter *reporter, SkPathPriv::RangeIter *iter, SkScalar x0, SkScalar y0)
static void test_circle_skew(skiatest::Reporter *reporter, const SkPath &path, SkPathFirstDirection dir)
static void test_conservativelyContains(skiatest::Reporter *reporter)
static void test_tiny_path_convexity(skiatest::Reporter *reporter, const char *pathBug, SkScalar tx, SkScalar ty, SkScalar scale)
static void check_close(skiatest::Reporter *reporter, const SkPath &path)
#define SkDEBUGFAIL(message)
@ kSrcOver
r = s + (1-sa)*d
constexpr SkColor SK_ColorBLACK
static float SkBits2Float(uint32_t bits)
constexpr float SK_FloatNegativeInfinity
static bool isAxisAligned(const SkScalerContextRec &rec)
@ kUTF8
uses bytes to represent UTF-8 or ASCII
void SkEvalCubicAt(const SkPoint src[4], SkScalar t, SkPoint *loc, SkVector *tangent, SkVector *curvature)
void SkEvalQuadAt(const SkPoint src[3], SkScalar t, SkPoint *pt, SkVector *tangent)
@ kNo
Don't pre-clip the geometry before applying the (perspective) matrix.
SK_API std::unique_ptr< SkCanvas > SkMakeNullCanvas()
static const int kPtCount[]
bool SK_API TightBounds(const SkPath &path, SkRect *result)
@ kClose
SkPath::RawIter returns 0 points.
@ kCubic
SkPath::RawIter returns 4 points.
@ kConic
SkPath::RawIter returns 3 points + 1 weight.
@ kQuad
SkPath::RawIter returns 3 points.
@ kMove
SkPath::RawIter returns 1 point.
@ kLine
SkPath::RawIter returns 2 points.
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
bool equals(SkDrawable *a, SkDrawable *b)
void swap(sk_sp< T > &a, sk_sp< T > &b)
#define SkScalarSin(radians)
static bool SkScalarNearlyEqual(SkScalar x, SkScalar y, SkScalar tolerance=SK_ScalarNearlyZero)
#define SkDoubleToScalar(x)
#define SK_ScalarNearlyZero
#define SK_ScalarInfinity
#define SK_ScalarRoot2Over2
#define SK_ScalarNegativeInfinity
static void copy(void *dst, const uint8_t *src, int width, int bpp, int deltaSrc, int offset, const SkPMColor ctable[])
constexpr int SkToInt(S x)
static constexpr bool SkToBool(const T &x)
#define REPORTER_ASSERT(r, cond,...)
static SkScalar center(float pos0, float pos1)
static size_t GetFreeSpace(const SkPathRef &ref)
static void TestPathRef(skiatest::Reporter *reporter)
static void TestPathTo(skiatest::Reporter *reporter)
static size_t GetFreeSpace(const SkPath &path)
static void TestPathrefListeners(skiatest::Reporter *reporter)
void writePath(const SkPath &path) override
void drawRect(const SkRect &rect, const SkPaint &paint)
virtual bool isClipEmpty() const
void clipPath(const SkPath &path, SkClipOp op, bool doAntiAlias)
void drawPath(const SkPath &path, const SkPaint &paint)
void drawVertices(const SkVertices *vertices, SkBlendMode mode, const SkPaint &paint)
sk_sp< SkData > detachAsData()
static SkMatrix Scale(SkScalar sx, SkScalar sy)
static SkMatrix RotateDeg(SkScalar deg)
static SkMatrix Translate(SkScalar dx, SkScalar dy)
SkMatrix & setTranslate(SkScalar dx, SkScalar dy)
SkMatrix & setScale(SkScalar sx, SkScalar sy, SkScalar px, SkScalar py)
SkMatrix & setRotate(SkScalar degrees, SkScalar px, SkScalar py)
static const SkMatrix & I()
void setStyle(Style style)
@ kStroke_Style
set to stroke geometry
@ kFill_Style
set to fill geometry
@ kStrokeAndFill_Style
sets to stroke and fill geometry
void setStrokeWidth(SkScalar width)
static bool FromSVGString(const char str[], SkPath *)
static const char * FindScalar(const char str[], SkScalar *value)
SkPathBuilder & lineTo(SkPoint pt)
SkPathBuilder & moveTo(SkPoint pt)
static SkPath::Verb EdgeToVerb(Edge e)
static bool IsRRect(const SkPath &path, SkRRect *rrect, SkPathDirection *dir, unsigned *start)
static bool IsNestedFillRects(const SkPath &, SkRect rect[2], SkPathDirection dirs[2]=nullptr)
static bool IsSimpleRect(const SkPath &path, bool isSimpleFill, SkRect *rect, SkPathDirection *direction, unsigned *start)
static void ForceComputeConvexity(const SkPath &path)
static bool IsOval(const SkPath &path, SkRect *rect, SkPathDirection *dir, unsigned *start)
static SkPathFirstDirection AsFirstDirection(SkPathDirection dir)
static SkPathFirstDirection ComputeFirstDirection(const SkPath &)
static int LeadingMoveToCount(const SkPath &path)
static void AddGenIDChangeListener(const SkPath &path, sk_sp< SkIDChangeListener > listener)
static SkPathConvexity GetConvexityOrUnknown(const SkPath &path)
static void ShrinkToFit(SkPath *path)
SkPath::RangeIter RangeIter
void resetToSize(int newVerbCnt, int newPointCnt, int newConicCount)
SkPoint * growForRepeatedVerb(int verb, int numVbs, SkScalar **weights=nullptr)
uint8_t atVerb(int index) const
uint32_t getSegmentMasks() const
bool isClosedContour() const
void setPath(const SkPath &path, bool forceClose)
Verb next(SkPoint pts[4])
SkScalar conicWeight() const
size_t readFromMemory(const void *buffer, size_t length)
uint32_t getGenerationID() const
SkPath & addCircle(SkScalar x, SkScalar y, SkScalar radius, SkPathDirection dir=SkPathDirection::kCW)
SkPath & rConicTo(SkScalar dx1, SkScalar dy1, SkScalar dx2, SkScalar dy2, SkScalar w)
SkPoint getPoint(int index) const
SkPath & moveTo(SkScalar x, SkScalar y)
int getPoints(SkPoint points[], int max) const
void setFillType(SkPathFillType ft)
SkPath & lineTo(SkScalar x, SkScalar y)
SkPath & addPath(const SkPath &src, SkScalar dx, SkScalar dy, AddPathMode mode=kAppend_AddPathMode)
void toggleInverseFillType()
bool isInterpolatable(const SkPath &compare) const
bool interpolate(const SkPath &ending, SkScalar weight, SkPath *out) const
bool isOval(SkRect *bounds) const
SkPath & quadTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2)
const SkRect & getBounds() const
uint32_t getSegmentMasks() const
size_t writeToMemory(void *buffer) const
SkPath & addOval(const SkRect &oval, SkPathDirection dir=SkPathDirection::kCW)
SkPath & cubicTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar x3, SkScalar y3)
SkPath & conicTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar w)
SkPath & addOpenOval(const SkRect &oval, SkPathDirection dir, unsigned start)
bool isRect(SkRect *rect, bool *isClosed=nullptr, SkPathDirection *direction=nullptr) const
void transform(const SkMatrix &matrix, SkPath *dst, SkApplyPerspectiveClip pc=SkApplyPerspectiveClip::kYes) const
bool isRRect(SkRRect *rrect) const
SkPath & addRect(const SkRect &rect, SkPathDirection dir, unsigned start)
void incReserve(int extraPtCount, int extraVerbCount=0, int extraConicCount=0)
const SkRect & rect() const
static SkRRect MakeRectXY(const SkRect &rect, SkScalar xRad, SkScalar yRad)
void setRectRadii(const SkRect &rect, const SkVector radii[4])
void readPath(SkPath *path)
bool setPath(const SkPath &path, const SkRegion &clip)
void setStrokeStyle(SkScalar width, bool strokeAndFill=false)
bool isHairlineStyle() const
static sk_sp< SkVertices > MakeCopy(VertexMode mode, int vertexCount, const SkPoint positions[], const SkPoint texs[], const SkColor colors[], int indexCount, const uint16_t indices[])
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
EMSCRIPTEN_KEEPALIVE void empty()
static float max(float r, float g, float b)
static float min(float r, float g, float b)
unsigned useCenter Optional< SkMatrix > matrix
Optional< SkRect > bounds
sk_sp< SkBlender > blender SkRect rect
PODArray< SkColor > colors
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
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 defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets dir
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 defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
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 mode
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
font
Font Metadata and Metrics.
static constexpr SkPoint kPts[kPtsCount]
SK_API bool FillPathWithPaint(const SkPath &src, const SkPaint &paint, SkPath *dst, const SkRect *cullRect, SkScalar resScale=1)
int compare(const void *untyped_lhs, const void *untyped_rhs)
static SkImageInfo MakeN32Premul(int width, int height)
SkPath::RangeIter begin()
static constexpr SkPoint Make(float x, float y)
void set(float x, float y)
static constexpr SkRect MakeEmpty()
SkScalar fBottom
larger y-axis bounds
constexpr float left() const
constexpr float top() const
SkScalar fLeft
smaller x-axis bounds
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
SkScalar fRight
larger x-axis bounds
constexpr float centerX() const
void offset(float dx, float dy)
constexpr float height() const
constexpr float right() const
bool setBoundsCheck(const SkPoint pts[], int count)
void setLTRB(float left, float top, float right, float bottom)
void setBounds(const SkPoint pts[], int count)
constexpr float centerY() const
constexpr float width() const
constexpr SkPoint center() const
static constexpr SkRect MakeWH(float w, float h)
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)
constexpr float bottom() const
SkScalar fTop
smaller y-axis bounds
static constexpr SkSize Make(SkScalar w, SkScalar h)
std::shared_ptr< const fml::Mapping > data