gegl r1873 - in trunk: . gegl/process



Author: ok
Date: Sun Jan 20 23:21:14 2008
New Revision: 1873
URL: http://svn.gnome.org/viewvc/gegl?rev=1873&view=rev

Log:
* gegl/process/gegl-processor.c: reverted commit to use GSLice for
GeglRectangle, the user gegl binary started crashing. (commandline
processing that doesn't reset the rectangle on the processor still
works fine though.)


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	Sun Jan 20 23:21:14 2008
@@ -221,7 +221,9 @@
   GeglRectangle bounds;
 
   if (gegl_rectangle_equal (&processor->rectangle, rectangle))
-    return;
+    {
+      return;
+    }
 
   bounds               = gegl_node_get_bounding_box (processor->input);
   processor->rectangle = *rectangle;
@@ -229,9 +231,11 @@
 
   /* remove already queued dirty rectangles */
   while (processor->dirty_rectangles)
-    g_slice_free (GeglRectangle, processor->dirty_rectangles->data);
-  g_slist_free (processor->dirty_rectangles);
-  processor->dirty_rectangles = NULL;
+    {
+      GeglRectangle *rect = processor->dirty_rectangles->data;
+      processor->dirty_rectangles = g_slist_remove (processor->dirty_rectangles, rect);
+      g_free (rect);
+    }
 }
 
 GeglProcessor *
@@ -321,7 +325,8 @@
               if (band_size < 1)
                 band_size = 1;
 
-              fragment = g_slice_dup (GeglRectangle, dr);
+              fragment = g_malloc (sizeof (GeglRectangle));
+              *fragment = *dr;
 
               fragment->height = band_size;
               dr->height      -= band_size;
@@ -339,7 +344,8 @@
               if (band_size < 1)
                 band_size = 1;
 
-              fragment = g_slice_dup (GeglRectangle, dr);
+              fragment = g_malloc (sizeof (GeglRectangle));
+              *fragment = *dr;
 
               fragment->width = band_size;
               dr->width      -= band_size;
@@ -354,7 +360,7 @@
 
       if (!dr->width || !dr->height)
         {
-          g_slice_free (GeglRectangle, dr);
+          g_free (dr);
           return TRUE;
         }
 
@@ -374,8 +380,7 @@
 
           g_free (buf);
         }
-
-      g_slice_free (GeglRectangle, dr);
+      g_free (dr);
     }
 
   return processor->dirty_rectangles != NULL;
@@ -403,7 +408,8 @@
               if (band_size < 1)
                 band_size = 1;
 
-              fragment = g_slice_dup (GeglRectangle, dr);
+              fragment = g_malloc (sizeof (GeglRectangle));
+              *fragment = *dr;
 
               fragment->height = band_size;
               dr->height      -= band_size;
@@ -421,7 +427,8 @@
               if (band_size < 1)
                 band_size = 1;
 
-              fragment = g_slice_dup (GeglRectangle, dr);
+              fragment = g_malloc (sizeof (GeglRectangle));
+              *fragment = *dr;
 
               fragment->width = band_size;
               dr->width      -= band_size;
@@ -435,13 +442,13 @@
 
       if (!dr->width || !dr->height)
         {
-          g_slice_free (GeglRectangle, dr);
+          g_free (dr);
           return TRUE;
         }
 
       gegl_node_blit (processor->node, 1.0, dr, NULL, NULL, GEGL_AUTO_ROWSTRIDE, GEGL_BLIT_DEFAULT);
       gegl_region_union_with_rect (processor->valid_region, dr);
-      g_slice_free (GeglRectangle, dr);
+      g_free (dr);
     }
 
   return processor->dirty_rectangles != NULL;
@@ -479,7 +486,6 @@
       sum += rect_area (&rectangles[i]);
     }
   g_free (rectangles);
-
   return sum;
 }
 
@@ -594,12 +600,14 @@
       for (i = 0; i < n_rectangles && i < 1; i++)
         {
           GeglRectangle  roi = rectangles[i];
+          GeglRectangle *dr;
           GeglRegion    *tr = gegl_region_rectangle(&roi);
           gegl_region_subtract (processor->queued_region, tr);
           gegl_region_destroy (tr);
 
-          processor->dirty_rectangles = g_slist_prepend (processor->dirty_rectangles,
-                                                         g_slice_dup (GeglRectangle, &roi));
+          dr                          = g_malloc (sizeof (GeglRectangle));
+          *dr                         = roi;
+          processor->dirty_rectangles = g_slist_prepend (processor->dirty_rectangles, dr);
         }
       g_free (rectangles);
 
@@ -626,12 +634,14 @@
       for (i = 0; i < n_rectangles && i < 1; i++)
         {
           GeglRectangle  roi = rectangles[i];
+          GeglRectangle *dr;
           GeglRegion    *tr = gegl_region_rectangle (&roi);
           gegl_region_subtract (processor->queued_region, tr);
           gegl_region_destroy (tr);
 
-          processor->dirty_rectangles = g_slist_prepend (processor->dirty_rectangles,
-                                                         g_slice_dup (GeglRectangle, &roi));
+          dr                          = g_malloc (sizeof (GeglRectangle));
+          *dr                         = roi;
+          processor->dirty_rectangles = g_slist_prepend (processor->dirty_rectangles, dr);
         }
       g_free (rectangles);
     }



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