gegl r3040 - trunk/gegl/operation



Author: martinn
Date: Sat Apr 11 14:50:24 2009
New Revision: 3040
URL: http://svn.gnome.org/viewvc/gegl?rev=3040&view=rev

Log:
When using a cache, make sure the operation context has a reference

We must not only say that an operation context is cached, we must also
actually make the operation context point to the cache.

Modified:
   trunk/gegl/operation/gegl-operations.c

Modified: trunk/gegl/operation/gegl-operations.c
==============================================================================
--- trunk/gegl/operation/gegl-operations.c	(original)
+++ trunk/gegl/operation/gegl-operations.c	Sat Apr 11 14:50:24 2009
@@ -137,19 +137,20 @@
 {
   GeglNode     *child;         /* the node which need rect we are affecting */
   GeglRectangle child_need;    /* the need rect of the child */
+  GeglPad      *output_pad;
 
   g_return_if_fail (GEGL_IS_OPERATION (operation));
   g_return_if_fail (GEGL_IS_NODE (operation->node));
   g_return_if_fail (input_pad_name != NULL);
 
   {
-    GeglPad *pad = gegl_node_get_pad (operation->node, input_pad_name);
-    if (!pad)
+    GeglPad *input_pad = gegl_node_get_pad (operation->node, input_pad_name);
+    if (!input_pad)
       return;
-    pad = gegl_pad_get_connected_to (pad);
-    if (!pad)
+    output_pad = gegl_pad_get_connected_to (input_pad);
+    if (!output_pad)
       return;
-    child = gegl_pad_get_node (pad);
+    child = gegl_pad_get_node (output_pad);
     if (!child)
       return;
   }
@@ -172,6 +173,10 @@
             {
               child_context->result_rect = child_need;
               child_context->cached = TRUE;
+              g_object_ref (cache);
+              gegl_operation_context_take_object (child_context,
+                                                  gegl_pad_get_name (output_pad),
+                                                  G_OBJECT (cache));
               child_need.width = 0;
               child_need.height = 0;
             }



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