Lines Matching refs:quadPts
45 #define STROKER_RESULT(resultType, depth, quadPts, format, ...) \ argument
47 SkDebugf(" " #resultType " t=(%g,%g)\n", quadPts->fStartT, quadPts->fEndT), \
51 #define STROKER_RESULT(resultType, depth, quadPts, format, ...) \ argument
492 void SkPathStroker::init(StrokeType strokeType, SkQuadConstruct* quadPts, SkScalar tStart, in init() argument
496 quadPts->init(tStart, tEnd); in init()
716 SkQuadConstruct quadPts; in conicTo() local
717 this->init(kOuter_StrokeType, &quadPts, 0, 1); in conicTo()
718 (void) this->conicStroke(conic, &quadPts); in conicTo()
719 this->init(kInner_StrokeType, &quadPts, 0, 1); in conicTo()
720 (void) this->conicStroke(conic, &quadPts); in conicTo()
754 SkQuadConstruct quadPts; in quadTo() local
755 this->init(kOuter_StrokeType, &quadPts, 0, 1); in quadTo()
756 (void) this->quadStroke(quad, &quadPts); in quadTo()
757 this->init(kInner_StrokeType, &quadPts, 0, 1); in quadTo()
758 (void) this->quadStroke(quad, &quadPts); in quadTo()
793 void SkPathStroker::conicQuadEnds(const SkConic& conic, SkQuadConstruct* quadPts) const { in conicQuadEnds()
794 if (!quadPts->fStartSet) { in conicQuadEnds()
796 this->conicPerpRay(conic, quadPts->fStartT, &conicStartPt, &quadPts->fQuad[0], in conicQuadEnds()
797 &quadPts->fTangentStart); in conicQuadEnds()
798 quadPts->fStartSet = true; in conicQuadEnds()
800 if (!quadPts->fEndSet) { in conicQuadEnds()
802 this->conicPerpRay(conic, quadPts->fEndT, &conicEndPt, &quadPts->fQuad[2], in conicQuadEnds()
803 &quadPts->fTangentEnd); in conicQuadEnds()
804 quadPts->fEndSet = true; in conicQuadEnds()
839 void SkPathStroker::cubicQuadEnds(const SkPoint cubic[4], SkQuadConstruct* quadPts) { in cubicQuadEnds() argument
840 if (!quadPts->fStartSet) { in cubicQuadEnds()
842 this->cubicPerpRay(cubic, quadPts->fStartT, &cubicStartPt, &quadPts->fQuad[0], in cubicQuadEnds()
843 &quadPts->fTangentStart); in cubicQuadEnds()
844 quadPts->fStartSet = true; in cubicQuadEnds()
846 if (!quadPts->fEndSet) { in cubicQuadEnds()
848 this->cubicPerpRay(cubic, quadPts->fEndT, &cubicEndPt, &quadPts->fQuad[2], in cubicQuadEnds()
849 &quadPts->fTangentEnd); in cubicQuadEnds()
850 quadPts->fEndSet = true; in cubicQuadEnds()
854 void SkPathStroker::cubicQuadMid(const SkPoint cubic[4], const SkQuadConstruct* quadPts, in cubicQuadMid() argument
857 this->cubicPerpRay(cubic, quadPts->fMidT, &cubicMidPt, mid, nullptr); in cubicQuadMid()
874 SkPathStroker::ResultType SkPathStroker::intersectRay(SkQuadConstruct* quadPts, in intersectRay() argument
876 const SkPoint& start = quadPts->fQuad[0]; in intersectRay()
877 const SkPoint& end = quadPts->fQuad[2]; in intersectRay()
878 SkVector aLen = quadPts->fTangentStart - start; in intersectRay()
879 SkVector bLen = quadPts->fTangentEnd - end; in intersectRay()
888 quadPts->fOppositeTangents = aLen.dot(bLen) < 0; in intersectRay()
889 return STROKER_RESULT(kDegenerate_ResultType, depth, quadPts, "denom == 0"); in intersectRay()
891 quadPts->fOppositeTangents = false; in intersectRay()
898 SkScalar dist1 = pt_to_line(start, end, quadPts->fTangentEnd); in intersectRay()
899 SkScalar dist2 = pt_to_line(end, start, quadPts->fTangentStart); in intersectRay()
901 return STROKER_RESULT(kDegenerate_ResultType, depth, quadPts, in intersectRay()
904 return STROKER_RESULT(kSplit_ResultType, depth, quadPts, in intersectRay()
913 SkPoint* ctrlPt = &quadPts->fQuad[1]; in intersectRay()
916 ctrlPt->fX = start.fX * (1 - numerA) + quadPts->fTangentStart.fX * numerA; in intersectRay()
917 ctrlPt->fY = start.fY * (1 - numerA) + quadPts->fTangentStart.fY * numerA; in intersectRay()
919 return STROKER_RESULT(kQuad_ResultType, depth, quadPts, in intersectRay()
922 quadPts->fOppositeTangents = aLen.dot(bLen) < 0; in intersectRay()
924 return STROKER_RESULT(kDegenerate_ResultType, depth, quadPts, in intersectRay()
930 SkQuadConstruct* quadPts) { in tangentsMeet() argument
931 this->cubicQuadEnds(cubic, quadPts); in tangentsMeet()
932 return this->intersectRay(quadPts, kResultType_RayType STROKER_DEBUG_PARAMS(fRecursionDepth)); in tangentsMeet()
993 const SkPoint ray[2], SkQuadConstruct* quadPts STROKER_DEBUG_PARAMS(int depth)) const { in strokeCloseEnough()
997 if (sharp_angle(quadPts->fQuad)) { in strokeCloseEnough()
998 return STROKER_RESULT(kSplit_ResultType, depth, quadPts, in strokeCloseEnough()
1000 quadPts->fQuad[0].fX, quadPts->fQuad[0].fY, in strokeCloseEnough()
1001 quadPts->fQuad[1].fX, quadPts->fQuad[1].fY, in strokeCloseEnough()
1002 quadPts->fQuad[2].fX, quadPts->fQuad[2].fY); in strokeCloseEnough()
1004 return STROKER_RESULT(kQuad_ResultType, depth, quadPts, in strokeCloseEnough()
1011 return STROKER_RESULT(kSplit_ResultType, depth, quadPts, in strokeCloseEnough()
1020 return STROKER_RESULT(kSplit_ResultType, depth, quadPts, in strokeCloseEnough()
1026 if (sharp_angle(quadPts->fQuad)) { in strokeCloseEnough()
1027 return STROKER_RESULT(kSplit_ResultType, depth, quadPts, in strokeCloseEnough()
1029 quadPts->fQuad[0].fX, quadPts->fQuad[0].fY, in strokeCloseEnough()
1030 quadPts->fQuad[1].fX, quadPts->fQuad[1].fY, in strokeCloseEnough()
1031 quadPts->fQuad[2].fX, quadPts->fQuad[2].fY); in strokeCloseEnough()
1033 return STROKER_RESULT(kQuad_ResultType, depth, quadPts, in strokeCloseEnough()
1038 return STROKER_RESULT(kSplit_ResultType, depth, quadPts, "%s", "fall through"); in strokeCloseEnough()
1042 SkQuadConstruct* quadPts) { in compareQuadCubic() argument
1044 this->cubicQuadEnds(cubic, quadPts); in compareQuadCubic()
1045 ResultType resultType = this->intersectRay(quadPts, kCtrlPt_RayType in compareQuadCubic()
1052 this->cubicPerpRay(cubic, quadPts->fMidT, &ray[1], &ray[0], nullptr); in compareQuadCubic()
1053 return this->strokeCloseEnough(quadPts->fQuad, ray, quadPts in compareQuadCubic()
1058 SkQuadConstruct* quadPts) const { in compareQuadConic()
1060 this->conicQuadEnds(conic, quadPts); in compareQuadConic()
1061 ResultType resultType = this->intersectRay(quadPts, kCtrlPt_RayType in compareQuadConic()
1068 this->conicPerpRay(conic, quadPts->fMidT, &ray[1], &ray[0], nullptr); in compareQuadConic()
1069 return this->strokeCloseEnough(quadPts->fQuad, ray, quadPts in compareQuadConic()
1074 SkQuadConstruct* quadPts) { in compareQuadQuad() argument
1076 if (!quadPts->fStartSet) { in compareQuadQuad()
1078 this->quadPerpRay(quad, quadPts->fStartT, &quadStartPt, &quadPts->fQuad[0], in compareQuadQuad()
1079 &quadPts->fTangentStart); in compareQuadQuad()
1080 quadPts->fStartSet = true; in compareQuadQuad()
1082 if (!quadPts->fEndSet) { in compareQuadQuad()
1084 this->quadPerpRay(quad, quadPts->fEndT, &quadEndPt, &quadPts->fQuad[2], in compareQuadQuad()
1085 &quadPts->fTangentEnd); in compareQuadQuad()
1086 quadPts->fEndSet = true; in compareQuadQuad()
1088 ResultType resultType = this->intersectRay(quadPts, kCtrlPt_RayType in compareQuadQuad()
1095 this->quadPerpRay(quad, quadPts->fMidT, &ray[1], &ray[0], nullptr); in compareQuadQuad()
1096 return this->strokeCloseEnough(quadPts->fQuad, ray, quadPts in compareQuadQuad()
1100 void SkPathStroker::addDegenerateLine(const SkQuadConstruct* quadPts) { in addDegenerateLine() argument
1101 const SkPoint* quad = quadPts->fQuad; in addDegenerateLine()
1106 bool SkPathStroker::cubicMidOnLine(const SkPoint cubic[4], const SkQuadConstruct* quadPts) const { in cubicMidOnLine()
1108 this->cubicQuadMid(cubic, quadPts, &strokeMid); in cubicMidOnLine()
1109 SkScalar dist = pt_to_line(strokeMid, quadPts->fQuad[0], quadPts->fQuad[2]); in cubicMidOnLine()
1113 bool SkPathStroker::cubicStroke(const SkPoint cubic[4], SkQuadConstruct* quadPts) { in cubicStroke() argument
1115 ResultType resultType = this->tangentsMeet(cubic, quadPts); in cubicStroke()
1118 || points_within_dist(quadPts->fQuad[0], quadPts->fQuad[2], in cubicStroke()
1119 fInvResScale)) && cubicMidOnLine(cubic, quadPts)) { in cubicStroke()
1120 addDegenerateLine(quadPts); in cubicStroke()
1128 ResultType resultType = this->compareQuadCubic(cubic, quadPts); in cubicStroke()
1131 const SkPoint* stroke = quadPts->fQuad; in cubicStroke()
1136 if (!quadPts->fOppositeTangents) { in cubicStroke()
1137 addDegenerateLine(quadPts); in cubicStroke()
1142 if (!SkScalarIsFinite(quadPts->fQuad[2].fX) || !SkScalarIsFinite(quadPts->fQuad[2].fY)) { in cubicStroke()
1153 if (!half.initWithStart(quadPts)) { in cubicStroke()
1154 addDegenerateLine(quadPts); in cubicStroke()
1161 if (!half.initWithEnd(quadPts)) { in cubicStroke()
1162 addDegenerateLine(quadPts); in cubicStroke()
1173 bool SkPathStroker::conicStroke(const SkConic& conic, SkQuadConstruct* quadPts) { in conicStroke() argument
1174 ResultType resultType = this->compareQuadConic(conic, quadPts); in conicStroke()
1176 const SkPoint* stroke = quadPts->fQuad; in conicStroke()
1182 addDegenerateLine(quadPts); in conicStroke()
1193 (void) half.initWithStart(quadPts); in conicStroke()
1197 (void) half.initWithEnd(quadPts); in conicStroke()
1205 bool SkPathStroker::quadStroke(const SkPoint quad[3], SkQuadConstruct* quadPts) { in quadStroke() argument
1206 ResultType resultType = this->compareQuadQuad(quad, quadPts); in quadStroke()
1208 const SkPoint* stroke = quadPts->fQuad; in quadStroke()
1214 addDegenerateLine(quadPts); in quadStroke()
1225 (void) half.initWithStart(quadPts); in quadStroke()
1229 (void) half.initWithEnd(quadPts); in quadStroke()
1279 SkQuadConstruct quadPts; in cubicTo() local
1280 this->init(kOuter_StrokeType, &quadPts, lastT, nextT); in cubicTo()
1281 (void) this->cubicStroke(cubic, &quadPts); in cubicTo()
1282 this->init(kInner_StrokeType, &quadPts, lastT, nextT); in cubicTo()
1283 (void) this->cubicStroke(cubic, &quadPts); in cubicTo()