[cairo] API Shakeup: Eliminating cairo_surface_set_repeat/matrix/filter

Carl Worth cworth at cworth.org
Wed Feb 23 07:43:26 PST 2005


There has long been an API wart left over from before we had a
distinct notion of a pattern separate from a surface. Now that we're
doing this API shakeup, I propose finally acting on that comment in
cairo.h and eliminating the following functions:

	cairo_surface_set_repeat
	cairo_surface_set_matrix
	cairo_surface_get_matrix
	cairo_surface_set_filter
	cairo_surface_get_filter

I was going to propose replacement cairo_pattern functions for each of
these, but I just realized we have had them since the pattern stuff
landed, we've just been carrying the old surface cruft along this
whole time.

One thing I do want to revisit during the shakeup is the mechanism for
specifying the color values that patterns provide "outside" their core
region, (eg. surface data or gradient within the [0..1] range of color
stops). What we currently have in cairo is:

	typedef enum {
	    CAIRO_EXTEND_NONE,
	    CAIRO_EXTEND_REPEAT,
	    CAIRO_EXTEND_REFLECT
	} cairo_extend_t;

Which is noticeably missing a value to indicate padding out with the
border color, (or equivalently, that the nearest defined color should
be chosen). Looking at glitz, it looks like it provides that extra
value, and it also has a better name of TRANSPARENT instead of NONE.

So, I propose changing the enum to:

	typedef enum {
	    CAIRO_EXTEND_TRANSPARENT,
	    CAIRO_EXTEND_NEAREST,
	    CAIRO_EXTEND_REPEAT,
	    CAIRO_EXTEND_REFLECT
	} cairo_extend_t;

-Carl



-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050223/0733976b/attachment.pgp


More information about the cairo mailing list