pixman_region_destroy (draw_region); BAIL0:
_cairo_gstate_show_glyphs (cairo_gstate_t *gstate, 			   cairo_glyph_t *glyphs, 			   int num_glyphs){    cairo_status_t status;    int i;    cairo_glyph_t *transformed_glyphs = NULL;    cairo_font_scale_t sc;    cairo_pattern_t pattern;    cairo_box_t bbox;    _build_font_scale (gstate, &sc);    transformed_glyphs = malloc (num_glyphs * sizeof(cairo_glyph_t));    if (transformed_glyphs == NULL)	return CAIRO_STATUS_NO_MEMORY;        for (i = 0; i < num_glyphs; ++i)    {	transformed_glyphs[i] = glyphs[i];	cairo_matrix_transform_point (&gstate->ctm, 				      &transformed_glyphs[i].x, 				      &transformed_glyphs[i].y);    }        _cairo_pattern_init_copy (&pattern, gstate->pattern);    status = _cairo_unscaled_font_glyph_bbox (gstate->font, &sc, 					      transformed_glyphs, num_glyphs, 					      &bbox);    if (status)	goto CLEANUP_GLYPHS;    status = _cairo_gstate_create_pattern (gstate, &pattern, &bbox);    if (status)	goto CLEANUP_GLYPHS;        if (gstate->clip.surface)    {	cairo_surface_t *intermediate;	cairo_color_t empty_color;	pixman_box16_t *draw_extents;	pixman_region16_t *draw_region;		draw_region = pixman_region_create ();	if (draw_region == NULL)	{	    status = CAIRO_STATUS_NO_MEMORY;	    goto BAIL0;	}		status = _calculate_region_for_intermediate_clip_surface (draw_region,								  &bbox,								  &gstate->clip);	if (status) {	    goto BAIL1;	}	/* Shortcut if empty */	if (!pixman_region_not_empty (draw_region)) {	    status = CAIRO_STATUS_SUCCESS;	    goto BAIL1;	}		draw_extents = pixman_region_extents (draw_region);		_cairo_color_init (&empty_color);	_cairo_color_set_alpha (&empty_color, .0);	intermediate = _cairo_surface_create_similar_solid (gstate->clip.surface,							    CAIRO_FORMAT_A8,							    draw_extents->x2 - draw_extents->x1,							    draw_extents->y2 - draw_extents->y1,							    &empty_color);	if (intermediate == NULL) {	    status = CAIRO_STATUS_NO_MEMORY;	    goto BAIL1;	}	/* move the glyphs again, from dev space to intermediate space */	for (i = 0; i < num_glyphs; ++i)	{	    transformed_glyphs[i].x -= draw_extents->x1;	    transformed_glyphs[i].y -= draw_extents->y1;	}	status = _cairo_unscaled_font_show_glyphs (gstate->font, 						   &sc,						   CAIRO_OPERATOR_ADD, 						   pattern.source, intermediate,						   draw_extents->x1 - pattern.source_offset.x,						   draw_extents->y1 - pattern.source_offset.y,						   transformed_glyphs, num_glyphs);	if (status)	    goto BAIL2;	status = _cairo_surface_composite (CAIRO_OPERATOR_IN,					   gstate->clip.surface,					   NULL,					   intermediate,					   draw_extents->x1 - gstate->clip.x,					   draw_extents->y1 - gstate->clip.y, 					   0, 0,					   0, 0,					   draw_extents->x2 - draw_extents->x1,					   draw_extents->y2 - draw_extents->y1);	if (status)	    goto BAIL2;	status = _cairo_surface_composite (gstate->operator,					   pattern.source,					   intermediate,					   gstate->surface,					   0, 0, 					   0, 0,					   draw_extents->x1,					   draw_extents->y1, 					   draw_extents->x2 - draw_extents->x1,					   draw_extents->y2 - draw_extents->y1);    BAIL2:	cairo_surface_destroy (intermediate);    BAIL1:	pixman_region_destroy (draw_region);    BAIL0:	;    }    else    {	status = _cairo_unscaled_font_show_glyphs (gstate->font, 						   &sc,						   gstate->operator, pattern.source,						   gstate->surface,						   -pattern.source_offset.x,						   -pattern.source_offset.y,						   transformed_glyphs, num_glyphs);    }        _cairo_pattern_fini (&pattern); CLEANUP_GLYPHS:    free (transformed_glyphs);        return status;}