[mutter/wip/carlosg/emoji-rapture] cogl-pango: Special case alpha of 0 for color glyphs



commit 76f98bc43bd4c302f35cc782bd72c2b97143192f
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Mar 29 13:24:40 2020 +0200

    cogl-pango: Special case alpha of 0 for color glyphs
    
    Like ed10aea44d85, but for color glyphs. Since they do use the alpha
    component from the given color.
    
    https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1161

 cogl/cogl-pango/cogl-pango-render.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/cogl/cogl-pango/cogl-pango-render.c b/cogl/cogl-pango/cogl-pango-render.c
index 938da98e9..07ba0ca4b 100644
--- a/cogl/cogl-pango/cogl-pango-render.c
+++ b/cogl/cogl-pango/cogl-pango-render.c
@@ -913,7 +913,8 @@ cogl_pango_renderer_draw_glyphs (PangoRenderer    *renderer,
 
                   alpha = pango_renderer_get_alpha (renderer,
                                                     PANGO_RENDER_PART_FOREGROUND);
-                  cogl_color_init_from_4ub (&color, 0xff, 0xff, 0xff, alpha >> 8);
+                  cogl_color_init_from_4ub (&color, 0xff, 0xff, 0xff,
+                                           alpha ? alpha >> 8 : 0xff);
                   _cogl_pango_display_list_set_color_override (priv->display_list, &color);
                 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]