8#ifndef SkLineParameters_DEFINED
9#define SkLineParameters_DEFINED
56 if (pts[0].fY > pts[endIndex].fY) {
65 if (pts[0].fY > pts[3].fY) {
72 fA = pts[
s].fY - pts[
e].fY;
73 fB = pts[
e].fX - pts[
s].fX;
74 fC = pts[
s].fX * pts[
e].fY - pts[
e].fX * pts[
s].fY;
79 if (part[0] == part[1] || ((
const SkDLine& ) part[0]).nearRay(part[2])) {
86 fA = pts[0].fY - pts[1].fY;
87 fB = pts[1].fX - pts[0].fX;
88 fC = pts[0].fX * pts[1].fY - pts[1].fX * pts[0].fY;
104 if (pts[0].fY > pts[2].fY) {
111 fA = pts[
s].fY - pts[
e].fY;
112 fB = pts[
e].fX - pts[
s].fX;
113 fC = pts[
s].fX * pts[
e].fY - pts[
e].fX * pts[
s].fY;
122 return fA * fA + fB * fB;
131 double reciprocal = 1 / normal;
139 double oneThird = 1 / 3.0;
140 for (
int index = 0; index < 4; ++index) {
141 distance[index].fX = index * oneThird;
142 distance[index].fY = fA * pts[index].fX + fB * pts[index].fY + fC;
147 double oneHalf = 1 / 2.0;
148 for (
int index = 0; index < 3; ++index) {
149 distance[index].fX = index * oneHalf;
150 distance[index].fY = fA * pts[index].fX + fB * pts[index].fY + fC;
156 return fA * pts[index].fX + fB * pts[index].fY + fC;
160 return fA * pts[1].fX + fB * pts[1].fY + fC;
164 return fA * pt.
fX + fB * pt.
fY + fC;
static bool approximately_zero(double x)
bool NotAlmostEqualUlps(float a, float b)
bool cubicEndPoints(const SkDCubic &pts)
double controlPtDistance(const SkDCubic &pts, int index) const
double cubicPart(const SkDCubic &part)
bool quadEndPoints(const SkDQuad &pts)
void cubicEndPoints(const SkDCubic &pts, int s, int e)
void quadEndPoints(const SkDQuad &pts, int s, int e)
void quadDistanceY(const SkDQuad &pts, SkDQuad &distance) const
double pointDistance(const SkDPoint &pt) const
void lineEndPoints(const SkDLine &pts)
void cubicDistanceY(const SkDCubic &pts, SkDCubic &distance) const
double quadPart(const SkDQuad &part)
double normalSquared() const
double controlPtDistance(const SkDQuad &pts) const
SIN Vec< N, float > sqrt(const Vec< N, float > &x)