Home | History | Annotate | Download | only in ccpr

Lines Matching refs:p1

40     Sk2f p1 = Sk2f::Load(P+1);
41 this->appendLine(p0, p1);
44 inline void GrCCFillGeometry::appendLine(const Sk2f& p0, const Sk2f& p1) {
46 if ((p0 == p1).allTrue()) {
49 p1.store(&fPoints.push_back());
64 static inline bool are_collinear(const Sk2f& p0, const Sk2f& p1, const Sk2f& p2,
72 // d = |p1 - p0| dot | l.y|
73 // |-l.x| = distance from p1 to l.
74 Sk2f dd = (p1 - p0) * SkNx_shuffle<1,0>(l);
77 // We are collinear if a box with radius "tolerance", centered on p1, touches the line l.
78 // To decide this, we check if the distance from p1 to the line is less than the distance from
79 // p1 to the far corner of this imaginary box, along that same normal vector.
80 // The far corner of the box can be found at "p1 + sign(n) * tolerance", where n is normal to l:
82 // abs(dot(p1 - p0, n)) <= dot(sign(n) * tolerance, n)
95 Sk4f::Load2(P, &Px, &Py); // |. . | = |p1 - p3|
140 Sk2f p1 = Sk2f::Load(P+1);
145 if (are_collinear(p0, p1, p2)) {
150 this->appendQuadratics(p0, p1, p2);
153 inline void GrCCFillGeometry::appendQuadratics(const Sk2f& p0, const Sk2f& p1, const Sk2f& p2) {
154 Sk2f tan0 = p1 - p0;
155 Sk2f tan1 = p2 - p1;
159 this->appendMonotonicQuadratic(p0, p1, p2);
169 // 0 = (dQ(t) dot n) = | 2*t 1 | * | p0 - 2*p1 + p2 | * | n |
170 // | -2*p0 + 2*p1 | | . |
184 Sk2f p12 = SkNx_fma(t, tan1, p1);
191 inline void GrCCFillGeometry::appendMonotonicQuadratic(const Sk2f& p0, const Sk2f& p1,
194 if (are_collinear(p0, p1, p2)) {
201 p1.store(&fPoints.push_back());
219 static inline void get_cubic_tangents(const Sk2f& p0, const Sk2f& p1, const Sk2f& p2,
221 *tan0 = first_unless_nearly_zero(p1 - p0, p2 - p0);
222 *tan1 = first_unless_nearly_zero(p3 - p2, p3 - p1);
225 static inline bool is_cubic_nearly_quadratic(const Sk2f& p0, const Sk2f& p1, const Sk2f& p2,
478 Sk2f p1 = Sk2f::Load(P+1);
484 get_cubic_tangents(p0, p1, p2, p3, &tan0, &tan1);
485 if (is_cubic_nearly_quadratic(p0, p1, p2, p3, tan0, tan1, &c)) {
499 Sk2f C0 = SkNx_fma(Sk2f(3), p1 - p2, p3 - p0);
501 ? SkNx_fma(Sk2f(-2), p1, p0 + p2)
502 : p1 - p0) * 3;
526 this->appendCubics(AppendCubicMode::kLiteral, p0, p1, p2, p3, chops.begin(), chops.count());
529 static inline void chop_cubic(const Sk2f& p0, const Sk2f& p1, const Sk2f& p2, const Sk2f& p3,
532 *ab = lerp(p0, p1, TT);
533 Sk2f bc = lerp(p1, p2, TT);
540 void GrCCFillGeometry::appendCubics(AppendCubicMode mode, const Sk2f& p0, const Sk2f& p1,
552 this->appendCubics(rightMode, p0, p1, p2, p3, &chops[midChopIdx + 1],
559 this->appendCubics(mode, p0, p1, p2, p3, chops, midChopIdx, localT0, localT1);
565 chop_cubic(p0, p1, p2, p3, localT, &p01, &p02, &pT, &p11, &p12);
572 this->appendCubics(mode, p0, p1, p2, p3);
575 void GrCCFillGeometry::appendCubics(AppendCubicMode mode, const Sk2f& p0, const Sk2f& p1,
591 get_cubic_tangents(p0, p1, p2, p3, &tan0, &tan1);
594 this->chopAndAppendCubicAtMidTangent(mode, p0, p1, p2, p3, tan0, tan1,
601 if (!is_cubic_nearly_quadratic(p0, p1, p2, p3, tan0, tan1, &c) && maxSubdivisions) {
602 this->chopAndAppendCubicAtMidTangent(mode, p0, p1, p2, p3, tan0, tan1,
614 if (are_collinear(p0, (p1 + p2) * .5f, p3)) {
621 p1.store(&fPoints.push_back());
672 const Sk2f& p1, const Sk2f& p2,
676 float midT = find_midtangent(tan0, tan1, p3 + (p1 - p2)*3 - p0,
677 (p0 - p1*2 + p2)*2,
678 p1 - p0);
688 chop_cubic(p0, p1, p2, p3, midT, &p01, &p02, &pT, &p11, &p12);
697 Sk2f p1 = Sk2f::Load(P+1);
700 Sk2f tan0 = p1 - p0;
701 Sk2f tan1 = p2 - p1;
710 (p2 - p0) - 2*w*(p1 - p0),
711 w*(p1 - p0));
723 Sk4f p3d1 = Sk4f(p1[0], p1[1], 1, 0) * w;
739 this->appendMonotonicConic(p0, p1, p2, w);
742 void GrCCFillGeometry::appendMonotonicConic(const Sk2f& p0, const Sk2f& p1, const Sk2f& p2,
751 Sk2f d = (p1 - p0) * SkNx_shuffle<1,0>(base);
752 float h1 = std::abs(d[1] - d[0]); // Height of p1 above the base.
764 // If we get within 1px of p1 when w > 1, we will pick up artifacts from the implicit
766 Sk2f p1w = p1*w;
777 p1.store(&fPoints.push_back());