[gimp/goat-invasion: 454/526] app: use gegl_buffer_copy() to copy into a pattern's preview



commit 9466d6993cc8447193bdde721a1450b86daaaf1a
Author: Michael Natterer <mitch gimp org>
Date:   Sun Apr 8 00:46:33 2012 +0200

    app: use gegl_buffer_copy() to copy into a pattern's preview

 app/core/gimppattern.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/app/core/gimppattern.c b/app/core/gimppattern.c
index f5c6878..2bf0992 100644
--- a/app/core/gimppattern.c
+++ b/app/core/gimppattern.c
@@ -146,6 +146,8 @@ gimp_pattern_get_new_preview (GimpViewable *viewable,
 {
   GimpPattern *pattern = GIMP_PATTERN (viewable);
   TempBuf     *temp_buf;
+  GeglBuffer  *src_buffer;
+  GeglBuffer  *dest_buffer;
   gint         copy_width;
   gint         copy_height;
 
@@ -155,8 +157,14 @@ gimp_pattern_get_new_preview (GimpViewable *viewable,
   temp_buf = temp_buf_new (copy_width, copy_height,
                            pattern->mask->bytes);
 
-  temp_buf_copy_area (pattern->mask, temp_buf,
-                      0, 0, copy_width, copy_height, 0, 0);
+  src_buffer  = gimp_temp_buf_create_buffer (pattern->mask, NULL, FALSE);
+  dest_buffer = gimp_temp_buf_create_buffer (temp_buf, NULL, FALSE);
+
+  gegl_buffer_copy (src_buffer,  GEGL_RECTANGLE (0, 0, copy_width, copy_height),
+                    dest_buffer, GEGL_RECTANGLE (0, 0, 0, 0));
+
+  g_object_unref (src_buffer);
+  g_object_unref (dest_buffer);
 
   return temp_buf;
 }



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