[gimp] Bug 786992 - removing alpha produces a black image (sometimes), with OpenCL



commit 66bb469a783451aa894383f714e7e48e39b600f9
Author: Ell <ell_se yahoo com>
Date:   Sat Oct 21 11:32:07 2017 -0400

    Bug 786992 - removing alpha produces a black image (sometimes), with OpenCL
    
    When creating a flatten node, which is used when removing alpha
    channels and when flattening an image, use a gimp:normal node to
    combine the layer with the background color, instead of a gegl:over
    node.  gegl:over can apparently result in completely black output
    with OpenCL enabled, under certain (not fully pinned-down)
    conditions.
    
    As long as the OpenCL version of gegl:over is borked, there is not
    much reason to use it over gimp:normal, which is more consistent
    (in intension, if not in extension) with the rest of the
    compositing pipeline.

 app/gegl/gimp-gegl-nodes.c |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)
---
diff --git a/app/gegl/gimp-gegl-nodes.c b/app/gegl/gimp-gegl-nodes.c
index 3b7ef69..04c6c2f 100644
--- a/app/gegl/gimp-gegl-nodes.c
+++ b/app/gegl/gimp-gegl-nodes.c
@@ -38,7 +38,7 @@ gimp_gegl_create_flatten_node (const GimpRGB       *background,
   GeglNode  *input;
   GeglNode  *output;
   GeglNode  *color;
-  GeglNode  *over;
+  GeglNode  *mode;
   GeglColor *c;
 
   g_return_val_if_fail (background != NULL, NULL);
@@ -58,17 +58,20 @@ gimp_gegl_create_flatten_node (const GimpRGB       *background,
                                NULL);
   g_object_unref (c);
 
-  over = gegl_node_new_child (node,
-                              "operation", "gegl:over",
-                              "srgb",      composite_space ==
-                                           GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
+  mode = gegl_node_new_child (node,
+                              "operation", "gimp:normal",
                               NULL);
+  gimp_gegl_mode_node_set_mode (mode,
+                                GIMP_LAYER_MODE_NORMAL,
+                                GIMP_LAYER_COLOR_SPACE_AUTO,
+                                composite_space,
+                                GIMP_LAYER_COMPOSITE_AUTO);
 
   gegl_node_connect_to (input,  "output",
-                        over,   "aux");
+                        mode,   "aux");
   gegl_node_connect_to (color,  "output",
-                        over,   "input");
-  gegl_node_connect_to (over,   "output",
+                        mode,   "input");
+  gegl_node_connect_to (mode,   "output",
                         output, "input");
 
   return node;


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