SkPath path; path.moveTo(10, 10); path.lineTo(50, 50); SkRect bounds = path.getBounds(); // bounds = SkRect{10, 10, 50, 50}
SkPath path1; path1.addCircle(10, 10, 10); SkPath path2; path2.addRect(SkRect::MakeLTRB(20, 20, 30, 30)); SkPath path3; path3.addRRect(SkRRect::MakeRectXY(SkRect::MakeLTRB(40, 40, 60, 70), 5, 5)); SkPath totalPath; totalPath.addPath(path1); totalPath.addPath(path2); totalPath.addPath(path3); SkRect bounds = totalPath.getBounds(); // bounds = SkRect{10, 10, 60, 70}In this example, three separate paths are created and then added to a single path using the `addPath` method. The `getBounds` method is then called on the total path to obtain the combined bounds of all three paths. The SkPath class is part of the Skia Graphics Library, which is a popular open-source graphics engine used in many applications across multiple platforms, including Android, Chrome, and Firefox.