pdf,ps: The device offset only needs to taken into account for raster patterns

Ordinary patterns have their device offsets pre-baked into the pattern
matrix. The difference with raster patterns is that the surface is
generated upon use by the pdf,ps and so its device offset is not known
until then.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2012-02-24 16:15:31 +00:00
parent 99ec915b97
commit 7154f646d3
2 changed files with 1 additions and 4 deletions

View file

@ -1355,8 +1355,6 @@ _cairo_pdf_surface_add_source_surface (cairo_pdf_surface_t *surface,
cairo_surface_pattern_t *surface_pattern = (cairo_surface_pattern_t *) source_pattern;
source_surface = surface_pattern->surface;
}
} else {
cairo_surface_get_device_offset (source_surface, x_offset, y_offset);
}
surface_key.id = source_surface->unique_id;

View file

@ -1681,6 +1681,7 @@ _cairo_ps_surface_acquire_source_surface_from_pattern (cairo_ps_surface_t
cairo_status_t status;
cairo_image_surface_t *image;
*x_offset = *y_offset = 0;
switch (pattern->type) {
case CAIRO_PATTERN_TYPE_SURFACE: {
cairo_surface_t *surf = ((cairo_surface_pattern_t *) pattern)->surface;
@ -1709,7 +1710,6 @@ _cairo_ps_surface_acquire_source_surface_from_pattern (cairo_ps_surface_t
*width = extents.width;
*height = extents.height;
}
cairo_surface_get_device_offset (surf, x_offset, y_offset);
*source_surface = surf;
return CAIRO_STATUS_SUCCESS;
@ -1747,7 +1747,6 @@ _cairo_ps_surface_acquire_source_surface_from_pattern (cairo_ps_surface_t
*width = image->width;
*height = image->height;
cairo_surface_get_device_offset (&image->base, x_offset, y_offset);
*source_surface = &image->base;
return CAIRO_STATUS_SUCCESS;
}