Lines Matching defs:quad

118 struct SkQuadConstruct {    // The state of the quad stroke under construction.
119 SkPoint fQuad[3]; // the stroked quad parallel to the original curve
214 kSplit_ResultType, // the caller should split the quad stroke in two
216 kQuad_ResultType, // the caller should (continue to try to) add a quad stroke
241 static ReductionType CheckQuadLinear(const SkPoint quad[3], SkPoint* reduction);
244 ResultType compareQuadQuad(const SkPoint quad[3], SkQuadConstruct* );
257 bool ptInQuadBounds(const SkPoint quad[3], const SkPoint& pt) const;
258 void quadPerpRay(const SkPoint quad[3], SkScalar t, SkPoint* tPt, SkPoint* onPt,
260 bool quadStroke(const SkPoint quad[3], SkQuadConstruct* );
267 void setQuadEndNormal(const SkPoint quad[3],
483 void SkPathStroker::setQuadEndNormal(const SkPoint quad[3], const SkVector& normalAB,
485 if (!set_normal_unitnormal(quad[1], quad[2], fResScale, fRadius, normalBC, unitNormalBC)) {
602 /* Given quad, see if all there points are in a line.
609 static bool quad_in_line(const SkPoint quad[3]) {
615 SkVector testDiff = quad[inner] - quad[index];
630 return pt_to_line(quad[mid], quad[outer1], quad[outer2]) <= lineSlop;
699 SkPathStroker::ReductionType SkPathStroker::CheckQuadLinear(const SkPoint quad[3],
701 bool degenerateAB = degenerate_vector(quad[1] - quad[0]);
702 bool degenerateBC = degenerate_vector(quad[2] - quad[1]);
709 if (!quad_in_line(quad)) {
712 SkScalar t = SkFindQuadMaxCurvature(quad);
716 *reduction = SkEvalQuadAt(quad, t);
759 const SkPoint quad[3] = { fPrevPt, pt1, pt2 };
761 ReductionType reductionType = CheckQuadLinear(quad, &reduction);
789 (void) this->quadStroke(quad, &quadPts);
791 (void) this->quadStroke(quad, &quadPts);
792 this->setQuadEndNormal(quad, normalAB, unitAB, &normalBC, &unitBC);
893 // Given a quad and t, return the point on curve, its perpendicular, and the perpendicular tangent.
894 void SkPathStroker::quadPerpRay(const SkPoint quad[3], SkScalar t, SkPoint* tPt, SkPoint* onPt,
897 SkEvalQuadAt(quad, t, tPt, &dxy);
899 dxy = quad[2] - quad[0];
904 // Find the intersection of the stroke tangents to construct a stroke quad.
905 // Return whether the stroke is a degenerate (a line), a quad, or must be split.
906 // Optionally compute the quad's control point.
928 if ((numerA >= 0) == (numerB >= 0)) { // if the control point is outside the quad ends
929 // if the perpendicular distances from the quad points to the opposite tangent line
968 // Intersect the line with the quad and return the t values on the quad where the line crosses.
969 static int intersect_quad_ray(const SkPoint line[2], const SkPoint quad[3], SkScalar roots[2]) {
973 r[n] = (quad[n].fY - line[0].fY) * vec.fX - (quad[n].fX - line[0].fX) * vec.fY;
983 // Return true if the point is close to the bounds of the quad. This is used as a quick reject.
984 bool SkPathStroker::ptInQuadBounds(const SkPoint quad[3], const SkPoint& pt) const {
985 SkScalar xMin = std::min(std::min(quad[0].fX, quad[1].fX), quad[2].fX);
989 SkScalar xMax = std::max(std::max(quad[0].fX, quad[1].fX), quad[2].fX);
993 SkScalar yMin = std::min(std::min(quad[0].fY, quad[1].fY), quad[2].fY);
997 SkScalar yMax = std::max(std::max(quad[0].fY, quad[1].fY), quad[2].fY);
1008 static bool sharp_angle(const SkPoint quad[3]) {
1009 SkVector smaller = quad[1] - quad[0];
1010 SkVector larger = quad[1] - quad[2];
1028 // measure the distance from the curve to the quad-stroke midpoint, compare to radius
1041 // measure the distance to quad's bounds (quick reject)
1049 // measure the curve ray distance to the quad-stroke
1084 SkPoint ray[2]; // points near midpoint on quad, midpoint on cubic
1100 SkPoint ray[2]; // points near midpoint on quad, midpoint on conic
1106 SkPathStroker::ResultType SkPathStroker::compareQuadQuad(const SkPoint quad[3],
1111 this->quadPerpRay(quad, quadPts->fStartT, &quadStartPt, &quadPts->fQuad[0],
1117 this->quadPerpRay(quad, quadPts->fEndT, &quadEndPt, &quadPts->fQuad[2],
1128 this->quadPerpRay(quad, quadPts->fMidT, &ray[1], &ray[0], nullptr);
1134 const SkPoint* quad = quadPts->fQuad;
1136 path->lineTo(quad[2].fX, quad[2].fY);
1180 return false; // just abort if projected quad isn't representable
1188 return false; // just abort if projected quad isn't representable
1230 return false; // just abort if projected quad isn't representable
1245 bool SkPathStroker::quadStroke(const SkPoint quad[3], SkQuadConstruct* quadPts) {
1246 ResultType resultType = this->compareQuadQuad(quad, quadPts);
1262 return false; // just abort if projected quad isn't representable
1266 if (!this->quadStroke(quad, &half)) {
1270 if (!this->quadStroke(quad, &half)) {