[cairo] New OpenGL backend merged

Chris Wilson chris at chris-wilson.co.uk
Thu Jul 23 02:40:40 PDT 2009


On Thu, 2009-07-23 at 11:01 +0200, Donn wrote:
> On Thursday, 23 July 2009 10:48:48 Jonathan Morton wrote:
> > If the GL is fast (as it usually is on recent
> > hardware), Cairo should be sped up by this.
> What happens if the GL is slow? Is there some automatic fall-back to what is 
> quickest, or would we have to detect this and switch the GL off?

Then we fix the GL implementation. The GL implementation should never be
slower than pixman. (Though there is a penalty to texture migration so
incurring fallbacks adds extra overhead. There are arguments both for
pushing that automatic migration down the stack as far as possible and
as high as possible. With my cairo hat on, I want to control migration
from within cairo...)

> > So 2D drawing is sent to Cairo, which uses OpenGL to help out.  
> At the risk of being overwhelmed (and it doesn't take much :) ) - what kinds 
> of things are being done by GL? I recently saw some demos by McSlow (Mirco 
> Muller ) which do vectors in GL - I got the idea that these are drawn by 
> actual 3D meshes (or paths) seen from above, is this the kind of thing?
> http://macslow.net/?p=267

As you know, Cairo is based compositing sources onto the destination
using a combination of masks and clipping. Accelerating the final
low-level composition is fairly easy as it that is just blending
textures. It is in the generation of the masks that most of the untapped
potential lies (although, avoiding intermediate surfaces for the complex
operators is worthwhile). The work cited above is based on:
http://research.microsoft.com/en-us/um/people/cloop/LoopBlinn05.pdf

which aims to offload curve interpolation and tessellation onto the GPU.
Going beyond that, you might want to keep the masks and clips as
implicit surfaces (that is presuming the geometry is more compact and
has a higher fill rate).

Looking further afield there are much more complex gradients being
worked on, i.e. the type 6 and 7 meshes from PS/PDF, for which h/w
acceleration would seem necessary. And there is the eternal hope for
arbitrary pixel shaders/filters.
-ickle



More information about the cairo mailing list