[cairo] New OpenGL backend merged

John C. Turnbull ozemale at ozemail.com.au
Thu Jul 23 02:20:28 PDT 2009


> From: Chris Wilson [mailto:chris at chris-wilson.co.uk]
> Sent: Thursday, 23 July 2009 19:00
> To: John C. Turnbull
> Cc: Cairo list
> Subject: Re: [cairo] New OpenGL backend merged
> 
> A backend for Cairo provides a means of rendering through the Cairo API
> to a particular architecture. For example, to render to a PDF file, you
> create a PDF surface which uses the PDF backend. Similarly for the
> other
> vector file formats. For raster devices, i.e. your display or a pixel
> buffer, everything is slightly more complicated due to the varied
> hardware architectures and desire to interoperate with the various
> libraries. The 'simplest' raster backend is the image backend which
> uses
> pixman as a software compositor. Then we have the native backends such
> as win32, quartz and xlib, which use the native windowing system to
> provide acceleration wherever possible and we fallback to pixman when
> not. More often than we would like, we have to fallback to pixman (or
> in
> the case of xlib, the server has to fallback to pixman and is unable to
> accelerate our request).
> 
> The promise of a direct rendering interface like OpenGL or DRM is that
> we can issue commands to the GPU independent of the native windowing
> system. This means we can completely bypass the partial support for
> Cairo exposed through the native 2D API and implement acceleration for
> any layer of Cairo - for example, offloading of high-quality
> tessellation onto the GPU is a long desired goal. In the short term, it
> means that we can actually provide h/w accelerated sampler (images,
> gradients - as already demonstrated by glitz) and use the more
> efficient
> rasterisation techniques that have not yet been propagated through
> RENDER to the xorg drivers.
> 
> The other aspect of the OpenGL backend is that it will allow more
> convenient interoperation of Cairo with OpenGL programs. Currently you
> have to render to an image buffer and use that as a texture if you want
> to take advantage of the Cairo inside you GL application. With the
> image
> backend, you should be able to use cairo-gl to render directly using
> the
> GPU into textures (or straight on to the framebuffer).
> 
> I hope that helps to clarify a few concepts. Keep having fun using
> Cairo!

Thanks very much for that Chris - it has helped me a lot.

One thing I have noticed about OpenGL is that it seems to be difficult to
achieve good antialiasing because this appears to be under the control of
the graphics driver and therefore the end user can turn it on or off.  Does
using an OpenGL back-end for Cairo mean that it will also suffer from this
problem?  Or is there a way to force antialiasing on at all times when using
OpenGL?

Thanks,

-JCT



More information about the cairo mailing list