Lines Matching refs:pts
33 SkPoint pts[4]; in is_degenerate() local
34 return SkPath::kDone_Verb == iter.next(pts); in is_degenerate()
268 SkPoint pts[4]; in conservativelyContainsRect() local
273 while ((verb = iter.next(pts)) != kDone_Verb) { in conservativelyContainsRect()
279 firstPt = prevPt = pts[0]; in conservativelyContainsRect()
306 orig.set(pts, iter.conicWeight()); in conservativelyContainsRect()
318 if (!check_edge_against_rect(prevPt, pts[nextPt], rect, direction)) { in conservativelyContainsRect()
322 prevPt = pts[nextPt]; in conservativelyContainsRect()
368 const SkPoint* pts = fPathRef->points(); in isLine() local
369 line[0] = pts[0]; in isLine()
370 line[1] = pts[1]; in isLine()
431 const SkPoint* pts = *ptsPtr; in isRectContour() local
446 savePts = pts; in isRectContour()
447 pts = *ptsPtr; in isRectContour()
453 SkScalar right = pts->fX; in isRectContour()
454 SkScalar bottom = pts->fY; in isRectContour()
455 ++pts; in isRectContour()
466 last = pts[-1]; in isRectContour()
483 last = pts[-1]; in isRectContour()
507 last = *pts++; in isRectContour()
555 const SkPoint* pts = fPathRef->points(); in isRect() local
556 const SkPoint* first = pts; in isRect()
557 if (!this->isRectContour(false, &currVerb, &pts, isClosed, direction)) { in isRect()
561 int32_t num = SkToS32(pts - first); in isRect()
575 const SkPoint* pts = fPathRef->points(); in isNestedFillRects() local
576 const SkPoint* first = pts; in isNestedFillRects()
578 if (!isRectContour(true, &currVerb, &pts, nullptr, &testDirs[0])) { in isNestedFillRects()
581 const SkPoint* last = pts; in isNestedFillRects()
584 if (isRectContour(false, &currVerb, &pts, &isClosed, &testDirs[1])) { in isNestedFillRects()
587 pts = fPathRef->points() + fPathRef->countPoints(); in isNestedFillRects()
589 testRects[1].set(last, SkToS32(pts - last)); in isNestedFillRects()
777 SkPoint* pts = ed.growForVerb(kQuad_Verb); in quadTo() local
778 pts[0].set(x1, y1); in quadTo()
779 pts[1].set(x2, y2); in quadTo()
807 SkPoint* pts = ed.growForVerb(kConic_Verb, w); in conicTo() local
808 pts[0].set(x1, y1); in conicTo()
809 pts[1].set(x2, y2); in conicTo()
830 SkPoint* pts = ed.growForVerb(kCubic_Verb); in cubicTo() local
831 pts[0].set(x1, y1); in cubicTo()
832 pts[1].set(x2, y2); in cubicTo()
833 pts[2].set(x3, y3); in cubicTo()
997 void SkPath::addPoly(const SkPoint pts[], int count, bool close) { in addPoly() argument
1008 ed.growForVerb(kMove_Verb)->set(pts[0].fX, pts[0].fY); in addPoly()
1011 memcpy(p, &pts[1], (count-1) * sizeof(SkPoint)); in addPoly()
1192 const SkPoint* pts = fPathRef.get()->points(); in isZeroLength() local
1193 const SkPoint& first = *pts; in isZeroLength()
1195 if (first != pts[index]) { in isZeroLength()
1483 SkPoint pts[4]; in addPath() local
1488 while ((verb = iter.next(pts)) != kDone_Verb) { in addPath()
1491 proc(matrix, &pts[0], &pts[0], 1); in addPath()
1494 this->lineTo(pts[0]); in addPath()
1496 this->moveTo(pts[0]); in addPath()
1500 proc(matrix, &pts[1], &pts[1], 1); in addPath()
1501 this->lineTo(pts[1]); in addPath()
1504 proc(matrix, &pts[1], &pts[1], 2); in addPath()
1505 this->quadTo(pts[1], pts[2]); in addPath()
1508 proc(matrix, &pts[1], &pts[1], 2); in addPath()
1509 this->conicTo(pts[1], pts[2], iter.conicWeight()); in addPath()
1512 proc(matrix, &pts[1], &pts[1], 3); in addPath()
1513 this->cubicTo(pts[1], pts[2], pts[3]); in addPath()
1553 const SkPoint* pts = path.fPathRef->points(); in reversePathTo() local
1563 pts += n; in reversePathTo()
1570 this->lineTo(pts[-1].fX, pts[-1].fY); in reversePathTo()
1573 this->quadTo(pts[-1].fX, pts[-1].fY, pts[-2].fX, pts[-2].fY); in reversePathTo()
1576 this->conicTo(pts[-1], pts[-2], *--conicWeights); in reversePathTo()
1579 this->cubicTo(pts[-1].fX, pts[-1].fY, pts[-2].fX, pts[-2].fY, in reversePathTo()
1580 pts[-3].fX, pts[-3].fY); in reversePathTo()
1586 pts -= pts_in_verb(verbs[~i]); in reversePathTo()
1593 const SkPoint* pts = src.fPathRef->pointsEnd(); in reverseAddPath() local
1606 --pts; in reverseAddPath()
1607 this->moveTo(pts->fX, pts->fY); in reverseAddPath()
1610 pts -= n; in reverseAddPath()
1618 pts += 1; // so we see the point in "if (needMove)" above in reverseAddPath()
1621 this->lineTo(pts[0]); in reverseAddPath()
1624 this->quadTo(pts[1], pts[0]); in reverseAddPath()
1627 this->conicTo(pts[1], pts[0], *--conicWeights); in reverseAddPath()
1630 this->cubicTo(pts[2], pts[1], pts[0]); in reverseAddPath()
1650 static void subdivide_cubic_to(SkPath* path, const SkPoint pts[4], in subdivide_cubic_to()
1655 SkChopCubicAtHalf(pts, tmp); in subdivide_cubic_to()
1659 path->cubicTo(pts[1], pts[2], pts[3]); in subdivide_cubic_to()
1674 SkPoint pts[4]; in transform() local
1677 while ((verb = iter.next(pts, false)) != kDone_Verb) { in transform()
1680 tmp.moveTo(pts[0]); in transform()
1683 tmp.lineTo(pts[1]); in transform()
1687 tmp.conicTo(pts[1], pts[2], in transform()
1688 SkConic::TransformW(pts, SK_Scalar1, matrix)); in transform()
1691 tmp.conicTo(pts[1], pts[2], in transform()
1692 SkConic::TransformW(pts, iter.conicWeight(), matrix)); in transform()
1695 subdivide_cubic_to(&tmp, pts); in transform()
1810 SkPath::Verb SkPath::Iter::autoClose(SkPoint pts[2]) { in autoClose()
1811 SkASSERT(pts); in autoClose()
1821 pts[0] = fLastPt; in autoClose()
1822 pts[1] = fMoveTo; in autoClose()
1827 pts[0] = fMoveTo; in autoClose()
1945 SkPoint* SK_RESTRICT pts = ptsParam; in doNext() local
1951 verb = this->autoClose(pts); in doNext()
1961 pts[0] = *srcPts; in doNext()
1968 pts[0] = this->cons_moveTo(); in doNext()
1969 pts[1] = srcPts[0]; in doNext()
1978 pts[0] = this->cons_moveTo(); in doNext()
1979 memcpy(&pts[1], srcPts, 2 * sizeof(SkPoint)); in doNext()
1984 pts[0] = this->cons_moveTo(); in doNext()
1985 memcpy(&pts[1], srcPts, 3 * sizeof(SkPoint)); in doNext()
1990 verb = this->autoClose(pts); in doNext()
2088 static void append_params(SkString* str, const char label[], const SkPoint pts[], in append_params() argument
2093 const SkScalar* values = &pts[0].fX; in append_params()
2126 SkPoint pts[4]; in dump() local
2134 while ((verb = iter.next(pts, false)) != kDone_Verb) { in dump()
2137 append_params(&builder, "path.moveTo", &pts[0], 1, asType); in dump()
2140 append_params(&builder, "path.lineTo", &pts[1], 1, asType); in dump()
2143 append_params(&builder, "path.quadTo", &pts[1], 2, asType); in dump()
2146 append_params(&builder, "path.conicTo", &pts[1], 2, asType, iter.conicWeight()); in dump()
2149 append_params(&builder, "path.cubicTo", &pts[1], 3, asType); in dump()
2406 SkPoint pts[4]; in internalGetConvexity() local
2417 while ((verb = iter.next(pts, true, true)) != SkPath::kDone_Verb) { in internalGetConvexity()
2424 pts[1] = pts[0]; in internalGetConvexity()
2452 state.addPt(pts[i]); in internalGetConvexity()
2479 const SkPoint* pts() const { return fCurrPt; } in pts() function in ContourIter
2570 static int find_max_y(const SkPoint pts[], int count) { in find_max_y() argument
2572 SkScalar max = pts[0].fY; in find_max_y()
2575 SkScalar y = pts[i].fY; in find_max_y()
2584 static int find_diff_pt(const SkPoint pts[], int index, int n, int inc) { in find_diff_pt() argument
2591 if (pts[index] != pts[i]) { // found a different point, success! in find_diff_pt()
2602 static int find_min_max_x_at_y(const SkPoint pts[], int index, int n, in find_min_max_x_at_y() argument
2604 const SkScalar y = pts[index].fY; in find_min_max_x_at_y()
2605 SkScalar min = pts[index].fX; in find_min_max_x_at_y()
2610 if (pts[i].fY != y) { in find_min_max_x_at_y()
2613 SkScalar x = pts[i].fX; in find_min_max_x_at_y()
2664 const SkPoint* pts = iter.pts(); in CheapComputeFirstDirection() local
2666 int index = find_max_y(pts, n); in CheapComputeFirstDirection()
2667 if (pts[index].fY < ymax) { in CheapComputeFirstDirection()
2673 if (pts[(index + 1) % n].fY == pts[index].fY) { in CheapComputeFirstDirection()
2675 int minIndex = find_min_max_x_at_y(pts, index, n, &maxIndex); in CheapComputeFirstDirection()
2679 SkASSERT(pts[minIndex].fY == pts[index].fY); in CheapComputeFirstDirection()
2680 SkASSERT(pts[maxIndex].fY == pts[index].fY); in CheapComputeFirstDirection()
2681 SkASSERT(pts[minIndex].fX <= pts[maxIndex].fX); in CheapComputeFirstDirection()
2696 int prev = find_diff_pt(pts, index, n, n - 1); in CheapComputeFirstDirection()
2701 int next = find_diff_pt(pts, index, n, 1); in CheapComputeFirstDirection()
2703 cross = cross_prod(pts[prev], pts[index], pts[next]); in CheapComputeFirstDirection()
2707 if (0 == cross && pts[prev].fY == pts[index].fY && pts[next].fY == pts[index].fY) { in CheapComputeFirstDirection()
2709 cross = pts[index].fX - pts[next].fX; in CheapComputeFirstDirection()
2715 ymax = pts[index].fY; in CheapComputeFirstDirection()
2750 template <size_t N> static void find_minmax(const SkPoint pts[], in find_minmax() argument
2753 min = max = pts[0].fX; in find_minmax()
2755 min = SkMinScalar(min, pts[i].fX); in find_minmax()
2756 max = SkMaxScalar(max, pts[i].fX); in find_minmax()
2770 static int winding_mono_cubic(const SkPoint pts[], SkScalar x, SkScalar y, int* onCurveCount) { in winding_mono_cubic() argument
2771 SkScalar y0 = pts[0].fY; in winding_mono_cubic()
2772 SkScalar y3 = pts[3].fY; in winding_mono_cubic()
2782 if (checkOnCurve(x, y, pts[0], pts[3])) { in winding_mono_cubic()
2792 find_minmax<4>(pts, &min, &max); in winding_mono_cubic()
2802 SkAssertResult(SkCubicClipper::ChopMonoAtY(pts, y, &t)); in winding_mono_cubic()
2803 SkScalar xt = eval_cubic_pts(pts[0].fX, pts[1].fX, pts[2].fX, pts[3].fX, t); in winding_mono_cubic()
2805 if (x != pts[3].fX || y != pts[3].fY) { // don't test end points; they're start points in winding_mono_cubic()
2813 static int winding_cubic(const SkPoint pts[], SkScalar x, SkScalar y, int* onCurveCount) { in winding_cubic() argument
2815 int n = SkChopCubicAtYExtrema(pts, dst); in winding_cubic()
2842 const SkPoint* pts = conic.fPts; in winding_mono_conic() local
2843 SkScalar y0 = pts[0].fY; in winding_mono_conic()
2844 SkScalar y2 = pts[2].fY; in winding_mono_conic()
2854 if (checkOnCurve(x, y, pts[0], pts[2])) { in winding_mono_conic()
2863 SkScalar A = pts[2].fY; in winding_mono_conic()
2864 SkScalar B = pts[1].fY * conic.fW - y * conic.fW + y; in winding_mono_conic()
2865 SkScalar C = pts[0].fY; in winding_mono_conic()
2876 xt = pts[1 - dir].fX; in winding_mono_conic()
2879 xt = conic_eval_numerator(&pts[0].fX, conic.fW, t) / conic_eval_denominator(conic.fW, t); in winding_mono_conic()
2882 if (x != pts[2].fX || y != pts[2].fY) { // don't test end points; they're start points in winding_mono_conic()
2902 static int winding_conic(const SkPoint pts[], SkScalar x, SkScalar y, SkScalar weight, in winding_conic() argument
2904 SkConic conic(pts, weight); in winding_conic()
2908 bool isMono = is_mono_quad(pts[0].fY, pts[1].fY, pts[2].fY) || !conic.chopAtYExtrema(chopped); in winding_conic()
2916 static int winding_mono_quad(const SkPoint pts[], SkScalar x, SkScalar y, int* onCurveCount) { in winding_mono_quad() argument
2917 SkScalar y0 = pts[0].fY; in winding_mono_quad()
2918 SkScalar y2 = pts[2].fY; in winding_mono_quad()
2928 if (checkOnCurve(x, y, pts[0], pts[2])) { in winding_mono_quad()
2937 if (pts[0].fX > x && pts[1].fX > x && pts[2].fX > x) { in winding_mono_quad()
2943 int n = SkFindUnitQuadRoots(pts[0].fY - 2 * pts[1].fY + pts[2].fY, in winding_mono_quad()
2944 2 * (pts[1].fY - pts[0].fY), in winding_mono_quad()
2945 pts[0].fY - y, in winding_mono_quad()
2953 xt = pts[1 - dir].fX; in winding_mono_quad()
2956 SkScalar C = pts[0].fX; in winding_mono_quad()
2957 SkScalar A = pts[2].fX - 2 * pts[1].fX + C; in winding_mono_quad()
2958 SkScalar B = 2 * (pts[1].fX - C); in winding_mono_quad()
2962 if (x != pts[2].fX || y != pts[2].fY) { // don't test end points; they're start points in winding_mono_quad()
2970 static int winding_quad(const SkPoint pts[], SkScalar x, SkScalar y, int* onCurveCount) { in winding_quad() argument
2974 if (!is_mono_quad(pts[0].fY, pts[1].fY, pts[2].fY)) { in winding_quad()
2975 n = SkChopQuadAtYExtrema(pts, dst); in winding_quad()
2976 pts = dst; in winding_quad()
2978 int w = winding_mono_quad(pts, x, y, onCurveCount); in winding_quad()
2980 w += winding_mono_quad(&pts[2], x, y, onCurveCount); in winding_quad()
2985 static int winding_line(const SkPoint pts[], SkScalar x, SkScalar y, int* onCurveCount) { in winding_line() argument
2986 SkScalar x0 = pts[0].fX; in winding_line()
2987 SkScalar y0 = pts[0].fY; in winding_line()
2988 SkScalar x1 = pts[1].fX; in winding_line()
2989 SkScalar y1 = pts[1].fY; in winding_line()
3001 if (checkOnCurve(x, y, pts[0], pts[1])) { in winding_line()
3008 SkScalar cross = SkScalarMul(x1 - x0, y - pts[0].fY) - SkScalarMul(dy, x - x0); in winding_line()
3014 if (x != x1 || y != pts[1].fY) { in winding_line()
3024 static void tangent_cubic(const SkPoint pts[], SkScalar x, SkScalar y, in tangent_cubic() argument
3026 if (!between(pts[0].fY, y, pts[1].fY) && !between(pts[1].fY, y, pts[2].fY) in tangent_cubic()
3027 && !between(pts[2].fY, y, pts[3].fY)) { in tangent_cubic()
3030 if (!between(pts[0].fX, x, pts[1].fX) && !between(pts[1].fX, x, pts[2].fX) in tangent_cubic()
3031 && !between(pts[2].fX, x, pts[3].fX)) { in tangent_cubic()
3035 int n = SkChopCubicAtYExtrema(pts, dst); in tangent_cubic()
3050 static void tangent_conic(const SkPoint pts[], SkScalar x, SkScalar y, SkScalar w, in tangent_conic() argument
3052 if (!between(pts[0].fY, y, pts[1].fY) && !between(pts[1].fY, y, pts[2].fY)) { in tangent_conic()
3055 if (!between(pts[0].fX, x, pts[1].fX) && !between(pts[1].fX, x, pts[2].fX)) { in tangent_conic()
3059 SkScalar A = pts[2].fY; in tangent_conic()
3060 SkScalar B = pts[1].fY * w - y * w + y; in tangent_conic()
3061 SkScalar C = pts[0].fY; in tangent_conic()
3068 SkScalar xt = conic_eval_numerator(&pts[0].fX, w, t) / conic_eval_denominator(w, t); in tangent_conic()
3072 SkConic conic(pts, w); in tangent_conic()
3077 static void tangent_quad(const SkPoint pts[], SkScalar x, SkScalar y, in tangent_quad() argument
3079 if (!between(pts[0].fY, y, pts[1].fY) && !between(pts[1].fY, y, pts[2].fY)) { in tangent_quad()
3082 if (!between(pts[0].fX, x, pts[1].fX) && !between(pts[1].fX, x, pts[2].fX)) { in tangent_quad()
3086 int n = SkFindUnitQuadRoots(pts[0].fY - 2 * pts[1].fY + pts[2].fY, in tangent_quad()
3087 2 * (pts[1].fY - pts[0].fY), in tangent_quad()
3088 pts[0].fY - y, in tangent_quad()
3092 SkScalar C = pts[0].fX; in tangent_quad()
3093 SkScalar A = pts[2].fX - 2 * pts[1].fX + C; in tangent_quad()
3094 SkScalar B = 2 * (pts[1].fX - C); in tangent_quad()
3099 tangents->push(SkEvalQuadTangentAt(pts, t)); in tangent_quad()
3103 static void tangent_line(const SkPoint pts[], SkScalar x, SkScalar y, in tangent_line() argument
3105 SkScalar y0 = pts[0].fY; in tangent_line()
3106 SkScalar y1 = pts[1].fY; in tangent_line()
3110 SkScalar x0 = pts[0].fX; in tangent_line()
3111 SkScalar x1 = pts[1].fX; in tangent_line()
3144 SkPoint pts[4]; in contains() local
3145 switch (iter.next(pts, false)) { in contains()
3150 w += winding_line(pts, x, y, &onCurveCount); in contains()
3153 w += winding_quad(pts, x, y, &onCurveCount); in contains()
3156 w += winding_conic(pts, x, y, iter.conicWeight(), &onCurveCount); in contains()
3159 w += winding_cubic(pts, x, y, &onCurveCount); in contains()
3186 SkPoint pts[4]; in contains() local
3188 switch (iter.next(pts, false)) { in contains()
3193 tangent_line(pts, x, y, &tangents); in contains()
3196 tangent_quad(pts, x, y, &tangents); in contains()
3199 tangent_conic(pts, x, y, iter.conicWeight(), &tangents); in contains()
3202 tangent_cubic(pts, x, y, &tangents); in contains()
3231 SkScalar w, SkPoint pts[], int pow2) { in ConvertConicToQuads() argument
3233 return conic.chopIntoQuadsPOW2(pts, pow2); in ConvertConicToQuads()