[cairo] new pattern interface and OpenGL patch

David Reveman c99drn at cs.umu.se
Sun Mar 21 17:07:09 PST 2004

I've put together a pattern/OpenGL patch which I'd appreciate if you,
who are interested, looked over. 

It includes a new pattern system with support for linear and radial
patterns. Linear and Gaussian shader functions are built in, the
interface also allows the application to specify its own shader
functions. This pattern interface allow all combinations of patterns and
shader functions to be accelerated by the OpenGL backend using libglc's
new color range interface. Even pattern extend types repeat and reflect
are supported by the OpenGL backend.

The software implementation of radial patterns is missing focal point
support right now, but other than that, software implementations of all
patterns are in there.

I've left the old interface with surface_set_repeat, surface_set_matrix,
surface_set_filter... in there, so that old applications still work. The
old and new interface work fine together but we should probably remove
the old one when the new interface has been proven to work correctly.

The new pattern interface works fine for all applications that I;ve
tested but I'd be surprised if there ain't a couple of bugs in there.
Just so you know. :-)

Please look over the patch. I'd like to get the OpenGL backend committed
to cairo CVS and the best would be if we could get the new pattern
interface committed at the same time, as it's very important for the
OpenGL backend to work efficiently. I can off course put together a
OpenGL backend patch without the pattern interface if it becomes

The name of the patch is:

The extra API functions earlier supplied by the OpenGL backend patch are
now in a separate patch: 

the patches and some test applications are available from here:

a few screenshots (some of them from libsvg-cairo using a patch
available from above):

- David

David Reveman <c99drn at cs.umu.se>

More information about the cairo mailing list