SkIRect rect1 = SkIRect::MakeWH(10, 20); // Creates a rectangle with width 10 and height 20 if(rect1.isEmpty()) { // This block won't execute as rect1 is not empty }
SkIRect rect2 = SkIRect::MakeEmpty(); if(rect2.isEmpty()) { // This block will execute as rect2 is empty }In both the examples, we create SkIRect objects using the SkIRect::MakeWH and SkIRect::MakeEmpty methods. We then call the isEmpty method on the objects to determine if they are empty or not. The Skia library provides C++ classes and functions for 2D graphics rendering.