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.
This commit is contained in:
Ell 2017-10-21 11:32:07 -04:00
parent 0c305bdb0f
commit 66bb469a78
1 changed files with 11 additions and 8 deletions

View File

@ -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;