[cairo] acceleration

Chris Wilson chris at chris-wilson.co.uk
Tue Oct 2 04:39:24 PDT 2012


On Tue, 2 Oct 2012 21:25:43 +1000 (EST), "Patrick Shirkey" <pshirkey at boosthardware.com> wrote:
> 
> On Tue, October 2, 2012 9:16 pm, Chris Wilson wrote:
> > On Tue, 2 Oct 2012 15:35:38 +1000 (EST), "Patrick Shirkey"
> > <pshirkey at boosthardware.com> wrote:
> >> Hi,
> >>
> >> Is there a simple test to know if cairo is using acceleration or is it
> >> just a matter of running a desktop with glx?
> >
> > Cairo dodges the complicated question of how to setup the rendering
> > pipeline leaving that to the application/toolkit. So in order for cairo
> > to use GL, the application must create a set of output Windows
> > compatible with GL and pass those and the context to cairo to use. The
> > degree of acceleration then depends upon the quality of the driver and
> > the style of rendering. In short, do not expect to switching to cairo-gl
> > to be an easy task to get fast rendering.
> 
> Thanks Chris.
> 
> Is the recommended approached to use cogl directly, cairo or clutter?

Use the appropriate tool to hand :)

Clutter is excellent for controlling animations and emergent behaviour.
Cairo offers a simple means for describing a page layout (or parts there
of).
Cogl aims to make using OpenGL simpler and more portable, with a few
additional smarts.
 
> FYI, I am using python3 with gtk3 and so far the only code I have been
> able to make work with this combination are the clutter examples.
> 
> I have some existing opengl. I am looking at either porting it to
> cogl/clutter or if there is a way to load it directly with cairo that I
> have yet to come across.

If you are starting from OpenGL, probably easier to go to clutter+cogl.
Cairo comes into its own for having a higher level description of paths
and shapes, but if you already are well versed in translating into
OpenGL, then you probably do not need Cairo and will probably be better
to avoid the impedance mismatch between the PDF rendering model and
OpenGL. However, if Cairo makes your design and maintenance easier, have
fun!
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the cairo mailing list