mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-01-22 18:10:29 +01:00
[cairo-pattern] In init_solid() convert COLOR_ALPHA to COLOR if color is opaque
Moving this further than, so it benefits all callers.
This commit is contained in:
parent
333a49d01d
commit
e93e990324
1 changed files with 3 additions and 3 deletions
|
|
@ -252,6 +252,9 @@ _cairo_pattern_init_solid (cairo_solid_pattern_t *pattern,
|
|||
const cairo_color_t *color,
|
||||
cairo_content_t content)
|
||||
{
|
||||
if (content == CAIRO_CONTENT_COLOR_ALPHA && CAIRO_COLOR_IS_OPAQUE (color))
|
||||
content = CAIRO_CONTENT_COLOR;
|
||||
|
||||
_cairo_pattern_init (&pattern->base, CAIRO_PATTERN_TYPE_SOLID);
|
||||
pattern->color = *color;
|
||||
pattern->content = content;
|
||||
|
|
@ -448,9 +451,6 @@ cairo_pattern_create_rgba (double red, double green, double blue,
|
|||
{
|
||||
cairo_color_t color;
|
||||
|
||||
if (alpha >= 1.0)
|
||||
return cairo_pattern_create_rgb (red, green, blue);
|
||||
|
||||
_cairo_restrict_value (&red, 0.0, 1.0);
|
||||
_cairo_restrict_value (&green, 0.0, 1.0);
|
||||
_cairo_restrict_value (&blue, 0.0, 1.0);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue