From 00091d50a6187acd0fd35aef16a4fa5fab3c8aa9 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Sun, 9 Mar 2008 16:44:18 +1030 Subject: [PATCH] Add fallback image comment to PS output To help better understand when fallback images are used, a comment similiar to the following is included with each fallback image in the PS output. % Fallback Image: x=101, y=478, w=50, h=10 res=300dpi size=31500 --- src/cairo-ps-surface.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c index dde2aeb9d..6ab1c0a79 100644 --- a/src/cairo-ps-surface.c +++ b/src/cairo-ps-surface.c @@ -2230,6 +2230,20 @@ _cairo_ps_surface_paint_surface (cairo_ps_surface_t *surface, return status; cairo_p2d = pattern->base.matrix; + + if (surface->paginated_mode == CAIRO_PAGINATED_MODE_FALLBACK) { + double scale = cairo_p2d.xx; + + _cairo_output_stream_printf (surface->stream, + "%% Fallback Image: x=%f, y=%f, w=%d, h=%d res=%fdpi size=%ld\n", + -cairo_p2d.x0/scale, + -cairo_p2d.y0/scale, + (int)(width/scale), + (int)(height/scale), + scale*72, + (long)width*height*3); + } + status = cairo_matrix_invert (&cairo_p2d); /* cairo_pattern_set_matrix ensures the matrix is invertible */ assert (status == CAIRO_STATUS_SUCCESS);