_cairo_pattern_init_solid (&pattern, 1.0, 1.0, 1.0); _cairo_pattern_set_alpha (&pattern, 1.0);
translate_traps (&traps, -gstate->clip.rect.x, -gstate->clip.rect.y); _cairo_pattern_init_solid (&pattern.solid, 1.0, 1.0, 1.0);
_cairo_gstate_clip (cairo_gstate_t *gstate){    cairo_status_t status;    cairo_pattern_t pattern;    cairo_traps_t traps;    cairo_color_t white_color;    pixman_box16_t box;    /* Fill the clip region as traps. */    _cairo_traps_init (&traps);    status = _cairo_path_fill_to_traps (&gstate->path, gstate, &traps);    if (status) {	_cairo_traps_fini (&traps);	return status;    }    /* Check to see if we can represent these traps as a PixRegion. */    if (extract_transformed_rectangle (&gstate->ctm, &traps, &box)) {	pixman_region16_t *rect = NULL;	pixman_region16_t *intersection = NULL;	status = CAIRO_STATUS_SUCCESS;	rect = pixman_region_create_simple (&box);		if (rect == NULL) {	    status = CAIRO_STATUS_NO_MEMORY;	} else {	    	    if (gstate->clip.region == NULL) {		gstate->clip.region = rect;			    } else {		intersection = pixman_region_create();		if (pixman_region_intersect (intersection, 					     gstate->clip.region, rect)		    == PIXMAN_REGION_STATUS_SUCCESS) {		    pixman_region_destroy (gstate->clip.region);		    gstate->clip.region = intersection;		} else {				    status = CAIRO_STATUS_NO_MEMORY;		}		pixman_region_destroy (rect);	    }	    	    if (!status)		status = _cairo_surface_set_clip_region (gstate->surface, 							 gstate->clip.region);	}		if (status != CAIRO_INT_STATUS_UNSUPPORTED) {	    _cairo_traps_fini (&traps);	    return status;	}	/* Fall through as status == CAIRO_INT_STATUS_UNSUPPORTED	   means that backend doesn't support clipping regions and	   mask surface clipping should be used instead. */    }    /* Otherwise represent the clip as a mask surface. */    _cairo_color_init (&white_color);    if (gstate->clip.surface == NULL) {	cairo_box_t extents;	_cairo_traps_extents (&traps, &extents);	gstate->clip.x = extents.p1.x >> 16;	gstate->clip.y = extents.p1.y >> 16;	gstate->clip.width = ((extents.p2.x + 65535) >> 16) - gstate->clip.x;	gstate->clip.height = ((extents.p2.y + 65535) >> 16) - gstate->clip.y;	gstate->clip.surface =	    _cairo_surface_create_similar_solid (gstate->surface,						 CAIRO_FORMAT_A8,						 gstate->clip.width,						 gstate->clip.height,						 &white_color);	if (gstate->clip.surface == NULL)	    return CAIRO_STATUS_NO_MEMORY;    }    _cairo_pattern_init_solid (&pattern, 1.0, 1.0, 1.0);    _cairo_pattern_set_alpha (&pattern, 1.0);        _cairo_gstate_clip_and_composite_trapezoids (gstate,						 &pattern,						 CAIRO_OPERATOR_IN,						 gstate->clip.surface,						 &traps);        _cairo_pattern_fini (&pattern);        _cairo_traps_fini (&traps);    return CAIRO_STATUS_SUCCESS;}