[Cairo] gtk2 cairo engine

jboulnois at neo-rousseaux.org jboulnois at neo-rousseaux.org
Tue Jul 29 08:33:13 PDT 2003

> Great work! This looks quite interesting. Let me know if there are any
> aspects of the Cairo API that make this task especially painful, (or
> even especially pleasant).
I found in cairo an easy way to make my own gtk engine (unlike gdk).
The API has just enough functions to be understood quickly and to do powerfull
Really good work!

> One thing I noticed in the code:
> 	  cairo_t *xrs=cairo_create();
> 	  xrs=cairo_create();
> That allocates two separate cairo_t structures (and leaks the first
> one). You definitely don't want to do that.
I definitely don't want to do that !

> Also, if you are interested, you might try rendering gradients with
> Cairo. The OLS paper has an example that shows how you can achieve
> linear gradients, (you'll have to change the XrNames to cairo_names of
> course):
> http://cairographics.org/xr_ols2003/html/xr_ols2003.html#fig:outline_source
> The idea is to draw a small Nx1 image with one pixel per component of
> the gradient, (eg. in the black->white->black gradients in the paper,
> N=3). Then set a matrix to scale this image to the size of the object
> to be filled and set it to use bilinear interpolation when
> scaling. Apply the scaled image using cairo_set_pattern, then fill and
> Voila! a lovely, smooth gradient.

I have integreted gradient in the engine, for now, gradients are compiled with
the engine but it will be possible to setup gradient in gtk RC file to choose
the direction and number of colors in them.
With gradients theme looks so good!

The new archive is avaible at 

Julien Boulnois <jboulnois at neo-rousseaux.org>

More information about the cairo mailing list