cairo_matrix_copy (&p2u, &pattern->matrix);
cairo_matrix_copy (&p2u, &pattern->base.base.matrix);
emit_radial_pattern (cairo_pdf_surface_t *surface, cairo_pattern_t *pattern){    cairo_pdf_document_t *document = surface->document;    FILE *file = document->file;    unsigned int function_id, pattern_id, alpha;    double x0, y0, x1, y1, r0, r1;    cairo_matrix_t p2u;    _cairo_pdf_document_close_stream (document);    function_id = emit_pattern_stops (surface, pattern);    cairo_matrix_copy (&p2u, &pattern->matrix);    cairo_matrix_invert (&p2u);    x0 = pattern->u.radial.center0.x;    y0 = pattern->u.radial.center0.y;    r0 = pattern->u.radial.radius0;    cairo_matrix_transform_point (&p2u, &x0, &y0);    x1 = pattern->u.radial.center1.x;    y1 = pattern->u.radial.center1.y;    r1 = pattern->u.radial.radius1;    cairo_matrix_transform_point (&p2u, &x1, &y1);    /* FIXME: This is surely crack, but how should you scale a radius     * in a non-orthogonal coordinate system? */    cairo_matrix_transform_distance (&p2u, &r0, &r1);    pattern_id = _cairo_pdf_document_new_object (document);    fprintf (file,	     "%d 0 obj\r\n"	     "<< /Type /Pattern\r\n"	     "   /PatternType 2\r\n"	     "   /Matrix [ 1 0 0 -1 0 %f ]\r\n"	     "   /Shading\r\n"	     "      << /ShadingType 3\r\n"	     "         /ColorSpace /DeviceRGB\r\n"	     "         /Coords [ %f %f %f %f %f %f ]\r\n"	     "         /Function %d 0 R\r\n"	     "         /Extend [ %s %s ]\r\n"	     "      >>\r\n"	     ">>\r\n"	     "endobj\r\n",	     pattern_id,	     document->height_inches * document->y_ppi,	     x0, y0, r0, x1, y1, r1,	     function_id,	     (1 || pattern->extend) ? "true" : "false",	     (1 || pattern->extend) ? "true" : "false");        _cairo_pdf_surface_add_pattern (surface, pattern_id);    _cairo_pdf_surface_ensure_stream (surface);    alpha = _cairo_pdf_surface_add_alpha (surface, 1.0);    /* Use pattern */    fprintf (file,	     "/Pattern cs /res%d scn /a%d gs\r\n",	     pattern_id, alpha);}