[cairo] Does cairo use backend-specific support for groups?

Uli Schlachter psychon at znc.in
Wed Mar 9 15:37:40 UTC 2022


Hi,

Am 08.03.22 um 22:23 schrieb Nikita Zlobin:
[...]
> Q: Do cairo groups use backend-specific type of surface, such as
> xpixmap with X11 as main backend?

Yes. A group basically uses cairo_surface_create_similar() and then
temporarily redirects drawing to that surface (until the corresponding pop).

> For now I'm not finally sure if manual xrender'ing two pixmaps is better
> than using cairo groups, I only know - it's certainly better than using
> image surfaces as source.

Well, if you use an image surface as a source, that image surface has to
be uploaded to the X11 server. This likely involves several copies if
the image is not allocated with shared memory. If your image is large,
it might be beneficial to at least use
cairo_surface_create_similar_image() to get a shared-memory-backed image.

Cheers,
Uli
-- 
"In the beginning the Universe was created. This has made a lot of
 people very angry and has been widely regarded as a bad move."


More information about the cairo mailing list