gegl r2754 - in trunk: . gegl/buffer



Author: ok
Date: Sat Nov 15 14:06:35 2008
New Revision: 2754
URL: http://svn.gnome.org/viewvc/gegl?rev=2754&view=rev

Log:
* gegl/buffer/gegl-buffer.c: (gegl_buffer_create_sub_buffer):
if the requested sub-buffer is equal to the buffers extent or
is NULL, return the provided parent and add a reference to it.


Modified:
   trunk/ChangeLog
   trunk/gegl/buffer/gegl-buffer.c

Modified: trunk/gegl/buffer/gegl-buffer.c
==============================================================================
--- trunk/gegl/buffer/gegl-buffer.c	(original)
+++ trunk/gegl/buffer/gegl-buffer.c	Sat Nov 15 14:06:35 2008
@@ -871,8 +871,11 @@
 {
   g_return_val_if_fail (GEGL_IS_BUFFER (buffer), NULL);
 
-  if (extent == NULL)
-    extent = gegl_buffer_get_extent (buffer);
+  if (extent == NULL || gegl_rectangle_equal (extent, &buffer->extent))
+    {
+      g_object_ref (buffer);
+      return buffer;
+    }
 
   if (extent->width < 0 || extent->height < 0)
     {
@@ -1066,6 +1069,7 @@
   return TRUE;
 }
 
+#if 0
 gboolean gegl_buffer_lock (GeglBuffer *buffer)
 {
   while (gegl_buffer_try_lock (buffer)==FALSE)
@@ -1086,3 +1090,4 @@
     return gegl_tile_backend_file_unlock (GEGL_TILE_BACKEND_FILE (backend));
   return TRUE;
 }
+#endif



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