[gimp/goat-invasion: 92/241] app: flush both write and write buffer in gimp_drawable_update()



commit 56c4829c614bb53e9ec918b18c54d728eecbfeb9
Author: Michael Natterer <mitch gimp org>
Date:   Sat Mar 17 12:40:34 2012 +0100

    app: flush both write and write buffer in gimp_drawable_update()
    
    so tiles and buffers are up-to-date before anyone has a chance to
    access the modified pixels.

 app/core/gimpdrawable.c |   16 ++++------------
 1 files changed, 4 insertions(+), 12 deletions(-)
---
diff --git a/app/core/gimpdrawable.c b/app/core/gimpdrawable.c
index 13ee25a..97435f7 100644
--- a/app/core/gimpdrawable.c
+++ b/app/core/gimpdrawable.c
@@ -747,8 +747,7 @@ gimp_drawable_real_update (GimpDrawable *drawable,
 {
   if (drawable->private->tile_source_node)
     {
-      GObject    *operation = NULL;
-      GeglBuffer *buffer    = NULL;
+      GObject *operation = NULL;
 
       g_object_get (drawable->private->tile_source_node,
                     "gegl-operation", &operation,
@@ -766,16 +765,6 @@ gimp_drawable_real_update (GimpDrawable *drawable,
           gegl_operation_invalidate (GEGL_OPERATION (operation), &rect, FALSE);
           g_object_unref (operation);
         }
-
-      gegl_node_get (drawable->private->tile_source_node,
-                     "buffer", &buffer,
-                     NULL);
-
-      if (buffer)
-        {
-          gimp_gegl_buffer_refetch_tiles (buffer);
-          g_object_unref (buffer);
-        }
     }
 
   gimp_viewable_invalidate_preview (GIMP_VIEWABLE (drawable));
@@ -1267,6 +1256,9 @@ gimp_drawable_update (GimpDrawable *drawable,
   if (drawable->private->write_buffer)
     gegl_buffer_flush (drawable->private->write_buffer);
 
+  if (drawable->private->read_buffer)
+    gimp_gegl_buffer_refetch_tiles (drawable->private->read_buffer);
+
   g_signal_emit (drawable, gimp_drawable_signals[UPDATE], 0,
                  x, y, width, height);
 }



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