[cairo] Do MeshGradients not respect cairo_pattern_set_extend() ?

Adrian Johnson ajohnson at redneon.com
Wed Mar 28 01:03:49 PDT 2012


On 28/03/12 18:02, Travis Griggs wrote:
> First of all. Mucho HUGE Gracias to those who pushed the mesh gradient
> stuff in. I've been waiting for this for a while. It is tres cool!

Andrea Canciani wrote the mesh gradient rasterizer and did most of the
work to get mesh gradients in to cairo. There is also an experimental
branch of Inkscape with mesh gradient support[1] and it looks like SVG
is going to include mesh gradients[2].

> I'm playing a little with them in the updated 1.12.0 binding for
> Smalltalk and it's fun what you can do. I've had luck using them with
> ImageSurfaces. But not with a Quartz windows surface yet. BUT… that may
> be a side effect of the Smalltalk virtual machine, need to look into
> that some more. And it may be that it's because I'm using a binary that
> appears to have been just a bit before 1.12.0 was finally pushed out, so
> maybe there's an issue there.
> 
> What I did notice with ImageSurface and MeshGradient though, is that it
> doesn't seem to matter what I set using cairo_pattern_set_extend(), it's
> always just bound by the patch. Is that to be expected? Here's the code
> I used (it's Smalltalk, but I think the general jst there)

Yes that is expected. Extend modes don't make sense for mesh gradients.
This is documented at:

http://www.cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-extend-t

[1] http://tavmjong.free.fr/SVG/MESH/Mesh_Inkscape.html
[2] http://tavmjong.free.fr/SVG/SVGOpen2011/MESH/svg_2011_mesh.svg#21_0


More information about the cairo mailing list