[PS/PDF] Mark CAIRO_EXTEND_PAD for surface patterns as natively supported

since the image surface does not implement that case either, so image
fallbacks have no benefit.
This commit is contained in:
Behdad Esfahbod 2007-03-01 19:14:40 -05:00
parent 4ee6cda6e5
commit ec11ca33a7
2 changed files with 14 additions and 10 deletions

View file

@ -903,6 +903,8 @@ emit_surface_pattern (cairo_pdf_surface_t *surface,
_cairo_surface_get_extents (&surface->base, &surface_extents);
switch (extend) {
/* We implement EXTEND_PAD like EXTEND_NONE for now */
case CAIRO_EXTEND_PAD:
case CAIRO_EXTEND_NONE:
{
/* In PS/PDF, (as far as I can tell), all patterns are
@ -936,9 +938,8 @@ emit_surface_pattern (cairo_pdf_surface_t *surface,
xstep = image->width;
ystep = image->height;
break;
/* All the rest should have been analyzed away, so this case
* should be unreachable. */
case CAIRO_EXTEND_PAD:
/* All the rest (if any) should have been analyzed away, so this
* case should be unreachable. */
default:
ASSERT_NOT_REACHED;
xstep = 0;
@ -2568,9 +2569,10 @@ _surface_pattern_supported (cairo_surface_pattern_t *pattern)
case CAIRO_EXTEND_NONE:
case CAIRO_EXTEND_REPEAT:
case CAIRO_EXTEND_REFLECT:
return TRUE;
/* There's no point returning FALSE for EXTEND_PAD, as the image
* surface does not currently implement it either */
case CAIRO_EXTEND_PAD:
return FALSE;
return TRUE;
}
ASSERT_NOT_REACHED;

View file

@ -1356,9 +1356,10 @@ surface_pattern_supported (const cairo_surface_pattern_t *pattern)
case CAIRO_EXTEND_NONE:
case CAIRO_EXTEND_REPEAT:
case CAIRO_EXTEND_REFLECT:
return TRUE;
/* There's no point returning FALSE for EXTEND_PAD, as the image
* surface does not currently implement it either */
case CAIRO_EXTEND_PAD:
return FALSE;
return TRUE;
}
ASSERT_NOT_REACHED;
@ -1733,6 +1734,8 @@ emit_surface_pattern (cairo_ps_surface_t *surface,
bbox_height = image->height;
switch (pattern->base.extend) {
/* We implement EXTEND_PAD like EXTEND_NONE for now */
case CAIRO_EXTEND_PAD:
case CAIRO_EXTEND_NONE:
{
/* In PS/PDF, (as far as I can tell), all patterns are
@ -1766,9 +1769,8 @@ emit_surface_pattern (cairo_ps_surface_t *surface,
xstep = image->width;
ystep = image->height;
break;
/* All the rest should have been analyzed away, so these cases
* should be unreachable. */
case CAIRO_EXTEND_PAD:
/* All the rest (if any) should have been analyzed away, so these
* cases should be unreachable. */
default:
ASSERT_NOT_REACHED;
xstep = 0;