[gimp/goat-invasion: 220/401] app: more gimp_drawable_apply_region() -> apply_buffer()



commit 4b342686198b3875df93a72ef7a60a35bc34e6aa
Author: Michael Natterer <mitch gimp org>
Date:   Thu Mar 22 19:42:05 2012 +0100

    app: more gimp_drawable_apply_region() -> apply_buffer()

 app/core/gimpimagemap.c           |   12 ++++--------
 app/core/gimplayer-floating-sel.c |   21 ++++++++++-----------
 2 files changed, 14 insertions(+), 19 deletions(-)
---
diff --git a/app/core/gimpimagemap.c b/app/core/gimpimagemap.c
index ac5627b..00fddf1 100644
--- a/app/core/gimpimagemap.c
+++ b/app/core/gimpimagemap.c
@@ -744,9 +744,8 @@ gimp_image_map_do (GimpImageMap *image_map)
        */
       for (i = 0; i < 16; i++)
         {
-          GeglBuffer  *src_buffer;
-          PixelRegion  srcPR;
-          gint         x, y, w, h;
+          GeglBuffer *src_buffer;
+          gint        x, y, w, h;
 
           if (image_map->timer)
             g_timer_continue (image_map->timer);
@@ -772,11 +771,8 @@ gimp_image_map_do (GimpImageMap *image_map)
 
           src_buffer = gimp_drawable_get_shadow_buffer (image_map->drawable);
 
-          pixel_region_init (&srcPR,
-                             gimp_gegl_buffer_get_tiles (src_buffer),
-                             x, y, w, h, FALSE);
-
-          gimp_drawable_apply_region (image_map->drawable, &srcPR,
+          gimp_drawable_apply_buffer (image_map->drawable, src_buffer,
+                                      GIMP_GEGL_RECT (x, y, w, h),
                                       FALSE, NULL,
                                       GIMP_OPACITY_OPAQUE, GIMP_REPLACE_MODE,
                                       NULL, NULL,
diff --git a/app/core/gimplayer-floating-sel.c b/app/core/gimplayer-floating-sel.c
index 4b0ce92..f09d33f 100644
--- a/app/core/gimplayer-floating-sel.c
+++ b/app/core/gimplayer-floating-sel.c
@@ -23,7 +23,7 @@
 
 #include "core-types.h"
 
-#include "base/pixel-region.h"
+#include "gegl/gimp-gegl-utils.h"
 
 #include "gimpboundary.h"
 #include "gimperror.h"
@@ -310,17 +310,9 @@ floating_sel_composite (GimpLayer *layer)
                                 &combine_x, &combine_y,
                                 &combine_width, &combine_height))
     {
-      PixelRegion fsPR;
+      GeglBuffer *fs_buffer;
       gboolean    lock_alpha = FALSE;
 
-      /*  composite the area from the layer to the drawable  */
-      pixel_region_init (&fsPR,
-                         gimp_drawable_get_tiles (GIMP_DRAWABLE (layer)),
-                         combine_x - off_x,
-                         combine_y - off_y,
-                         combine_width, combine_height,
-                         FALSE);
-
       /*  a kludge here to prevent the case of the drawable
        *  underneath having lock alpha on, and disallowing
        *  the composited floating selection from being shown
@@ -333,7 +325,14 @@ floating_sel_composite (GimpLayer *layer)
             gimp_layer_set_lock_alpha (GIMP_LAYER (drawable), FALSE, FALSE);
         }
 
-      gimp_drawable_apply_region (drawable, &fsPR,
+      /*  composite the area from the layer to the drawable  */
+      fs_buffer = gimp_drawable_get_buffer (GIMP_DRAWABLE (layer));
+
+      gimp_drawable_apply_buffer (drawable, fs_buffer,
+                                  GIMP_GEGL_RECT (combine_x - off_x,
+                                                  combine_y - off_y,
+                                                  combine_width,
+                                                  combine_height),
                                   TRUE, NULL,
                                   gimp_layer_get_opacity (layer),
                                   gimp_layer_get_mode (layer),



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