Create opaque similar solid surfaces when possible.

For opaque surfaces the backends may use simpler code paths - for
example, the xlib backend may be able to use the Core protocol rather
than Render. So we only generate a surface with an alpha component if
the color is not opaque.
This commit is contained in:
Chris Wilson 2007-04-19 09:27:51 +01:00
parent f7b6fc4746
commit 9cf0955633

View file

@ -1246,9 +1246,11 @@ _cairo_pattern_acquire_surface_for_solid (cairo_solid_pattern_t *pattern,
cairo_surface_attributes_t *attribs)
{
*out = _cairo_surface_create_similar_solid (dst,
CAIRO_CONTENT_COLOR_ALPHA,
1, 1,
&pattern->color);
CAIRO_COLOR_IS_OPAQUE (&pattern->color) ?
CAIRO_CONTENT_COLOR :
CAIRO_CONTENT_COLOR_ALPHA,
1, 1,
&pattern->color);
if ((*out)->status)
return CAIRO_STATUS_NO_MEMORY;