[gimp] app: fix gimp_display_shell_render() to draw alpha correctly



commit 2061cc0077a12738adcbc53c5b7b0d907211ffaa
Author: Michael Natterer <mitch gimp org>
Date:   Tue Jul 16 23:16:27 2019 +0200

    app: fix gimp_display_shell_render() to draw alpha correctly
    
    Drawing the image needs to replace the render cache's alpha, so draw
    with CAIRO_OPERATOR_SOURCE.

 app/display/gimpdisplayshell-render.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/app/display/gimpdisplayshell-render.c b/app/display/gimpdisplayshell-render.c
index 184d09a801..61631cef80 100644
--- a/app/display/gimpdisplayshell-render.c
+++ b/app/display/gimpdisplayshell-render.c
@@ -425,9 +425,14 @@ gimp_display_shell_render (GimpDisplayShell *shell,
 
   cairo_surface_mark_dirty (shell->render_surface);
 
+  /*  SOURCE so the destination's alpha is replaced  */
+  cairo_set_operator (my_cr, CAIRO_OPERATOR_SOURCE);
+
   cairo_set_source_surface (my_cr, shell->render_surface, x, y);
   cairo_paint (my_cr);
 
+  cairo_set_operator (my_cr, CAIRO_OPERATOR_OVER);
+
   if (shell->mask)
     {
       if (! shell->mask_surface)


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