Lines Matching defs:path
63 static bool is_degenerate(const SkPath& path) {
64 return (path.countVerbs() - SkPathPriv::LeadingMoveToCount(path)) == 0;
69 SkAutoDisableDirectionCheck(SkPath* path) : fPath(path) {
82 /* This class's constructor/destructor bracket a path editing operation. It is
83 used when we know the bounds of the amount we are going to add to the path
86 It captures some state about the path up front (i.e. if it already has a
90 It also notes if the path was originally degenerate, and if so, sets
96 SkAutoPathBoundsUpdate(SkPath* path, const SkRect& r) : fPath(path), fRect(r) {
99 // Mark the path's bounds as dirty if (1) they are, or (2) the path
101 fHasValidBounds = path->hasComputedBounds() && path->isFinite();
102 fEmpty = path->isEmpty();
106 fDegenerate = is_degenerate(*path);
402 Determines if path is a rect by keeping track of changes in direction
414 The path is closed, and followed by a line.
420 The path contains a quadratic or cubic.
421 The path contains fewer than four points.
425 *These last two conditions we relax if we have a 3-edge path that would
426 form a rectangle if it were closed (as we do when we fill a path)
428 It's OK if the path has:
437 is a rectangle, though the caller failed to close the path.
849 // Chrome uses this path to move into and out of ovals. If not
856 // quad segments in the path prevents the path from being recognized as
1047 this path is still marked as an oval. This is used to
1050 moveTo() would mark the path non empty.
1176 // zero length path. This ensures continuity in animations.
1367 SkPath& SkPath::addPath(const SkPath& path, SkScalar dx, SkScalar dy, AddPathMode mode) {
1371 return this->addPath(path, matrix, mode);
1449 SkPath& SkPath::reversePathTo(const SkPath& path) {
1450 if (path.fPathRef->fVerbs.count() == 0) {
1454 const uint8_t* verbs = path.fPathRef->verbsEnd();
1455 const uint8_t* verbsBegin = path.fPathRef->verbsBegin();
1457 const SkPoint* pts = path.fPathRef->pointsEnd() - 1;
1458 const SkScalar* conicWeights = path.fPathRef->conicWeightsEnd();
1465 // if the path has multiple contours, stop after reversing the last
1554 static void subdivide_cubic_to(SkPath* path, const SkPoint pts[4],
1560 subdivide_cubic_to(path, &tmp[0], level);
1561 subdivide_cubic_to(path, &tmp[3], level);
1563 path->cubicTo(pts[1], pts[2], pts[3]);
1640 // Due to finite/fragile float numerics, we can't assume that a convex path remains
1689 SkPath::Iter::Iter(const SkPath& path, bool forceClose) {
1690 this->setPath(path, forceClose);
1693 void SkPath::Iter::setPath(const SkPath& path, bool forceClose) {
1694 fPts = path.fPathRef->points();
1695 fVerbs = path.fPathRef->verbsBegin();
1696 fVerbStop = path.fPathRef->verbsEnd();
1697 fConicWeights = path.fPathRef->conicWeights();
1831 void SkPath::RawIter::setPath(const SkPath& path) {
1832 SkPathPriv::Iterate iterate(path);
1913 builder.printf("path.setFillType(SkPathFillType::k%s);\n",
1918 append_params(&builder, "path.moveTo", &pts[0], 1, asType);
1921 append_params(&builder, "path.lineTo", &pts[1], 1, asType);
1924 append_params(&builder, "path.quadTo", &pts[1], 2, asType);
1927 append_params(&builder, "path.conicTo", &pts[1], 2, asType, iter.conicWeight());
1930 append_params(&builder, "path.cubicTo", &pts[1], 3, asType);
1933 builder.append("path.close();\n");
1936 SkDebugf(" path: UNKNOWN VERB %d, aborting dump...\n", verb);
1964 descSk.printf("path.setFillType(SkPath::k%s_FillType);\n", gFillTypeStrs[(int) this->getFillType()]);
1968 append_params(&descSk, "path.moveTo", &points[0], 1, kDec_SkScalarAsStringType);
1971 append_params(&descSk, "path.lineTo", &points[1], 1, kDec_SkScalarAsStringType);
1974 append_params(&descSk, "path.quadTo", &points[1], 2, kDec_SkScalarAsStringType);
1977 append_params(&descSk, "path.conicTo", &points[1], 2, kDec_SkScalarAsStringType, iter.conicWeight());
1980 append_params(&descSk, "path.cubicTo", &points[1], 3, kDec_SkScalarAsStringType);
1983 descSk.append("path.close();\n");
2052 builder.appendf("SkPath path = SkPath::Make(path_points, %d, path_verbs, %d, %s, %d,\n",
2083 // try path.addOval(2, 2, 2, 2) which is empty, but the bounds will
2123 /** The direction returned is only valid if the path is determined convex */
2232 // allow path to reverse direction twice
2233 // Given path.moveTo(0, 0); path.lineTo(1, 1);
2251 SkVector fLastVec {0, 0}; // The direction that brought the path to fLastPt
2288 // There's an additional moveTo between two blocks of other verbs, so the path must have
2299 // Check to see if path changes direction more than three times as quick concave test
2340 // there's multiple contours and the path can't be convex
2347 // If the path isn't explicitly closed do so implicitly
2531 SkPathFirstDirection SkPathPriv::ComputeFirstDirection(const SkPath& path) {
2532 auto d = path.getFirstDirection();
2539 if (path.getConvexityOrUnknown() == SkPathConvexity::kConvex) {
2544 ContourIter iter(*path.fPathRef);
2547 SkScalar ymax = path.getBounds().fTop;
2613 path.setFirstDirection(d);
3129 bool SkPathPriv::IsSimpleRect(const SkPath& path, bool isSimpleFill, SkRect* rect,
3131 if (path.getSegmentMasks() != SkPath::kLine_SegmentMask) {
3137 for (auto [v, verbPts, w] : SkPathPriv::Iterate(path)) {
3239 void SkPathPriv::CreateDrawArcPath(SkPath* path, const SkRect& oval, SkScalar startAngle,
3248 path->reset();
3249 path->setIsVolatile(true);
3250 path->setFillType(SkPathFillType::kWinding);
3252 path->addOval(oval);
3253 SkASSERT(path->isConvex() && DrawArcIsConvex(sweepAngle, false, isFillNoPathEffect));
3257 path->moveTo(oval.centerX(), oval.centerY());
3265 path->arcTo(oval, startAngle, -180.f, forceMoveTo);
3267 path->arcTo(oval, startAngle, -180.f, false);
3273 path->arcTo(oval, startAngle, 180.f, forceMoveTo);
3275 path->arcTo(oval, startAngle, 180.f, false);
3280 path->arcTo(oval, startAngle, sweepAngle, forceMoveTo);
3282 path->close();
3284 path->setConvexity(convex ? SkPathConvexity::kConvex : SkPathConvexity::kConcave);
3285 path->setFirstDirection(firstDir);
3501 bool SkPathPriv::IsRectContour(const SkPath& path, bool allowPartial, int* currVerb,
3518 int verbCnt = path.fPathRef->countVerbs();
3520 uint8_t verb = insertClose ? (uint8_t) SkPath::kClose_Verb : path.fPathRef->atVerb(*currVerb);
3537 return false; // path contains infinity or NaN
3642 bool SkPathPriv::IsNestedFillRects(const SkPath& path, SkRect rects[2], SkPathDirection dirs[2]) {
3643 SkDEBUGCODE(path.validate();)
3645 const SkPoint* pts = path.fPathRef->points();
3648 if (!IsRectContour(path, true, &currVerb, &pts, nullptr, &testDirs[0], &testRects[0])) {
3651 if (IsRectContour(path, false, &currVerb, &pts, nullptr, &testDirs[1], &testRects[1])) {
3743 // the path is either all on one side of the half-plane or the other
3755 // If we fail in our calculations, we return the empty path
3756 static SkPath clip(const SkPath& path, const SkHalfPlane& plane) {
3767 path.transform(inv, &rotated);
3817 rec.fResult.setFillType(path.getFillType());
3826 bool SkPathPriv::PerspectiveClip(const SkPath& path, const SkMatrix& matrix, SkPath* clippedPath) {
3837 switch (plane.test(path.getBounds())) {
3841 *clippedPath = clip(path, plane);
3852 int SkPathPriv::GenIDChangeListenersCount(const SkPath& path) {
3853 return path.fPathRef->genIDChangeListenerCount();
3856 bool SkPathPriv::IsAxisAligned(const SkPath& path) {
3861 const SkPoint* pts = path.fPathRef->points();
3862 const int count = path.fPathRef->countPoints();