Commit 73d7a81a authored by Ell's avatar Ell
Browse files

app: restore operation src node in gimp_gegl_apply_[cached_]operation()

When merging a drawable filter, we call
gimp_gegl_apply_cached_operation() on a node that's part of the
drawable's filter stack graph.  The function rewires the node's
input, and doesn't restore its original input connection before
returning, leaving the graph in an inconsistent state.  Currently,
this doesn't matter, since we remove the filter right after that,
but the next commit expects the filter stack graph to remain
consistent.

Remember the original source node of "operation" in
gimp_gegl_apply_cached_operation(), and restore it upon exit, to
fix that.
parent 9e77a0f8
......@@ -74,11 +74,12 @@ gimp_gegl_apply_cached_operation (GeglBuffer *src_buffer,
{
GeglNode *gegl;
GeglNode *dest_node;
GeglNode *operation_src_node = NULL;
GeglRectangle rect = { 0, };
GeglProcessor *processor = NULL;
gboolean progress_started = FALSE;
GeglProcessor *processor = NULL;
gboolean progress_started = FALSE;
gdouble value;
gboolean cancel = FALSE;
gboolean cancel = FALSE;
g_return_val_if_fail (src_buffer == NULL || GEGL_IS_BUFFER (src_buffer), FALSE);
g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), FALSE);
......@@ -122,6 +123,8 @@ gimp_gegl_apply_cached_operation (GeglBuffer *src_buffer,
g_object_unref (src_buffer);
operation_src_node = gegl_node_get_producer (operation, "input", NULL);
gegl_node_connect_to (src_node, "output",
operation, "input");
}
......@@ -257,6 +260,12 @@ gimp_gegl_apply_cached_operation (GeglBuffer *src_buffer,
g_object_unref (gegl);
if (operation_src_node)
{
gegl_node_connect_to (operation_src_node, "output",
operation, "input");
}
if (progress_started)
{
gimp_progress_end (progress);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment