SkPath myPath; SkRect rect = SkRect::MakeXYWH(100, 100, 200, 150); SkScalar radii[8] = {10, 10, 30, 30, 0, 0, 20, 20}; myPath.addRoundRect(rect, radii);
SkPath myPath; SkRect rect = SkRect::MakeXYWH(50, 50, 150, 150); myPath.addRoundRect(rect, 20, 20);This example is similar to the previous one but only uses two radii values which results in a less round shape. Overall, the SkPath addRoundRect function is used to create a rounded rectangle shape in your graphics design. It belongs to the Skia Graphics Library package.