mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 18:08:03 +02:00
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:
parent
f7b6fc4746
commit
9cf0955633
1 changed files with 5 additions and 3 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue