#include #include #include #include int main (void) { cairo_pattern_t *pat; cairo_surface_t *pdf; cairo_surface_t *image = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 160, 160); cairo_t *cr = cairo_create (image); cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); cairo_arc (cr, 80.0, 80.0, 64.0, 0.0, 2 * M_PI); cairo_fill (cr); cairo_destroy (cr); pdf = cairo_pdf_surface_create ("bug-63302.pdf", 160, 160); cairo_surface_set_fallback_resolution (pdf, 72.0, 72.0); cr = cairo_create (pdf); cairo_surface_destroy (pdf); pat = cairo_pattern_create_for_surface (image); cairo_pattern_set_filter (pat, CAIRO_FILTER_NEAREST); cairo_set_source (cr, pat); cairo_pattern_destroy (pat); cairo_surface_destroy (image); cairo_paint (cr); cairo_destroy (cr); fprintf (stderr, "Saved bug-63302.pdf\n"); return 0; }