-#ifdef HAVE_CAIRO_FORMAT_STRIDE_FOR_WIDTH
- rowstride = cairo_format_stride_for_width (CAIRO_FORMAT_RGB24, page_width);
-#else
- rowstride = page_width * 4;
-#endif
- pixels = (gchar *) g_malloc (page_height * rowstride);
- surface = cairo_image_surface_create_for_data ((guchar *)pixels,
- CAIRO_FORMAT_RGB24,
- page_width,
- page_height,
- rowstride);
- cairo_surface_set_user_data (surface, &key,
- pixels, (cairo_destroy_func_t)g_free);
+
+ surface = cairo_image_surface_create (CAIRO_FORMAT_RGB24,
+ page_width, page_height);
+ rowstride = cairo_image_surface_get_stride (surface);
+ pixels = (gchar *)cairo_image_surface_get_data (surface);
+