gegl r2673 - in trunk: . gegl/graph gegl/operation operations/common operations/external



Author: ok
Date: Thu Oct 30 23:56:36 2008
New Revision: 2673
URL: http://svn.gnome.org/viewvc/gegl?rev=2673&view=rev

Log:
* gegl/operation/gegl-operation.[ch]: (gegl_operation_invalidate):
added a boolean argument as a final argument, if TRUE the op
requests that it's output cache should be cleared for the region
that is invalidated.
* gegl/graph/gegl-node.[ch]: (gegl_node_invalidated),
(source_invalidated), (property_changed),
(gegl_node_insert_before):
* operations/external/fill.c: pass TRUE.
* operations/external/stroke.c: pass FALSE.
* operations/common/open-buffer.c: pass FALSE.


Modified:
   trunk/ChangeLog
   trunk/gegl/graph/gegl-node.c
   trunk/gegl/graph/gegl-node.h
   trunk/gegl/operation/gegl-operation.c
   trunk/gegl/operation/gegl-operation.h
   trunk/operations/common/open-buffer.c
   trunk/operations/external/fill.c
   trunk/operations/external/stroke.c

Modified: trunk/gegl/graph/gegl-node.c
==============================================================================
--- trunk/gegl/graph/gegl-node.c	(original)
+++ trunk/gegl/graph/gegl-node.c	Thu Oct 30 23:56:36 2008
@@ -529,13 +529,16 @@
 
 void
 gegl_node_invalidated (GeglNode            *node,
-                       const GeglRectangle *rect)
+                       const GeglRectangle *rect,
+                       gboolean             clear_cache)
 {
   g_return_if_fail (GEGL_IS_NODE (node));
   g_return_if_fail (rect != NULL);
 
   if (node->cache)
     {
+      if (rect && clear_cache)
+        gegl_buffer_clear (GEGL_BUFFER (node->cache), rect);
       gegl_cache_invalidate (node->cache, rect);
     }
 
@@ -571,7 +574,7 @@
       dirty_rect = *rect;
     }
 
-  gegl_node_invalidated (destination, &dirty_rect);
+  gegl_node_invalidated (destination, &dirty_rect, FALSE);
 }
 
 gboolean
@@ -1012,7 +1015,7 @@
                                        &dirty_rect,
                                        &new_have_rect);*/
 
-          gegl_node_invalidated (self, &dirty_rect);
+          gegl_node_invalidated (self, &dirty_rect, FALSE);
         }
       else
         {
@@ -1027,7 +1030,7 @@
                                        &dirty_rect,
                                        &new_have_rect);
 
-          gegl_node_invalidated (self, &dirty_rect);
+          gegl_node_invalidated (self, &dirty_rect, FALSE);
         }
     }
 }
@@ -1685,7 +1688,7 @@
   gegl_node_link_many (other, to_be_inserted, self, NULL);
 
   /* emit the change ourselves */
-  gegl_node_invalidated (self, &rectangle);
+  gegl_node_invalidated (self, &rectangle, FALSE);
 }
 
 gint

Modified: trunk/gegl/graph/gegl-node.h
==============================================================================
--- trunk/gegl/graph/gegl-node.h	(original)
+++ trunk/gegl/graph/gegl-node.h	Thu Oct 30 23:56:36 2008
@@ -214,7 +214,8 @@
 
 GeglCache   * gegl_node_get_cache           (GeglNode      *node);
 void          gegl_node_invalidated         (GeglNode      *node,
-                                             const GeglRectangle *rect);
+                                             const GeglRectangle *rect,
+                                             gboolean             clean_cache);
 GeglRectangle gegl_node_get_bounding_box    (GeglNode      *root);
 
 const gchar * gegl_node_get_name            (GeglNode      *self);

Modified: trunk/gegl/operation/gegl-operation.c
==============================================================================
--- trunk/gegl/operation/gegl-operation.c	(original)
+++ trunk/gegl/operation/gegl-operation.c	Thu Oct 30 23:56:36 2008
@@ -419,7 +419,8 @@
 
 void
 gegl_operation_invalidate (GeglOperation       *operation,
-                           const GeglRectangle *roi)
+                           const GeglRectangle *roi,
+                           gboolean             clear_cache)
 {
   GeglNode *node = NULL;
 
@@ -429,5 +430,5 @@
   g_return_if_fail (GEGL_IS_OPERATION (operation));
   node = operation->node;
 
-  gegl_node_invalidated (node, roi);
+  gegl_node_invalidated (node, roi, TRUE);
 }

Modified: trunk/gegl/operation/gegl-operation.h
==============================================================================
--- trunk/gegl/operation/gegl-operation.h	(original)
+++ trunk/gegl/operation/gegl-operation.h	Thu Oct 30 23:56:36 2008
@@ -220,7 +220,8 @@
 void     gegl_operation_path_prop_changed    (GeglPath            *path,
                                               GeglOperation       *operation);
 void     gegl_operation_invalidate            (GeglOperation       *operation,
-                                               const GeglRectangle *roi);
+                                               const GeglRectangle *roi,
+                                               gboolean             clear_cache);
 
 G_END_DECLS
 

Modified: trunk/operations/common/open-buffer.c
==============================================================================
--- trunk/operations/common/open-buffer.c	(original)
+++ trunk/operations/common/open-buffer.c	Thu Oct 30 23:56:36 2008
@@ -35,7 +35,7 @@
                             const GeglRectangle *rect,
                             gpointer             userdata)
 {
-  gegl_operation_invalidate (GEGL_OPERATION (userdata), rect);
+  gegl_operation_invalidate (GEGL_OPERATION (userdata), rect, FALSE);
 }
 
 static GeglBuffer *ensure_buffer (GeglOperation *operation)

Modified: trunk/operations/external/fill.c
==============================================================================
--- trunk/operations/external/fill.c	(original)
+++ trunk/operations/external/fill.c	Thu Oct 30 23:56:36 2008
@@ -58,7 +58,7 @@
                           gpointer userdata)
 {
   /* invalidate the incoming rectangle */
-  gegl_operation_invalidate (userdata, roi);
+  gegl_operation_invalidate (userdata, roi, TRUE);
 };
 
 static GeglRectangle

Modified: trunk/operations/external/stroke.c
==============================================================================
--- trunk/operations/external/stroke.c	(original)
+++ trunk/operations/external/stroke.c	Thu Oct 30 23:56:36 2008
@@ -62,7 +62,7 @@
   rect.width += o->linewidth;
   rect.height += o->linewidth;
 
-  gegl_operation_invalidate (userdata, &rect);
+  gegl_operation_invalidate (userdata, &rect, FALSE);
 };
 
 static void



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