From acad9ac510f4e67cb1f2d8b8c4f77cb9810db923 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Sat, 17 Mar 2012 12:40:34 +0100 Subject: [PATCH] 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 file changed, 4 insertions(+), 12 deletions(-) diff --git a/app/core/gimpdrawable.c b/app/core/gimpdrawable.c index 13ee25acba..97435f79fe 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); }