gegl r2464 - in trunk: . gegl/process



Author: martinn
Date: Sat Jun 14 20:53:57 2008
New Revision: 2464
URL: http://svn.gnome.org/viewvc/gegl?rev=2464&view=rev

Log:
2008-06-14  Martin Nordholts  <martinn svn gnome org>

	* gegl/process/gegl-processor.c
	(gegl_processor_set_rectangle)
	(gegl_processor_constructor): Refactor away return:s in the middle
	of these functions.


Modified:
   trunk/ChangeLog
   trunk/gegl/process/gegl-processor.c

Modified: trunk/gegl/process/gegl-processor.c
==============================================================================
--- trunk/gegl/process/gegl-processor.c	(original)
+++ trunk/gegl/process/gegl-processor.c	Sat Jun 14 20:53:57 2008
@@ -167,16 +167,12 @@
 
   processor->queued_region = gegl_region_new ();
 
-  if (processor->node->operation &&
-      GEGL_IS_OPERATION_SINK (processor->node->operation))
+  if (processor->node->operation                          &&
+      GEGL_IS_OPERATION_SINK (processor->node->operation) &&
+      gegl_operation_sink_needs_full (processor->node->operation))
     {
       GeglCache *cache;
 
-      if (!gegl_operation_sink_needs_full (processor->node->operation))
-        {
-          return object;
-        }
-
       cache = gegl_node_get_cache (processor->input);
 
       processor->context = gegl_node_add_context (processor->node, cache);
@@ -199,10 +195,6 @@
                                          processor->rectangle.width,
                                          processor->rectangle.height);
     }
-  else
-    {
-      processor->context = NULL;
-    }
 
   return object;
 }
@@ -312,23 +304,21 @@
       rectangle          = &input_bounding_box;
     }
 
-  if (gegl_rectangle_equal (&processor->rectangle, rectangle))
+  if (! gegl_rectangle_equal (&processor->rectangle, rectangle))
     {
-      return;
-    }
+      bounds               = gegl_node_get_bounding_box (processor->input);
+      processor->rectangle = *rectangle;
+      gegl_rectangle_intersect (&processor->rectangle, &processor->rectangle, &bounds);
 
-  bounds               = gegl_node_get_bounding_box (processor->input);
-  processor->rectangle = *rectangle;
-  gegl_rectangle_intersect (&processor->rectangle, &processor->rectangle, &bounds);
+      /* remove already queued dirty rectangles */
+      for (iter = processor->dirty_rectangles; iter; iter = g_slist_next (iter))
+        {
+          g_slice_free (GeglRectangle, iter->data);
+        }
+      g_slist_free (processor->dirty_rectangles);
 
-  /* remove already queued dirty rectangles */
-  for (iter = processor->dirty_rectangles; iter; iter = g_slist_next (iter))
-    {
-      g_slice_free (GeglRectangle, iter->data);
+      processor->dirty_rectangles = NULL;
     }
-  g_slist_free (processor->dirty_rectangles);
-
-  processor->dirty_rectangles = NULL;
 }
 
 GeglProcessor *



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