cogl-pango: Factor in default color alpha again

In commit d846fabda we moved to using the override color alpha, however
it was missed that the actor opacity is transferred to the PangoRenderer
through the default color alpha, and the reason it was used there.

We actually want to factor in both alpha values, in order to respect
both foreground color alpha and actor opacity. This is done on the
unpremultiplied color, so we just need to change the alpha value.

Fixes effects on text actors that involve actor opacity.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1158
This commit is contained in:
Carlos Garnacho 2020-03-28 12:27:38 +01:00
parent ed10aea44d
commit e8ea5ecd8a

View File

@ -421,7 +421,9 @@ _cogl_pango_display_list_render (CoglFramebuffer *fb,
cogl_color_get_red_byte (&node->color), cogl_color_get_red_byte (&node->color),
cogl_color_get_green_byte (&node->color), cogl_color_get_green_byte (&node->color),
cogl_color_get_blue_byte (&node->color), cogl_color_get_blue_byte (&node->color),
cogl_color_get_alpha_byte (&node->color)); (cogl_color_get_alpha_byte (&node->color) *
cogl_color_get_alpha_byte (color) /
255));
else else
draw_color = *color; draw_color = *color;
cogl_color_premultiply (&draw_color); cogl_color_premultiply (&draw_color);