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

Nikita Zlobin nick87720z at gmail.com
Tue Mar 8 21:23:35 UTC 2022


I tried to implement text shadow by prerendering text and overlaying it
multiple times (hoping to get better performance, than just drawing
pango layout each time).

Main surface is X window.

Tried 3 methods:
- image surface as intermediate, manually painting it
with transparency and offset,
- cairo groups,
- xpixmap surface for intermediate, overlaying with xrender composite
  call.

Can't remember performance with groups - only remembering, they are
faster than image surf, however same is for manual xrender call.

Unfortunally, using xpixmap-based surface as source did not work - I
tried to work, but I got emptyness (black fill). Never tried Cogl
though, since I use cairo from distro, which is at 1.16.0.

I already was told there, that cairo uses intermediate image for groups.

Q: Do cairo groups use backend-specific type of surface, such as
xpixmap with X11 as main backend?
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.

For opengl-based backends this could be opengl texture, which also
could be overlaid directly if used as source to draw to same type of
surface.


More information about the cairo mailing list