Index: pixman/src/icimage.c =================================================================== RCS file: /cvs/cairo/cairo/pixman/src/icimage.c,v retrieving revision 1.32 diff -p -u -r1.32 icimage.c --- pixman/src/icimage.c 28 Aug 2005 02:32:57 -0000 1.32 +++ pixman/src/icimage.c 9 Oct 2005 15:44:01 -0000 @@ -105,7 +105,7 @@ void pixman_image_init (pixman_image_t *image) { image->refcnt = 1; - image->repeat = 0; + image->repeat = PIXMAN_REPEAT_NONE; image->graphicsExposures = 0; image->subWindowMode = ClipByChildren; image->polyEdge = PolyEdgeSharp; @@ -199,8 +199,8 @@ pixman_image_set_transform (pixman_image } void -pixman_image_set_repeat (pixman_image_t *image, - int repeat) +pixman_image_set_repeat (pixman_image_t *image, + pixman_repeat_t repeat) { if (image) image->repeat = repeat; @@ -377,7 +377,8 @@ FbClipImageSrc (pixman_region16_t *regio /* XXX what to do with clipping from transformed pictures? */ if (image->transform) return 1; - if (image->repeat) + /* XXX davidr hates this, wants to never use source-based clipping */ + if (image->repeat != PIXMAN_REPEAT_NONE) { /* XXX no source clipping */ if (image->compositeClipSource && Index: pixman/src/icrect.c =================================================================== RCS file: /cvs/cairo/cairo/pixman/src/icrect.c,v retrieving revision 1.19 diff -p -u -r1.19 icrect.c --- pixman/src/icrect.c 28 Aug 2005 02:32:57 -0000 1.19 +++ pixman/src/icrect.c 9 Oct 2005 15:44:01 -0000 @@ -346,7 +346,7 @@ pixman_fill_rectangles (pixman_operator_ if (!src) goto bail2; - pixman_image_set_repeat (src, 1); + pixman_image_set_repeat (src, PIXMAN_REPEAT_NORMAL); while (nRects--) { Index: pixman/src/pixman.h =================================================================== RCS file: /cvs/cairo/cairo/pixman/src/pixman.h,v retrieving revision 1.23 diff -p -u -r1.23 pixman.h --- pixman/src/pixman.h 7 Sep 2005 23:57:59 -0000 1.23 +++ pixman/src/pixman.h 9 Oct 2005 15:44:01 -0000 @@ -348,9 +348,17 @@ int pixman_image_set_transform (pixman_image_t *image, pixman_transform_t *transform); +/* Don't blame me, blame XRender */ +typedef enum { + PIXMAN_REPEAT_NONE, + PIXMAN_REPEAT_NORMAL, + PIXMAN_REPEAT_PAD, + PIXMAN_REPEAT_REFLECT +} pixman_repeat_t; + void -pixman_image_set_repeat (pixman_image_t *image, - int repeat); +pixman_image_set_repeat (pixman_image_t *image, + pixman_repeat_t repeat); void pixman_image_set_filter (pixman_image_t *image, Index: src/cairo-glitz-surface.c =================================================================== RCS file: /cvs/cairo/cairo/src/cairo-glitz-surface.c,v retrieving revision 1.62 diff -p -u -r1.62 cairo-glitz-surface.c --- src/cairo-glitz-surface.c 19 Sep 2005 14:18:51 -0000 1.62 +++ src/cairo-glitz-surface.c 9 Oct 2005 15:44:03 -0000 @@ -674,7 +674,7 @@ _cairo_glitz_pattern_acquire_surface (ca switch (pattern->extend) { case CAIRO_EXTEND_NONE: - attr->fill = GLITZ_FILL_NEAREST; + attr->fill = GLITZ_FILL_TRANSPARENT; break; case CAIRO_EXTEND_REPEAT: attr->fill = GLITZ_FILL_REPEAT; @@ -682,6 +682,9 @@ _cairo_glitz_pattern_acquire_surface (ca case CAIRO_EXTEND_REFLECT: attr->fill = GLITZ_FILL_REFLECT; break; + case CAIRO_EXTEND_NEAREST: + attr->fill = GLITZ_FILL_NEAREST; + break; } attr->params = params; Index: src/cairo-image-surface.c =================================================================== RCS file: /cvs/cairo/cairo/src/cairo-image-surface.c,v retrieving revision 1.60 diff -p -u -r1.60 cairo-image-surface.c --- src/cairo-image-surface.c 28 Aug 2005 01:40:47 -0000 1.60 +++ src/cairo-image-surface.c 9 Oct 2005 15:44:03 -0000 @@ -480,14 +480,6 @@ _cairo_image_surface_set_filter (cairo_i return CAIRO_STATUS_SUCCESS; } -static cairo_status_t -_cairo_image_surface_set_repeat (cairo_image_surface_t *surface, int repeat) -{ - pixman_image_set_repeat (surface->pixman_image, repeat); - - return CAIRO_STATUS_SUCCESS; -} - static cairo_int_status_t _cairo_image_surface_set_attributes (cairo_image_surface_t *surface, cairo_surface_attributes_t *attributes) @@ -500,14 +492,16 @@ _cairo_image_surface_set_attributes (cai switch (attributes->extend) { case CAIRO_EXTEND_NONE: - _cairo_image_surface_set_repeat (surface, 0); + pixman_image_set_repeat (surface->pixman_image, PIXMAN_REPEAT_NONE); break; case CAIRO_EXTEND_REPEAT: - _cairo_image_surface_set_repeat (surface, 1); + pixman_image_set_repeat (surface->pixman_image, PIXMAN_REPEAT_NORMAL); break; case CAIRO_EXTEND_REFLECT: - /* XXX: Obviously wrong. */ - _cairo_image_surface_set_repeat (surface, 1); + pixman_image_set_repeat (surface->pixman_image, PIXMAN_REPEAT_REFLECT); + break; + case CAIRO_EXTEND_NEAREST: + pixman_image_set_repeat (surface->pixman_image, PIXMAN_REPEAT_PAD); break; } Index: src/cairo-pattern.c =================================================================== RCS file: /cvs/cairo/cairo/src/cairo-pattern.c,v retrieving revision 1.65 diff -p -u -r1.65 cairo-pattern.c --- src/cairo-pattern.c 30 Aug 2005 17:42:17 -0000 1.65 +++ src/cairo-pattern.c 9 Oct 2005 15:44:04 -0000 @@ -50,7 +50,7 @@ const cairo_solid_pattern_t cairo_patter CAIRO_STATUS_NO_MEMORY, /* status */ { 1., 0., 0., 1., 0., 0., }, /* matrix */ CAIRO_FILTER_DEFAULT, /* filter */ - CAIRO_EXTEND_DEFAULT }, /* extend */ + CAIRO_EXTEND_GRADIENT_DEFAULT }, /* extend */ }; static const cairo_solid_pattern_t cairo_pattern_nil_null_pointer = { @@ -59,7 +59,7 @@ static const cairo_solid_pattern_t cairo CAIRO_STATUS_NULL_POINTER,/* status */ { 1., 0., 0., 1., 0., 0., }, /* matrix */ CAIRO_FILTER_DEFAULT, /* filter */ - CAIRO_EXTEND_DEFAULT }, /* extend */ + CAIRO_EXTEND_GRADIENT_DEFAULT }, /* extend */ }; static const cairo_solid_pattern_t cairo_pattern_nil_file_not_found = { @@ -68,7 +68,7 @@ static const cairo_solid_pattern_t cairo CAIRO_STATUS_FILE_NOT_FOUND, /* status */ { 1., 0., 0., 1., 0., 0., }, /* matrix */ CAIRO_FILTER_DEFAULT, /* filter */ - CAIRO_EXTEND_DEFAULT }, /* extend */ + CAIRO_EXTEND_GRADIENT_DEFAULT }, /* extend */ }; static const cairo_solid_pattern_t cairo_pattern_nil_read_error = { @@ -77,7 +77,7 @@ static const cairo_solid_pattern_t cairo CAIRO_STATUS_READ_ERROR, /* status */ { 1., 0., 0., 1., 0., 0., }, /* matrix */ CAIRO_FILTER_DEFAULT, /* filter */ - CAIRO_EXTEND_DEFAULT }, /* extend */ + CAIRO_EXTEND_GRADIENT_DEFAULT }, /* extend */ }; static const cairo_pattern_t * @@ -131,7 +131,12 @@ _cairo_pattern_init (cairo_pattern_t *pa pattern->type = type; pattern->ref_count = 1; pattern->status = CAIRO_STATUS_SUCCESS; - pattern->extend = CAIRO_EXTEND_DEFAULT; + + if (type == CAIRO_PATTERN_SURFACE) + pattern->extend = CAIRO_EXTEND_SURFACE_DEFAULT; + else + pattern->extend = CAIRO_EXTEND_GRADIENT_DEFAULT; + pattern->filter = CAIRO_FILTER_DEFAULT; cairo_matrix_init_identity (&pattern->matrix); @@ -930,6 +935,7 @@ _cairo_pattern_calc_color_at_pixel (cair factor -= factor & 0xffff0000; } break; + case CAIRO_EXTEND_NEAREST: case CAIRO_EXTEND_NONE: break; } Index: src/cairo-pdf-surface.c =================================================================== RCS file: /cvs/cairo/cairo/src/cairo-pdf-surface.c,v retrieving revision 1.59 diff -p -u -r1.59 cairo-pdf-surface.c --- src/cairo-pdf-surface.c 7 Oct 2005 20:21:01 -0000 1.59 +++ src/cairo-pdf-surface.c 9 Oct 2005 15:44:04 -0000 @@ -79,8 +79,6 @@ * * - Add test case for RGBA gradients. * - * - Pattern extend isn't honoured by image backend. - * * - Coordinate space for create_similar() args? * * - Investigate /Matrix entry in content stream dicts for pages Index: src/cairo-xcb-surface.c =================================================================== RCS file: /cvs/cairo/cairo/src/cairo-xcb-surface.c,v retrieving revision 1.47 diff -p -u -r1.47 cairo-xcb-surface.c --- src/cairo-xcb-surface.c 10 Aug 2005 21:30:15 -0000 1.47 +++ src/cairo-xcb-surface.c 9 Oct 2005 15:44:05 -0000 @@ -787,6 +787,8 @@ _cairo_xcb_surface_set_attributes (cairo break; case CAIRO_EXTEND_REFLECT: return CAIRO_INT_STATUS_UNSUPPORTED; + case CAIRO_EXTEND_NEAREST: + return CAIRO_INT_STATUS_UNSUPPORTED; } status = _cairo_xcb_surface_set_filter (surface, attributes->filter); Index: src/cairo-xlib-surface.c =================================================================== RCS file: /cvs/cairo/cairo/src/cairo-xlib-surface.c,v retrieving revision 1.122 diff -p -u -r1.122 cairo-xlib-surface.c --- src/cairo-xlib-surface.c 6 Oct 2005 18:32:54 -0000 1.122 +++ src/cairo-xlib-surface.c 9 Oct 2005 15:44:06 -0000 @@ -937,6 +937,7 @@ _cairo_xlib_surface_set_attributes (cair _cairo_xlib_surface_set_repeat (surface, 1); break; case CAIRO_EXTEND_REFLECT: + case CAIRO_EXTEND_NEAREST: return CAIRO_INT_STATUS_UNSUPPORTED; } Index: src/cairo.h =================================================================== RCS file: /cvs/cairo/cairo/src/cairo.h,v retrieving revision 1.152 diff -p -u -r1.152 cairo.h --- src/cairo.h 7 Sep 2005 23:31:22 -0000 1.152 +++ src/cairo.h 9 Oct 2005 15:44:06 -0000 @@ -1292,7 +1292,8 @@ cairo_pattern_get_matrix (cairo_pattern_ typedef enum _cairo_extend { CAIRO_EXTEND_NONE, CAIRO_EXTEND_REPEAT, - CAIRO_EXTEND_REFLECT + CAIRO_EXTEND_REFLECT, + CAIRO_EXTEND_NEAREST } cairo_extend_t; cairo_public void Index: src/cairoint.h =================================================================== RCS file: /cvs/cairo/cairo/src/cairoint.h,v retrieving revision 1.211 diff -p -u -r1.211 cairoint.h --- src/cairoint.h 19 Sep 2005 21:24:00 -0000 1.211 +++ src/cairoint.h 9 Oct 2005 15:44:07 -0000 @@ -821,7 +821,8 @@ typedef enum { CAIRO_STOCK_TRANSPARENT } cairo_stock_t; -#define CAIRO_EXTEND_DEFAULT CAIRO_EXTEND_NONE +#define CAIRO_EXTEND_SURFACE_DEFAULT CAIRO_EXTEND_NONE +#define CAIRO_EXTEND_GRADIENT_DEFAULT CAIRO_EXTEND_NEAREST #define CAIRO_FILTER_DEFAULT CAIRO_FILTER_BEST typedef enum {