[gegl] Provide a non-null input pad for unconnected nodes
- From: Daniel Sabo <daniels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] Provide a non-null input pad for unconnected nodes
- Date: Wed, 22 May 2013 06:40:56 +0000 (UTC)
commit 9133f8ced09260c83b0332b49f5dca3bfef08ecf
Author: Daniel Sabo <DanielSabo gmail com>
Date: Tue May 21 23:08:30 2013 -0700
Provide a non-null input pad for unconnected nodes
gegl/process/gegl-eval-visitor.c | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/gegl/process/gegl-eval-visitor.c b/gegl/process/gegl-eval-visitor.c
index 6eac5f7..aa62838 100644
--- a/gegl/process/gegl-eval-visitor.c
+++ b/gegl/process/gegl-eval-visitor.c
@@ -154,7 +154,8 @@ gegl_eval_visitor_visit_pad (GeglVisitor *self,
}
else if (gegl_pad_is_input (pad))
{
- GeglPad *source_pad = gegl_pad_get_connected_to (pad);
+ GeglPad *source_pad = gegl_pad_get_connected_to (pad);
+ const gchar *pad_name = gegl_pad_get_name (pad);
/* the work needed to be done on input pads is to set the
* data from the corresponding output pad it is connected to
@@ -180,8 +181,8 @@ gegl_eval_visitor_visit_pad (GeglVisitor *self,
g_value_get_object (&value));
gegl_operation_context_set_property (context,
- gegl_pad_get_name (pad),
- &value);
+ pad_name,
+ &value);
/* reference counting for this source dropped to zero, freeing up */
if (-- gegl_node_get_context (
gegl_pad_get_node (source_pad), context_id)->refs == 0 &&
@@ -208,5 +209,12 @@ gegl_eval_visitor_visit_pad (GeglVisitor *self,
&context->result_rect, context->level);
}
}
+ else if (!strcmp (pad_name, "input"))
+ {
+ /* Guarantee a non-null input pad for unconnected nodes */
+ gegl_operation_context_take_object (context,
+ pad_name,
+ gegl_eval_visitor_get_shared_empty (self));
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]