SkPath path; SkRect rect = SkRect::MakeLTRB(0, 0, 100, 50); path.addRect(rect);
SkPath path; SkPoint center = SkPoint::Make(50, 50); skScalar radius = 25; path.addCircle(center, radius);
SkPath path; SkPoint pts[3] = { SkPoint::Make(50, 0), SkPoint::Make(0, 100), SkPoint::Make(100, 100) }; path.addRoundRect(SkRect::Make(pts, 3), 15, 15);This code creates an array of three SkPoint objects representing the vertices of a triangle. It then creates an SkRect object that completely contains the triangle using the Make() method with the array of points and the number of points. Finally, it adds a rounded rectangle with the specified corner radii to the path using the addRoundRect() method. Overall, SkPath is a powerful class in the Skia Graphics Library that allows you to create complex 2D paths for use in your graphics applications.