[gimp/goat-invasion: 49/234] app: use gegl_buffer_copy() in gimp_drawable_real_push_undo()



commit 342e3ee4ac4ecc60dfb21b72cbeeb9061ceb3e7a
Author: Michael Natterer <mitch gimp org>
Date:   Thu Mar 15 12:30:41 2012 +0100

    app: use gegl_buffer_copy() in gimp_drawable_real_push_undo()

 app/core/gimpdrawable.c |   21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)
---
diff --git a/app/core/gimpdrawable.c b/app/core/gimpdrawable.c
index 78d4057..5c03540 100644
--- a/app/core/gimpdrawable.c
+++ b/app/core/gimpdrawable.c
@@ -921,14 +921,23 @@ gimp_drawable_real_push_undo (GimpDrawable *drawable,
 
   if (! tiles)
     {
-      PixelRegion srcPR, destPR;
+      GeglBuffer    *dest_buffer;
+      GeglRectangle  src_rect;
+      GeglRectangle  dest_rect = { 0, };
 
       tiles = tile_manager_new (width, height, gimp_drawable_bytes (drawable));
-      pixel_region_init (&srcPR, gimp_drawable_get_tiles (drawable),
-                         x, y, width, height, FALSE);
-      pixel_region_init (&destPR, tiles,
-                         0, 0, width, height, TRUE);
-      copy_region (&srcPR, &destPR);
+
+      dest_buffer = gimp_tile_manager_create_buffer (tiles, TRUE);
+
+      src_rect.x      = x;
+      src_rect.y      = y;
+      src_rect.width  = width;
+      src_rect.height = height;
+
+      gegl_buffer_copy (gimp_drawable_get_read_buffer (drawable), &src_rect,
+                        dest_buffer, &dest_rect);
+
+      g_object_unref (dest_buffer);
 
       new_tiles = TRUE;
     }



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