23 rotPath[index].fY =
cubic[zero].fY;
25 int side1 = index ^ mask;
26 int side2 = zero ^ mask;
28 rotPath[side1].fY =
cubic[zero].fY;
31 rotPath[side2].fY =
cubic[zero].fY;
36 for (
int i = 0;
i < 4; ++
i) {
46 return (
x > 0) + (
x >= 0);
64 for (index = 1; index < 4; ++index) {
66 &&
fPts[yMin].fX >
fPts[index].fX)) {
73 for (
int pass = 0; pass < 2; ++pass) {
74 for (index = 0; index < 4; ++index) {
82 int side1 = yMin ^ mask;
83 int side2 = index ^ mask;
85 if (!
rotate(*
this, yMin, index, rotPath)) {
90 int sides =
side(rotPath[side1].fY - rotPath[yMin].fY);
91 sides ^=
side(rotPath[side2].fY - rotPath[yMin].fY);
110 double smallest1distSq =
std::min(dist1_0, dist1_3);
111 double smallest2distSq =
std::min(dist2_0, dist2_3);
113 order[2] = smallest1distSq < smallest2distSq ? 2 : 1;
118 }
else if (sides == 0) {
125 if (backupYMin < 0) {
135 int least = yMin ^ mask;
136 int most = midX ^ mask;
142 if (!
rotate(*
this, least, most, midPath)) {
146 int midSides =
side(midPath[yMin].fY - midPath[least].fY);
147 midSides ^=
side(midPath[midX].fY - midPath[least].fY);
static bool approximately_zero(double x)
static bool rotate(const SkDCubic &cubic, int zero, int index, SkDCubic &rotPath)
static int side(double x)
int other_two(int one, int two)
bool approximately_equal(double x, double y)
static float min(float r, float g, float b)
skia_private::AutoTArray< sk_sp< SkImageFilter > > filters TypedMatrix matrix TypedMatrix matrix SkScalar dx
int convexHull(char order[kPointCount]) const
SkDPoint fPts[kPointCount]
double distanceSquared(const SkDPoint &a) const