[gimp] app: connect layer backdrop to source node's input
- From: N/A <ell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: connect layer backdrop to source node's input
- Date: Tue, 8 Aug 2017 19:41:54 +0000 (UTC)
commit ac3190215b61e0b1b55778788db9442bce1c65c7
Author: Ell <ell_se yahoo com>
Date: Fri Apr 21 15:38:57 2017 -0400
app: connect layer backdrop to source node's input
Make sure the input of the layer's filter node is connected to its
source node (when it has an input pad), so that, once we implement
pass-though mode, the group's source node can see the backdrop.
app/core/gimpdrawable.c | 9 +++++++++
app/core/gimplayer.c | 6 ++++++
2 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/app/core/gimpdrawable.c b/app/core/gimpdrawable.c
index 13781bb..bee7a2e 100644
--- a/app/core/gimpdrawable.c
+++ b/app/core/gimpdrawable.c
@@ -1226,6 +1226,7 @@ gimp_drawable_set_buffer_full (GimpDrawable *drawable,
GeglNode *
gimp_drawable_get_source_node (GimpDrawable *drawable)
{
+ GeglNode *input;
GeglNode *source;
GeglNode *filter;
GeglNode *output;
@@ -1237,12 +1238,20 @@ gimp_drawable_get_source_node (GimpDrawable *drawable)
drawable->private->source_node = gegl_node_new ();
+ input = gegl_node_get_input_proxy (drawable->private->source_node, "input");
+
source = GIMP_DRAWABLE_GET_CLASS (drawable)->get_source_node (drawable);
gegl_node_add_child (drawable->private->source_node, source);
g_object_unref (source);
+ if (gegl_node_has_pad (source, "input"))
+ {
+ gegl_node_connect_to (input, "output",
+ source, "input");
+ }
+
filter = gimp_filter_stack_get_graph (GIMP_FILTER_STACK (drawable->private->filter_stack));
gegl_node_add_child (drawable->private->source_node, filter);
diff --git a/app/core/gimplayer.c b/app/core/gimplayer.c
index c4c9d74..d608611 100644
--- a/app/core/gimplayer.c
+++ b/app/core/gimplayer.c
@@ -772,12 +772,15 @@ gimp_layer_get_node (GimpFilter *filter)
GimpDrawable *drawable = GIMP_DRAWABLE (filter);
GimpLayer *layer = GIMP_LAYER (filter);
GeglNode *node;
+ GeglNode *input;
GeglNode *source;
GeglNode *mode_node;
gboolean source_node_hijacked = FALSE;
node = GIMP_FILTER_CLASS (parent_class)->get_node (filter);
+ input = gegl_node_get_input_proxy (node, "input");
+
source = gimp_drawable_get_source_node (drawable);
/* if the source node already has a parent, we are a floating
@@ -790,6 +793,9 @@ gimp_layer_get_node (GimpFilter *filter)
if (! source_node_hijacked)
gegl_node_add_child (node, source);
+ gegl_node_connect_to (input, "output",
+ source, "input");
+
g_warn_if_fail (layer->layer_offset_node == NULL);
g_warn_if_fail (layer->mask_offset_node == NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]