51 for (
int i = 0;
i < 7; ++
i) {
55 for (
int i = 0;
i < 7; ++
i) {
61 static const float chopTs[] = {
62 0, 3/83.f, 3/79.f, 3/73.f, 3/71.f, 3/67.f, 3/61.f, 3/59.f, 3/53.f, 3/47.f, 3/43.f, 3/41.f,
63 3/37.f, 3/31.f, 3/29.f, 3/23.f, 3/19.f, 3/17.f, 3/13.f, 3/11.f, 3/7.f, 3/5.f, 1,
65 float ones[] = {1,1,1,1,1};
69 static_assert(
std::size(chopTs) % 2 == 1);
73 for (
int iterIdx = 0; iterIdx < 5; ++iterIdx) {
80 for (
float chopT : chopTs) {
122 for (
size_t index = 3; index <
std::size(oneChops); ++index) {
132 SkDebugf(
"%s [%d %g] p0 [%10.8f %10.8f] p1 [%10.8f %10.8f]\n",
133 name, index, t, x0, y0, x1, y1);
140 for (
int i = 0;
i < 1000; ++
i) {
142 for (
int j = 0; j < 3; ++j) {
147 for (
int j = 1; j < 128; ++j) {
165 conic.evalAt(t, &p0,
nullptr);
166 p1 =
conic.evalAt(t);
172 conic.evalAt(t,
nullptr, &v0);
173 v1 =
conic.evalTangentAt(t);
179 for (
int i = 0;
i < 1000; ++
i) {
181 for (
int j = 0; j < 3; ++j) {
184 for (
int k = 0; k < 10; ++k) {
190 for (
int j = 1; j < 128; ++j) {
201 {10, 20}, {10, 20}, {20, 30},
202 {10, 20}, {15, 25}, {20, 30},
203 {10, 20}, {20, 30}, {20, 30},
206 for (
int index = 0; index <
count; ++index) {
221 { 10, 20}, {10, 20}, {20, 30},
222 { 10, 20}, {15, 25}, {20, 30},
223 { 10, 20}, {20, 30}, {20, 30}
226 for (
int index = 0; index <
count; ++index) {
243 const int pcount = qcount * 2 + 1;
256 { 0, 0 }, { 1, 0 }, { 1, 1 },
257 { 0, 0 }, { 3.58732e-43f, 2.72084f }, { 3.00392f, 3.00392f },
258 { 0, 0 }, { 100000, 0 }, { 100000, 100000 },
259 { 0, 0 }, { 1e30f, 0 }, { 1e30f, 1e30f },
261 const int N =
sizeof(triples) /
sizeof(
SkPoint);
263 for (
int i = 0;
i <
N;
i += 3) {
277 { 10, 20}, {10, 20}, {20, 30}, {30, 40},
278 { 10, 20}, {15, 25}, {20, 30}, {30, 40},
279 { 10, 20}, {20, 30}, {30, 40}, {30, 40},
282 for (
int index = 0; index <
count; ++index) {
297 const std::array<SkPoint, 4>& bezierPoints,
SkCubicType expectedType,
298 bool undefined =
false) {
303 "%d != %d", (
int)actualType, (
int)expectedType);
308 float x1,
float y1,
float x2,
float y2,
309 bool undefined =
false) {
338 std::array<SkPoint, 4> bezier;
339 for (
int i=0;
i < 4; ++
i) {
341 for (
int j=0; j < 3; ++j) {
342 int jidx = (j <
i) ? j : j+1;
344 for (
int k=0, kidx=0; k < 2; ++k, ++kidx) {
345 for (
int n = 0; n < 2; ++n) {
346 kidx = (kidx ==
i || kidx == jidx) ? kidx+1 : kidx;
349 for (
int l = 0; l < 4; ++l) {
350 if (l !=
i && l != jidx && l != kidx) {
359 for (
int i=0;
i < 4; ++
i) {
361 for (
int j=0; j < 3; ++j) {
362 int jidx = (j <
i) ? j : j+1;
365 for (
int k=0, kidx=0; k < 2; ++k, ++kidx) {
366 for (
int n = 0; n < 2; ++n) {
367 kidx = (kidx ==
i || kidx == jidx) ? kidx+1 : kidx;
377 {{{149.325f, 107.705f}, {149.325f, 103.783f}, {151.638f, 100.127f}, {156.263f, 96.736f}}},
378 {{{225.694f, 223.15f}, {209.831f, 224.837f}, {195.994f, 230.237f}, {184.181f, 239.35f}}},
379 {{{4.873f, 5.581f}, {5.083f, 5.2783f}, {5.182f, 4.8593f}, {5.177f, 4.3242f}}},
380 {{{285.625f, 499.687f}, {411.625f, 808.188f}, {1064.62f, 135.688f}, {1042.63f, 585.187f}}}
383static std::array<SkPoint, 4>
kLoops[] = {
384 {{{635.625f, 614.687f}, {171.625f, 236.188f}, {1064.62f, 135.688f}, {516.625f, 570.187f}}},
385 {{{653.050f, 725.049f}, {663.000f, 176.000f}, {1189.000f, 508.000f}, {288.050f, 564.950f}}},
386 {{{631.050f, 478.049f}, {730.000f, 302.000f}, {870.000f, 350.000f}, {905.050f, 528.950f}}},
387 {{{631.050f, 478.0499f}, {221.000f, 230.000f}, {1265.000f, 451.000f}, {905.050f, 528.950f}}}
391 {{{0, 0}, {0, 1}, {0, 2}, {0, 3}}},
392 {{{0, 0}, {1, 0}, {1, 0}, {0, 0}}},
393 {{{0, 1}, {0, 0}, {0, 2}, {0, 3}}},
394 {{{0, 1}, {0, 0}, {0, 3}, {0, 2}}},
395 {{{0, 0}, {2, 0}, {1, 0}, {64, 0}}},
396 {{{1, 0}, {0, 0}, {3, 0}, {-64, 0}}}
403 for (
const auto& loop :
kLoops) {
426 -std::numeric_limits<float>::infinity(),
427 -std::numeric_limits<float>::infinity(),
428 +std::numeric_limits<float>::infinity(),
429 +std::numeric_limits<float>::infinity(),
432 0, 0, 1, +std::numeric_limits<float>::infinity(),
true);
434 -std::numeric_limits<float>::quiet_NaN(),
435 -std::numeric_limits<float>::quiet_NaN(),
436 +std::numeric_limits<float>::quiet_NaN(),
437 +std::numeric_limits<float>::quiet_NaN(),
440 0, 0, 1, +std::numeric_limits<float>::quiet_NaN(),
true);
443static std::array<SkPoint, 4>
kCusps[] = {
444 {{{0, 0}, {1, 1}, {1, 0}, {0, 1}}},
445 {{{0, 0}, {1, 1}, {0, 1}, {1, 0}}},
446 {{{0, 1}, {1, 0}, {0, 0}, {1, 1}}},
447 {{{0, 1}, {1, 0}, {1, 1}, {0, 0}}},
451 std::array<SkPoint, 4> noCusps[] = {
452 {{{0, 0}, {1, 1}, {2, 2}, {3, 3}}},
453 {{{0, 0}, {1, 0}, {1, 1}, {0, 1}}},
454 {{{0, 0}, {1, 0}, {2, 1}, {2, 2}}},
455 {{{0, 0}, {1, 0}, {1, 1}, {2, 1}}},
457 for (
auto noCusp : noCusps) {
460 for (
auto cusp :
kCusps) {
475 m.mapPoints(mapped, pts, 3);
495 for (
int i = 0;
i < n; ++
i) {
514 float expectedChoppedRotation = fullRotation/2;
519 expectedChoppedRotation = (fullRotation -
SK_ScalarPI)/2;
528static std::array<SkPoint, 3>
kQuads[] = {
529 {{{10, 20}, {15, 35}, {30, 40}}},
530 {{{176.324f, 392.705f}, {719.325f, 205.782f}, {297.263f, 347.735f}}},
531 {{{652.050f, 602.049f}, {481.000f, 533.000f}, {288.050f, 564.950f}}},
532 {{{460.625f, 557.187f}, {707.121f, 209.688f}, {779.628f, 577.687f}}},
533 {{{359.050f, 578.049f}, {759.000f, 274.000f}, {288.050f, 564.950f}}}
537 return a * (1 - t) +
b * t;
541 static SkPoint kFlatCubic[4] = {{0, 0}, {0, 1}, {0, 2}, {0, 3}};
544 static SkPoint kFlatCubic180_1[4] = {{0, 0}, {1, 0}, {3, 0}, {2, 0}};
548 static SkPoint kFlatCubic180_2[4] = {{0, 1}, {0, 0}, {0, 2}, {0, 3}};
552 static SkPoint kFlatCubic360[4] = {{0, 1}, {0, 0}, {0, 3}, {0, 2}};
556 static SkPoint kSquare180[4] = {{0, 0}, {0, 1}, {1, 1}, {1, 0}};
560 auto checkQuadRotation = [=](
const SkPoint pts[3],
float expectedRotation) {
564 SkPoint cubic1[4] = {pts[0], pts[0], pts[1], pts[2]};
568 SkPoint cubic2[4] = {pts[0], pts[1], pts[1], pts[2]};
572 SkPoint cubic3[4] = {pts[0], pts[1], pts[2], pts[2]};
577 static SkPoint kFlatQuad[4] = {{0, 0}, {0, 1}, {0, 2}};
578 checkQuadRotation(kFlatQuad, 0);
580 static SkPoint kFlatQuad180_1[4] = {{1, 0}, {0, 0}, {2, 0}};
583 static SkPoint kFlatQuad180_2[4] = {{0, 0}, {0, 2}, {0, 1}};
595 for (
int i = 0;
i < n; ++
i) {
599 for (
const auto& loop :
kLoops) {
607 for (
const auto& cusp :
kCusps) {
611 for (
const auto& quad :
kQuads) {
614 quad[0],
lerp(quad[0], quad[1], 2/3.f),
lerp(quad[1], quad[2], 1/3.f), quad[2]};
618 static const SkPoint kExactQuad[4] = {{0,0}, {6,2}, {10,2}, {12,0}};
622 static const SkPoint kExactCuspAtInf[4] = {{0,0}, {1,0}, {0,1}, {1,1}};
625 for (
int i = 0;
i < n; ++
i) {
642 pts[0].
set(15.1213f, 7.77647f);
643 pts[1].
set(6.2168e+19f, 1.51338e+20f);
644 pts[2].
set(1.4579e+19f, 1.55558e+21f);
652 { 0, 0, }, { 2, 0, }, { 3, 1, }, { 3, 3 },
654 for (
int i = 0;
i < 4; ++
i) {
676 "Invalid test case. 4th point's Y should be %f", yToChopAt);
682 for (
int i = 0;
i < 7; ++
i) {
684 "(%f, %f) != (%f, %f) at index %d",
685 expectedOutputs[
i].
x(), expectedOutputs[
i].
y(),
694 {{ 0, 0 }, { 0, 0 }, { 10, 10 }, { 10, 10 }},
696 {{ 0.000000f, 0.000000f }, { 0.000000f, 0.000000f }, { 1.065055f, 1.065055f },
697 { 2.500000f, 2.500000f },
698 { 5.461981f, 5.461981f }, { 10.000000f, 10.000000f }, { 10.000000f, 10.000000f }}
701 {{ 0, 0 }, { 0, 0 }, { 10, 10 }, { 10, 10 }},
703 {{ 0.000000f, 0.000000f }, { 0.000000f, 0.000000f }, { 2.500000f, 2.500000f },
704 { 5.000000f, 5.000000f },
705 { 7.500000f, 7.500000f }, { 10.000000f, 10.000000f }, { 10.000000f, 10.000000f }}
708 {{ 0, 0 }, { 0, 0 }, { 10, 10 }, { 10, 10 }},
710 {{ 0.000000f, 0.000000f }, { 0.000000f, 0.000000f }, { 6.467375f, 6.467375f },
711 { 9.000000f, 9.000000f },
712 { 9.616623f, 9.616623f }, { 10.000000f, 10.000000f }, { 10.000000f, 10.000000f }}
715 {{ 0, 0 }, { 0, 0 }, { 10, 10 }, { 10, 10 }},
717 {{ 0.000000f, 0.000000f }, { 0.000000f, 0.000000f }, { 10.000000f, 10.000000f },
718 { 10.000000f, 10.000000f },
719 { 10.000000f, 10.000000f }, { 10.000000f, 10.000000f }, { 10.000000f, 10.000000f }}
723 {{ 1, 1 }, { 5, 2 }, { 7, 4 }, { 8, 7 }},
725 {{ 1.000000f, 1.000000f }, { 2.055050f, 1.263763f }, { 2.970959f, 1.597096f },
726 { 3.766077f, 2.000000f },
727 { 5.985480f, 3.124621f }, { 7.263762f, 4.791288f }, { 8.000000f, 7.000000f }}
730 {{ 1, 1 }, { 5, 2 }, { 7, 4 }, { 8, 7 }},
732 {{ 1.000000f, 1.000000f }, { 4.033223f, 1.758306f }, { 5.916391f, 3.091639f },
733 { 7.085550f, 5.000000f },
734 { 7.458195f, 5.608251f }, { 7.758306f, 6.274917f }, { 8.000000f, 7.000000f }}
738 {{ 2, 7 }, { 3, 2 }, { 6, 3 }, { 11, 2 }},
740 {{ 2.000000f, 7.000000f }, { 2.162856f, 6.185719f }, { 2.378757f, 5.530570f },
741 { 2.647702f, 5.000000f },
742 { 4.030182f, 2.272668f }, { 6.814281f, 2.837144f }, { 11.000000f, 2.000000f }}
745 {{ 2, 7 }, { 3, 2 }, { 6, 3 }, { 11, 2 }},
747 {{ 2.000000f, 7.000000f }, { 2.500000f, 4.500000f }, { 3.500000f, 3.500000f },
748 { 5.000000f, 3.000000f },
749 { 6.500000f, 2.500000f }, { 8.500000f, 2.500000f }, { 11.000000f, 2.000000f }}
752 {{ 2, 7 }, { 3, 2 }, { 6, 3 }, { 11, 2 }},
754 {{ 2.000000f, 7.000000f }, { 2.750000f, 3.250000f }, { 4.625000f, 2.875000f },
755 { 7.625000f, 2.500000f },
756 { 8.625000f, 2.375000f }, { 9.750000f, 2.250000f }, { 11.000000f, 2.000000f }}
763 {{ 11, 2 }, { 6, 3 }, { 3, 2 }, { 2, 7 }},
765 {{ 11.000000f, 2.000000f }, { 6.814281f, 2.837144f }, { 4.030182f, 2.272668f },
766 { 2.647702f, 5.000000f },
767 { 2.378757f, 5.530570f }, { 2.162856f, 6.185719f }, { 2.000000f, 7.000000f }}
770 {{ 11, 2 }, { 6, 3 }, { 3, 2 }, { 2, 7 }},
772 {{ 11.000000f, 2.000000f }, { 8.500000f, 2.500000f }, { 6.500000f, 2.500000f },
773 { 5.000000f, 3.000000f },
774 { 3.500000f, 3.500000f }, { 2.500000f, 4.500000f }, { 2.000000f, 7.000000f }}
777 {{ 11, 2 }, { 6, 3 }, { 3, 2 }, { 2, 7 }},
779 {{ 11.000000f, 2.000000f }, { 9.750000f, 2.250000f }, { 8.625000f, 2.375000f },
780 { 7.625000f, 2.500000f },
781 { 4.625000f, 2.875000f }, { 2.750000f, 3.250000f }, { 2.000000f, 7.000000f }}
785 {{ -2, 100 }, { 0, 0 }, { 0, 0 }, { 100, -2 }},
787 {{ -2.000000f,100.000000f }, { -1.930979f, 96.548965f }, { -1.864341f, 93.217033f },
788 { -1.795892f, 90.000000f },
789 { 0.119096f, -0.002382f }, { 3.451032f, -0.069021f }, {100.000000f, -2.000000f }}
792 {{ -2, 100 }, { 0, 0 }, { 0, 0 }, { 100, -2 }},
794 {{ -2.000000f,100.000000f }, { -0.937505f, 46.875271f }, { -0.439458f, 21.972910f },
795 { 14.787060f, 10.000000f },
796 { 28.222368f, -0.564447f }, { 53.124729f, -1.062495f }, {100.000000f, -2.000000f }}
799 {{ -2, 100 }, { 0, 0 }, { 0, 0 }, { 100, -2 }},
801 {{ -2.000000f,100.000000f }, { -0.426983f, 21.349131f }, { -0.091157f, 4.557854f },
802 { 48.633648f, 0.000000f },
803 { 61.859592f, -1.237192f }, { 78.650871f, -1.573017f }, {100.000000f, -2.000000f }}
807 {{-250.121582f, -1180.09509f}, {10.007843f, -1180.09509f},
808 {20.015685f, -786.041259f}, {40.0313721f, 2.0664072f}},
810 {{-250.121582f, -1180.095093f}, {9.780392f, -1180.095093f}, {19.997992f, -786.730042f},
811 {39.978889f, 0.000000f},
812 {39.996376f, 0.688501f}, {40.013870f, 1.377304f}, {40.031372f, 2.066407f}}
817 SkPoint inputs[] = {{ 0, 0 }, { 0, 0 }, { 10, 10 }, { 10, 10 }};
831 "Invalid test case. Input curve should have 4 points");
833 "Invalid test case. Outputs should have 7 points");
835 "Invalid test case. 4th point's X should be %f", xToChopAt);
841 for (
int i = 0;
i < 7; ++
i) {
843 "(%f, %f) != (%f, %f) at index %d",
844 expectedOutputs[
i].
x(), expectedOutputs[
i].
y(),
853 {{ 0, 0 }, { 0, 0 }, { 10, 10 }, { 10, 10 }},
855 {{ 0.000000f, 0.000000f }, { 0.000000f, 0.000000f }, { 1.065055f, 1.065055f },
856 { 2.500000f, 2.500000f },
857 { 5.461981f, 5.461981f }, { 10.000000f, 10.000000f }, { 10.000000f, 10.000000f }}
860 {{ 0, 0 }, { 0, 0 }, { 10, 10 }, { 10, 10 }},
862 {{ 0.000000f, 0.000000f }, { 0.000000f, 0.000000f }, { 2.500000f, 2.500000f },
863 { 5.000000f, 5.000000f },
864 { 7.500000f, 7.500000f }, { 10.000000f, 10.000000f }, { 10.000000f, 10.000000f }}
867 {{ 0, 0 }, { 0, 0 }, { 10, 10 }, { 10, 10 }},
869 {{ 0.000000f, 0.000000f }, { 0.000000f, 0.000000f }, { 6.467375f, 6.467375f },
870 { 9.000000f, 9.000000f },
871 { 9.616623f, 9.616623f }, { 10.000000f, 10.000000f }, { 10.000000f, 10.000000f }}
874 {{ 0, 0 }, { 0, 0 }, { 10, 10 }, { 10, 10 }},
876 {{ 0.000000f, 0.000000f }, { 0.000000f, 0.000000f }, { 10.000000f, 10.000000f },
877 { 10.000000f, 10.000000f },
878 { 10.000000f, 10.000000f }, { 10.000000f, 10.000000f }, { 10.000000f, 10.000000f }}
882 {{ 1, 1 }, { 5, 2 }, { 7, 4 }, { 8, 7 }},
884 {{ 1.000000f, 1.000000f }, { 1.348275f, 1.087069f }, { 1.681389f, 1.181719f },
885 { 2.000000f, 1.283949f },
886 { 5.340694f, 2.355856f }, { 7.087069f, 4.261207f }, { 8.000000f, 7.000000f }}
889 {{ 1, 1 }, { 5, 2 }, { 7, 4 }, { 8, 7 }},
891 {{ 1.000000f, 1.000000f }, { 2.650396f, 1.412599f }, { 3.960316f, 1.995436f },
892 { 5.000000f, 2.748511f },
893 { 6.480158f, 3.820634f }, { 7.412599f, 5.237797f }, { 8.000000f, 7.000000f }}
897 {{ 2, 7 }, { 3, 2 }, { 6, 3 }, { 11, 2 }},
899 {{ 2.000000f, 7.000000f }, { 2.500000f, 4.500000f }, { 3.500000f, 3.500000f },
900 { 5.000000f, 3.000000f },
901 { 6.500000f, 2.500000f }, { 8.500000f, 2.500000f }, { 11.000000f, 2.000000f }}
904 {{ 2, 7 }, { 3, 2 }, { 6, 3 }, { 11, 2 }},
906 {{ 2.000000f, 7.000000f }, { 2.228714f, 5.856432f }, { 2.562047f, 5.026724f },
907 { 3.000000f, 4.415163f },
908 { 4.476901f, 2.352807f }, { 7.143568f, 2.771286f }, { 11.000000f, 2.000000f }}
911 {{ 2, 7 }, { 3, 2 }, { 6, 3 }, { 11, 2 }},
913 {{ 2.000000f, 7.000000f }, { 2.131881f, 6.340593f }, { 2.298548f, 5.785543f },
914 { 2.500000f, 5.316498f },
915 { 3.826073f, 2.228977f }, { 6.659407f, 2.868119f }, { 11.000000f, 2.000000f }}
922 {{ 11, 2 }, { 6, 3 }, { 3, 2 }, { 2, 7 }},
924 {{ 11.000000f, 2.000000f }, { 8.500000f, 2.500000f }, { 6.500000f, 2.500000f },
925 { 5.000000f, 3.000000f },
926 { 3.500000f, 3.500000f }, { 2.500000f, 4.500000f }, { 2.000000f, 7.000000f }}
929 {{ 11, 2 }, { 6, 3 }, { 3, 2 }, { 2, 7 }},
931 {{ 11.000000f, 2.000000f }, { 7.143568f, 2.771286f }, { 4.476901f, 2.352807f },
932 { 3.000000f, 4.415163f },
933 { 2.562047f, 5.026724f }, { 2.228714f, 5.856432f }, { 2.000000f, 7.000000f }}
936 {{ 11, 2 }, { 6, 3 }, { 3, 2 }, { 2, 7 }},
938 {{ 11.000000f, 2.000000f }, { 6.659407f, 2.868119f }, { 3.826073f, 2.228977f },
939 { 2.500000f, 5.316498f },
940 { 2.298548f, 5.785543f }, { 2.131881f, 6.340593f }, { 2.000000f, 7.000000f }}
944 {{ -2, 100 }, { 0, 0 }, { 0, 0 }, { 100, -2 }},
946 {{ -2.000000f,100.000000f }, { -0.069021f, 3.451032f }, { -0.002382f, 0.119096f },
947 { 90.000000f, -1.795892f },
948 { 93.217033f, -1.864341f }, { 96.548965f, -1.930979f }, {100.000000f, -2.000000f }}
951 {{ -2, 100 }, { 0, 0 }, { 0, 0 }, { 100, -2 }},
953 {{ -2.000000f,100.000000f }, { -1.062495f, 53.124729f }, { -0.564447f, 28.222368f },
954 { 10.000000f, 14.787060f },
955 { 21.972910f, -0.439458f }, { 46.875271f, -0.937505f }, {100.000000f, -2.000000f }}
958 {{ -2, 100 }, { 0, 0 }, { 0, 0 }, { 100, -2 }},
960 {{ -2.000000f,100.000000f }, { -1.573017f, 78.650871f }, { -1.237192f, 61.859592f },
961 { 0.000000f, 48.633648f },
962 { 4.557854f, -0.091157f }, { 21.349131f, -0.426983f }, {100.000000f, -2.000000f }}
967 SkPoint inputs[] = {{ 0, 0 }, { 0, 0 }, { 10, 10 }, { 10, 10 }};
static std::array< SkPoint, 4 > kCusps[]
static void test_conic_to_quads(skiatest::Reporter *reporter)
static bool nearly_equal(const SkPoint &a, const SkPoint &b)
static void testChopCubic(skiatest::Reporter *reporter)
static std::array< SkPoint, 4 > kLoops[]
static void test_measure_rotation(skiatest::Reporter *reporter)
static void test_chop_cubic_at_midtangent(skiatest::Reporter *reporter, const SkPoint pts[4], SkCubicType cubicType)
static SkMatrix kSkewMatrices[]
static void test_conic_eval_pos(skiatest::Reporter *reporter, const SkConic &conic, SkScalar t)
static void check_cubic_around_rect(std::string name, skiatest::Reporter *reporter, float x1, float y1, float x2, float y2, bool undefined=false)
DEF_TEST(Geometry, reporter)
static void test_chop_at_midtangent(skiatest::Reporter *reporter)
static std::array< SkPoint, 4 > kSerpentines[]
static void test_classify_cubic(skiatest::Reporter *reporter)
static void testChopMonoCubicAtX(skiatest::Reporter *reporter, std::string name, SkSpan< const SkPoint > curveInputs, SkScalar xToChopAt, SkSpan< const SkPoint > expectedOutputs)
static void test_conic_eval_tan(skiatest::Reporter *reporter, const SkConic &conic, SkScalar t)
static void check_cubic_type(skiatest::Reporter *reporter, const std::array< SkPoint, 4 > &bezierPoints, SkCubicType expectedType, bool undefined=false)
static std::array< SkPoint, 3 > kQuads[]
static void test_conic_tangents(skiatest::Reporter *reporter)
static void test_conic(skiatest::Reporter *reporter)
static void test_cubic_cusps(skiatest::Reporter *reporter)
static void check_pairs(skiatest::Reporter *reporter, int index, SkScalar t, const char name[], SkScalar x0, SkScalar y0, SkScalar x1, SkScalar y1)
static std::array< SkPoint, 4 > kLinearCubics[]
static void test_this_conic_to_quad(skiatest::Reporter *r, const SkPoint pts[3], SkScalar w)
static void test_cubic_tangents(skiatest::Reporter *reporter)
static void testChopMonoCubicAtY(skiatest::Reporter *reporter, std::string name, SkSpan< const SkPoint > curveInputs, SkScalar yToChopAt, SkSpan< const SkPoint > expectedOutputs)
SkPoint lerp(const SkPoint &a, const SkPoint &b, float t)
static void test_evalquadat(skiatest::Reporter *reporter)
static void test_quad_tangents(skiatest::Reporter *reporter)
static void test_chop_quad_at_midtangent(skiatest::Reporter *reporter, const SkPoint pts[3])
static constexpr float kTolerance
static const int points[]
static bool eq(const SkM44 &a, const SkM44 &b, float tol)
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static bool SkIsFinite(T x, Pack... values)
int SkChopCubicAtInflections(const SkPoint src[4], SkPoint dst[10])
float SkMeasureNonInflectCubicRotation(const SkPoint pts[4])
void SkChopCubicAt(const SkPoint src[4], SkPoint dst[7], SkScalar t)
void SkEvalCubicAt(const SkPoint src[4], SkScalar t, SkPoint *loc, SkVector *tangent, SkVector *curvature)
SkScalar SkFindCubicCusp(const SkPoint src[4])
void SkConvertQuadToCubic(const SkPoint src[3], SkPoint dst[4])
SkVector SkEvalQuadTangentAt(const SkPoint src[3], SkScalar t)
SkCubicType SkClassifyCubic(const SkPoint P[4], double t[2], double s[2], double d[4])
void SkEvalQuadAt(const SkPoint src[3], SkScalar t, SkPoint *pt, SkVector *tangent)
bool SkChopMonoCubicAtY(const SkPoint src[4], SkScalar y, SkPoint dst[7])
int SkChopCubicAtMaxCurvature(const SkPoint src[4], SkPoint dst[13], SkScalar tValues[3])
bool SkChopMonoCubicAtX(const SkPoint src[4], SkScalar x, SkPoint dst[7])
int SkChopQuadAtMaxCurvature(const SkPoint src[3], SkPoint dst[5])
void SkChopCubicAtMidTangent(const SkPoint src[4], SkPoint dst[7])
void SkChopQuadAtMidTangent(const SkPoint src[3], SkPoint dst[5])
float SkMeasureQuadRotation(const SkPoint pts[3])
static bool SkScalarNearlyZero(SkScalar x, SkScalar tolerance=SK_ScalarNearlyZero)
static bool SkScalarNearlyEqual(SkScalar x, SkScalar y, SkScalar tolerance=SK_ScalarNearlyZero)
#define REPORTER_ASSERT(r, cond,...)
const SkPoint * computeQuads(const SkConic &conic, SkScalar tol)
void mapPoints(SkPoint dst[], const SkPoint src[], int count) const
static SkMatrix MakeAll(SkScalar scaleX, SkScalar skewX, SkScalar transX, SkScalar skewY, SkScalar scaleY, SkScalar transY, SkScalar pers0, SkScalar pers1, SkScalar pers2)
static bool AreFinite(const SkPoint array[], int count)
constexpr T * begin() const
constexpr size_t size() const
static float max(float r, float g, float b)
static float min(float r, float g, float b)
DEF_SWITCHES_START aot vmservice shared library name
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
SIN Vec< N, float > abs(const Vec< N, float > &x)
SIN Vec< N, float > sqrt(const Vec< N, float > &x)
void set(float x, float y)
float cross(const SkVector &vec) const
constexpr float y() const
constexpr float x() const