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

Carl Worth cworth at cworth.org
Fri Jan 28 04:10:41 PST 2011


On Fri, 28 Jan 2011 07:43:57 +0100, Benjamin Otte <otte at redhat.com> wrote:
> 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.

Yes, fair enough.

If we're going to have a getter like _get_patch_count that will work on
"mesh patterns" but not on other types of patterns, then it really would
be more consistent with the cairo API naming for that to be:

	cairo_mesh_pattern_get_patch_count

I think my earlier comment about liking the function name without "mesh"
at all was only in preference to the version with cairo_pattern_mesh
which is backwards.

So cairo_mesh_pattern_get_patch_count (and friends) should satisfy the
original point Behdad made about the functions needing to be
namespace-restricted to mesh patterns, and should do it in a way that's
consistent with the rest of the cairo API naming conventions.

-Carl

-- 
carl.d.worth at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.cairographics.org/archives/cairo/attachments/20110128/31b70314/attachment.pgp>


More information about the cairo mailing list