[cairo] mesh APi naming (was: cairo snapshot 1.11.2 now available)

Benjamin Otte otte at redhat.com
Thu Jan 27 22:43:57 PST 2011


On Thu, 2011-01-27 at 21:00 +0000, Chris Wilson wrote:
> > Why are we using cairo_pattern_mesh_foo instead of
> > cairo_mesh_pattern_foo in the API?
> > Isn't it a mesh pattern and not a pattern mesh?
> 
> The public struct is cairo_pattern_t and the other specialised setters
> take the form cairo_pattern_add_color_stop_rgba. Though the existing
> gradients do not require such a complicated constructor.
> 
Yeah, I think that was a mistake in retrospect. It works very well if
you only intend to have 3 different pattern types and don't do a real
object system - like the situation was when Carl created the universe.
But now where we get mesh patterns and are still thinking about more
pattern types (like blur filters etc), I think it makes sense to apply
the same naming we do for the other "real" objects: surfaces.
And that's cairo_foo_surface_get_bar(). So I'm thinking
cairo_foo_pattern_get_bar() is the right thing to do.

Benjamin



More information about the cairo mailing list