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()
715 SkQuadConstruct quadPts; in conicTo() local
716 this->init(kOuter_StrokeType, &quadPts, 0, 1); in conicTo()
717 (void) this->conicStroke(conic, &quadPts); in conicTo()
718 this->init(kInner_StrokeType, &quadPts, 0, 1); in conicTo()
719 (void) this->conicStroke(conic, &quadPts); in conicTo()
753 SkQuadConstruct quadPts; in quadTo() local
754 this->init(kOuter_StrokeType, &quadPts, 0, 1); in quadTo()
755 (void) this->quadStroke(quad, &quadPts); in quadTo()
756 this->init(kInner_StrokeType, &quadPts, 0, 1); in quadTo()
757 (void) this->quadStroke(quad, &quadPts); in quadTo()
797 void SkPathStroker::conicQuadEnds(const SkConic& conic, SkQuadConstruct* quadPts) const { in conicQuadEnds()
798 if (!quadPts->fStartSet) { in conicQuadEnds()
800 this->conicPerpRay(conic, quadPts->fStartT, &conicStartPt, &quadPts->fQuad[0], in conicQuadEnds()
801 &quadPts->fTangentStart); in conicQuadEnds()
802 quadPts->fStartSet = true; in conicQuadEnds()
804 if (!quadPts->fEndSet) { in conicQuadEnds()
806 this->conicPerpRay(conic, quadPts->fEndT, &conicEndPt, &quadPts->fQuad[2], in conicQuadEnds()
807 &quadPts->fTangentEnd); in conicQuadEnds()
808 quadPts->fEndSet = true; in conicQuadEnds()
843 void SkPathStroker::cubicQuadEnds(const SkPoint cubic[4], SkQuadConstruct* quadPts) { in cubicQuadEnds() argument
844 if (!quadPts->fStartSet) { in cubicQuadEnds()
846 this->cubicPerpRay(cubic, quadPts->fStartT, &cubicStartPt, &quadPts->fQuad[0], in cubicQuadEnds()
847 &quadPts->fTangentStart); in cubicQuadEnds()
848 quadPts->fStartSet = true; in cubicQuadEnds()
850 if (!quadPts->fEndSet) { in cubicQuadEnds()
852 this->cubicPerpRay(cubic, quadPts->fEndT, &cubicEndPt, &quadPts->fQuad[2], in cubicQuadEnds()
853 &quadPts->fTangentEnd); in cubicQuadEnds()
854 quadPts->fEndSet = true; in cubicQuadEnds()
858 void SkPathStroker::cubicQuadMid(const SkPoint cubic[4], const SkQuadConstruct* quadPts, in cubicQuadMid() argument
861 this->cubicPerpRay(cubic, quadPts->fMidT, &cubicMidPt, mid, nullptr); in cubicQuadMid()
878 SkPathStroker::ResultType SkPathStroker::intersectRay(SkQuadConstruct* quadPts, in intersectRay() argument
880 const SkPoint& start = quadPts->fQuad[0]; in intersectRay()
881 const SkPoint& end = quadPts->fQuad[2]; in intersectRay()
882 SkVector aLen = quadPts->fTangentStart - start; in intersectRay()
883 SkVector bLen = quadPts->fTangentEnd - end; in intersectRay()
892 quadPts->fOppositeTangents = aLen.dot(bLen) < 0; in intersectRay()
893 return STROKER_RESULT(kDegenerate_ResultType, depth, quadPts, "denom == 0"); in intersectRay()
895 quadPts->fOppositeTangents = false; in intersectRay()
902 SkScalar dist1 = pt_to_line(start, end, quadPts->fTangentEnd); in intersectRay()
903 SkScalar dist2 = pt_to_line(end, start, quadPts->fTangentStart); in intersectRay()
905 return STROKER_RESULT(kDegenerate_ResultType, depth, quadPts, in intersectRay()
908 return STROKER_RESULT(kSplit_ResultType, depth, quadPts, in intersectRay()
917 SkPoint* ctrlPt = &quadPts->fQuad[1]; in intersectRay()
920 ctrlPt->fX = start.fX * (1 - numerA) + quadPts->fTangentStart.fX * numerA; in intersectRay()
921 ctrlPt->fY = start.fY * (1 - numerA) + quadPts->fTangentStart.fY * numerA; in intersectRay()
923 return STROKER_RESULT(kQuad_ResultType, depth, quadPts, in intersectRay()
926 quadPts->fOppositeTangents = aLen.dot(bLen) < 0; in intersectRay()
928 return STROKER_RESULT(kDegenerate_ResultType, depth, quadPts, in intersectRay()
934 SkQuadConstruct* quadPts) { in tangentsMeet() argument
935 this->cubicQuadEnds(cubic, quadPts); in tangentsMeet()
936 return this->intersectRay(quadPts, kResultType_RayType STROKER_DEBUG_PARAMS(fRecursionDepth)); in tangentsMeet()
997 const SkPoint ray[2], SkQuadConstruct* quadPts STROKER_DEBUG_PARAMS(int depth)) const { in strokeCloseEnough()
1001 if (sharp_angle(quadPts->fQuad)) { in strokeCloseEnough()
1002 return STROKER_RESULT(kSplit_ResultType, depth, quadPts, in strokeCloseEnough()
1004 quadPts->fQuad[0].fX, quadPts->fQuad[0].fY, in strokeCloseEnough()
1005 quadPts->fQuad[1].fX, quadPts->fQuad[1].fY, in strokeCloseEnough()
1006 quadPts->fQuad[2].fX, quadPts->fQuad[2].fY); in strokeCloseEnough()
1008 return STROKER_RESULT(kQuad_ResultType, depth, quadPts, in strokeCloseEnough()
1015 return STROKER_RESULT(kSplit_ResultType, depth, quadPts, in strokeCloseEnough()
1024 return STROKER_RESULT(kSplit_ResultType, depth, quadPts, in strokeCloseEnough()
1030 if (sharp_angle(quadPts->fQuad)) { in strokeCloseEnough()
1031 return STROKER_RESULT(kSplit_ResultType, depth, quadPts, in strokeCloseEnough()
1033 quadPts->fQuad[0].fX, quadPts->fQuad[0].fY, in strokeCloseEnough()
1034 quadPts->fQuad[1].fX, quadPts->fQuad[1].fY, in strokeCloseEnough()
1035 quadPts->fQuad[2].fX, quadPts->fQuad[2].fY); in strokeCloseEnough()
1037 return STROKER_RESULT(kQuad_ResultType, depth, quadPts, in strokeCloseEnough()
1042 return STROKER_RESULT(kSplit_ResultType, depth, quadPts, "%s", "fall through"); in strokeCloseEnough()
1046 SkQuadConstruct* quadPts) { in compareQuadCubic() argument
1048 this->cubicQuadEnds(cubic, quadPts); in compareQuadCubic()
1049 ResultType resultType = this->intersectRay(quadPts, kCtrlPt_RayType in compareQuadCubic()
1056 this->cubicPerpRay(cubic, quadPts->fMidT, &ray[1], &ray[0], nullptr); in compareQuadCubic()
1057 return this->strokeCloseEnough(quadPts->fQuad, ray, quadPts in compareQuadCubic()
1062 SkQuadConstruct* quadPts) const { in compareQuadConic()
1064 this->conicQuadEnds(conic, quadPts); in compareQuadConic()
1065 ResultType resultType = this->intersectRay(quadPts, kCtrlPt_RayType in compareQuadConic()
1072 this->conicPerpRay(conic, quadPts->fMidT, &ray[1], &ray[0], nullptr); in compareQuadConic()
1073 return this->strokeCloseEnough(quadPts->fQuad, ray, quadPts in compareQuadConic()
1078 SkQuadConstruct* quadPts) { in compareQuadQuad() argument
1080 if (!quadPts->fStartSet) { in compareQuadQuad()
1082 this->quadPerpRay(quad, quadPts->fStartT, &quadStartPt, &quadPts->fQuad[0], in compareQuadQuad()
1083 &quadPts->fTangentStart); in compareQuadQuad()
1084 quadPts->fStartSet = true; in compareQuadQuad()
1086 if (!quadPts->fEndSet) { in compareQuadQuad()
1088 this->quadPerpRay(quad, quadPts->fEndT, &quadEndPt, &quadPts->fQuad[2], in compareQuadQuad()
1089 &quadPts->fTangentEnd); in compareQuadQuad()
1090 quadPts->fEndSet = true; in compareQuadQuad()
1092 ResultType resultType = this->intersectRay(quadPts, kCtrlPt_RayType in compareQuadQuad()
1099 this->quadPerpRay(quad, quadPts->fMidT, &ray[1], &ray[0], nullptr); in compareQuadQuad()
1100 return this->strokeCloseEnough(quadPts->fQuad, ray, quadPts in compareQuadQuad()
1104 void SkPathStroker::addDegenerateLine(const SkQuadConstruct* quadPts) { in addDegenerateLine() argument
1105 const SkPoint* quad = quadPts->fQuad; in addDegenerateLine()
1110 bool SkPathStroker::cubicMidOnLine(const SkPoint cubic[4], const SkQuadConstruct* quadPts) const { in cubicMidOnLine()
1112 this->cubicQuadMid(cubic, quadPts, &strokeMid); in cubicMidOnLine()
1113 SkScalar dist = pt_to_line(strokeMid, quadPts->fQuad[0], quadPts->fQuad[2]); in cubicMidOnLine()
1117 bool SkPathStroker::cubicStroke(const SkPoint cubic[4], SkQuadConstruct* quadPts) { in cubicStroke() argument
1119 ResultType resultType = this->tangentsMeet(cubic, quadPts); in cubicStroke()
1122 || points_within_dist(quadPts->fQuad[0], quadPts->fQuad[2], in cubicStroke()
1123 fInvResScale)) && cubicMidOnLine(cubic, quadPts)) { in cubicStroke()
1124 addDegenerateLine(quadPts); in cubicStroke()
1132 ResultType resultType = this->compareQuadCubic(cubic, quadPts); in cubicStroke()
1135 const SkPoint* stroke = quadPts->fQuad; in cubicStroke()
1140 if (!quadPts->fOppositeTangents) { in cubicStroke()
1141 addDegenerateLine(quadPts); in cubicStroke()
1146 if (!SkScalarIsFinite(quadPts->fQuad[2].fX) || !SkScalarIsFinite(quadPts->fQuad[2].fY)) { in cubicStroke()
1157 if (!half.initWithStart(quadPts)) { in cubicStroke()
1158 addDegenerateLine(quadPts); in cubicStroke()
1165 if (!half.initWithEnd(quadPts)) { in cubicStroke()
1166 addDegenerateLine(quadPts); in cubicStroke()
1177 bool SkPathStroker::conicStroke(const SkConic& conic, SkQuadConstruct* quadPts) { in conicStroke() argument
1178 ResultType resultType = this->compareQuadConic(conic, quadPts); in conicStroke()
1180 const SkPoint* stroke = quadPts->fQuad; in conicStroke()
1186 addDegenerateLine(quadPts); in conicStroke()
1197 (void) half.initWithStart(quadPts); in conicStroke()
1201 (void) half.initWithEnd(quadPts); in conicStroke()
1209 bool SkPathStroker::quadStroke(const SkPoint quad[3], SkQuadConstruct* quadPts) { in quadStroke() argument
1210 ResultType resultType = this->compareQuadQuad(quad, quadPts); in quadStroke()
1212 const SkPoint* stroke = quadPts->fQuad; in quadStroke()
1218 addDegenerateLine(quadPts); in quadStroke()
1229 (void) half.initWithStart(quadPts); in quadStroke()
1233 (void) half.initWithEnd(quadPts); in quadStroke()
1283 SkQuadConstruct quadPts; in cubicTo() local
1284 this->init(kOuter_StrokeType, &quadPts, lastT, nextT); in cubicTo()
1285 (void) this->cubicStroke(cubic, &quadPts); in cubicTo()
1286 this->init(kInner_StrokeType, &quadPts, lastT, nextT); in cubicTo()
1287 (void) this->cubicStroke(cubic, &quadPts); in cubicTo()