From 60e36aee5415575e23b579f0bc179e542d8c3a20 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Mon, 24 Mar 2008 10:47:57 +0100 Subject: [PATCH] Add a workaround for cairo < 1.5 Signed-off-by: Julien Danjou --- common/draw.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/draw.c b/common/draw.c index 8f8af1b31..76e72ccce 100644 --- a/common/draw.c +++ b/common/draw.c @@ -579,7 +579,11 @@ void draw_image_from_argb_data(DrawCtx *ctx, int x, int y, int w, int h, cairo_surface_t *source; source = cairo_image_surface_create_for_data(data, CAIRO_FORMAT_ARGB32, w, h, +#if CAIRO_VERSION_MAJOR < 1 || (CAIRO_VERSION_MAJOR == 1 && CAIRO_VERSION_MINOR < 5) + sizeof(unsigned char) * 4 * w); +#else cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, w)); +#endif cr = cairo_create(ctx->surface); if(wanted_h > 0 && h > 0) {