[cairo] Looking for some advices
Alexandre Bique
bique.alexandre at gmail.com
Thu Aug 28 11:11:30 PDT 2014
On Thu, Aug 28, 2014 at 7:56 PM, Bryce Harrington <bryce at osg.samsung.com> wrote:
> On Thu, Aug 28, 2014 at 09:30:43AM +0200, Alexandre Bique wrote:
>> Hi,
>>
>> I'm using cairo on Linux to render to screen.
>>
>> First I'd like to know the pros/cons of cairo's backends (xlib, xcb, gl).
>
> You didn't mention the image backend, but that should be discussed
> first. Its pros are that it is the most widely tested, has benefitted
> from a lot of optimizations, and seems to renders the best of all the
> backends. Since its a software renderer, performance is the principle
> con, but actually for many uses it has quite acceptable performance.
And this backend would avoid flickering?
If I use cairo_groups, is the group being rendered into a cairo image surface?
> In general you should prefer xcb over xlib. xcb is intended as the
> replacement for xlib. From my testing you should see little performance
> or functional difference between them.
Is cairo-xcb as distributed as cairo-xlib? I remember a time on
archlinux where you had to use AUR to get cairo-xcb.
In my situation, I'm building the GUI for a VST. The host gives me an
Xlib Window, and I have to embed my own Window into it. Do you think
that it could also be done with xcb?
> For distributable applications to be run on Linux desktops, I think gl
> can't be recommended. Most distributions don't ship with gl-enabled
> cairo, so you'd have to jump through hoops to get it.
OK, then I wont spend to much efforts on this backend.
> In theory, cairo-gl should be faster than cairo-xcb, at least for some
> operations. In practice the performance tends to be kind of a mixed
> bag. So if you're performance limited you might take a look to see if
> using it would help.
The performances are alright except for one operation. I think it
could just be the way I do the rendering which has to be optimized.
I'll try to make a cairo script.
> Where gl (and egl) tends to be looked at the most is for embedded
> devices, but often in those cases you can do better by using a different
> drawing library more optimized for the egl case.
Thanks a lot!
--
Alexandre Bique
More information about the cairo
mailing list