I need a clip region that exists of a several (possibly overlapping) rectangles, but can't figure out how to create one with cairo.
Since there is a
cairo_rectangle_list_t *
cairo_copy_clip_rectangle_list (cairo_t *cr);
I assumed that the clip region CAN exist of more than one rectangle (if not, then this wouldn't return a list of rectangles...)
Moreover, cairo_rectangle_list_t exists - surely I can create a list of rectangles myself then... and create the clip region from that?
But how?
Just create a path that consists of several rectangles and clip with it. Here is an example with two overlapping rectangles, but it works just as well with more.