glitz_pbuffer_attributes_t attributes;
_glitz_ensure_target (glitz_surface_t *surface){    glitz_drawable_t *drawable;    drawable = glitz_surface_get_attached_drawable (surface);    if (!drawable) {	glitz_drawable_format_t *dformat;	glitz_drawable_format_t templ;	glitz_format_t *format;	glitz_drawable_t *pbuffer;	glitz_pbuffer_attributes_t attributes;	unsigned long mask;	int i;		format = glitz_surface_get_format (surface);	if (format->type != GLITZ_FORMAT_TYPE_COLOR)	    return CAIRO_INT_STATUS_UNSUPPORTED;	drawable = glitz_surface_get_drawable (surface);	dformat = glitz_drawable_get_format (drawable);	templ.types.pbuffer = 1;	mask = GLITZ_FORMAT_PBUFFER_MASK;	templ.samples = dformat->samples;	mask |= GLITZ_FORMAT_SAMPLES_MASK;	i = 0;	do {	    dformat = glitz_find_similar_drawable_format (drawable,							  mask, &templ, i++);	    if (dformat) {		int sufficient = 1;				if (format->color.red_size) {		    if (dformat->color.red_size < format->color.red_size)			sufficient = 0;		}		if (format->color.alpha_size) {		    if (dformat->color.alpha_size < format->color.alpha_size)			sufficient = 0;		}		if (sufficient)		    break;	    }	} while (dformat);		if (!dformat)	    return CAIRO_INT_STATUS_UNSUPPORTED;	attributes.width = glitz_surface_get_width (surface);	attributes.height = glitz_surface_get_height (surface);	mask = GLITZ_PBUFFER_WIDTH_MASK | GLITZ_PBUFFER_HEIGHT_MASK;	pbuffer = glitz_create_pbuffer_drawable (drawable, dformat,						 &attributes, mask);	if (!pbuffer)	    return CAIRO_INT_STATUS_UNSUPPORTED;	if (glitz_drawable_get_width (pbuffer) < attributes.width ||	    glitz_drawable_get_height (pbuffer) < attributes.height) {	    glitz_drawable_destroy (pbuffer);	    return CAIRO_INT_STATUS_UNSUPPORTED;	}	glitz_surface_attach (surface, pbuffer,			      GLITZ_DRAWABLE_BUFFER_FRONT_COLOR,			      0, 0);	glitz_drawable_destroy (pbuffer);    }    return CAIRO_STATUS_SUCCESS;}