SkPath path; SkRect rect = SkRect::MakeXYWH(50, 50, 100, 100); path.addRect(rect);
SkPath path; path.addRect(50, 50, 100, 100, SkPathDirection::kCW);In this example, we are adding a rectangle with top left corner at (50, 50) and width and height of 100 units. The last argument, SkPathDirection::kCW, specifies that the path is created in clockwise direction. Package library: Skia library.