[gimp/goat-invasion: 35/418] app: rename gimp_drawable_get_buffer() and gimp_tile_manager_get_gegl_buffer()



commit a2a2984326875a413188c06446320d31c81c61a0
Author: Michael Natterer <mitch gimp org>
Date:   Thu Mar 15 00:19:44 2012 +0100

    app: rename gimp_drawable_get_buffer() and gimp_tile_manager_get_gegl_buffer()
    
    to foo_create_buffer() because they return new objects.

 app/core/gimp-edit.c              |    2 +-
 app/core/gimpdrawable-offset.c    |    4 ++--
 app/core/gimpdrawable-operation.c |    4 ++--
 app/core/gimpdrawable.c           |   16 ++++++++--------
 app/core/gimpdrawable.h           |    3 ++-
 app/core/gimpimagemap.c           |    4 ++--
 app/core/gimplayer.c              |    5 +----
 app/core/gimpprojection.c         |    7 ++++---
 app/gegl/gimp-gegl-utils.c        |   15 ++++++++-------
 app/gegl/gimp-gegl-utils.h        |    2 +-
 10 files changed, 31 insertions(+), 31 deletions(-)
---
diff --git a/app/core/gimp-edit.c b/app/core/gimp-edit.c
index 1ba12db..73a1fb0 100644
--- a/app/core/gimp-edit.c
+++ b/app/core/gimp-edit.c
@@ -518,7 +518,7 @@ gimp_edit_extract (GimpImage     *image,
       GeglBuffer *temp;
       GimpBuffer *buffer;
 
-      temp = gimp_tile_manager_get_gegl_buffer (tiles, TRUE);
+      temp = gimp_tile_manager_create_buffer (tiles, TRUE);
       tile_manager_unref (tiles);
 
       buffer = gimp_buffer_new (temp, _("Global Buffer"),
diff --git a/app/core/gimpdrawable-offset.c b/app/core/gimpdrawable-offset.c
index 5a24d34..7795069 100644
--- a/app/core/gimpdrawable-offset.c
+++ b/app/core/gimpdrawable-offset.c
@@ -93,8 +93,8 @@ gimp_drawable_offset (GimpDrawable   *drawable,
 
   new_tiles = tile_manager_new (width, height, gimp_drawable_bytes (drawable));
 
-  src_buffer  = gimp_drawable_get_buffer (drawable, FALSE);
-  dest_buffer = gimp_tile_manager_get_gegl_buffer (new_tiles, TRUE);
+  src_buffer  = gimp_drawable_create_buffer (drawable, FALSE);
+  dest_buffer = gimp_tile_manager_create_buffer (new_tiles, TRUE);
 
   if (offset_x >= 0)
     {
diff --git a/app/core/gimpdrawable-operation.c b/app/core/gimpdrawable-operation.c
index ae87328..ff4e248 100644
--- a/app/core/gimpdrawable-operation.c
+++ b/app/core/gimpdrawable-operation.c
@@ -180,8 +180,8 @@ gimp_drawable_apply_operation_private (GimpDrawable        *drawable,
                 "dont-cache", TRUE,
                 NULL);
 
-  inbuf  = gimp_drawable_get_buffer (drawable, FALSE);
-  outbuf = gimp_tile_manager_get_gegl_buffer (dest_tiles, TRUE);
+  inbuf  = gimp_drawable_create_buffer (drawable, FALSE);
+  outbuf = gimp_tile_manager_create_buffer (dest_tiles, TRUE);
 
   input  = gegl_node_new_child (gegl,
                                 "operation", "gegl:buffer-source",
diff --git a/app/core/gimpdrawable.c b/app/core/gimpdrawable.c
index 008c88c..e5d0534 100644
--- a/app/core/gimpdrawable.c
+++ b/app/core/gimpdrawable.c
@@ -435,8 +435,8 @@ gimp_drawable_duplicate (GimpItem *item,
                           gimp_item_get_height (new_item),
                           gimp_drawable_bytes (new_drawable));
 
-      src  = gimp_drawable_get_buffer (drawable, FALSE);
-      dest = gimp_drawable_get_buffer (new_drawable, TRUE);
+      src  = gimp_drawable_create_buffer (drawable, FALSE);
+      dest = gimp_drawable_create_buffer (new_drawable, TRUE);
 
       gegl_buffer_copy (src, NULL, dest, NULL);
 
@@ -848,7 +848,7 @@ gimp_drawable_real_set_tiles (GimpDrawable *drawable,
 
   if (drawable->private->tile_source_node)
     {
-      GeglBuffer *buffer = gimp_drawable_get_buffer (drawable, FALSE);
+      GeglBuffer *buffer = gimp_drawable_create_buffer (drawable, FALSE);
 
       gegl_node_set (drawable->private->tile_source_node,
                      "buffer", buffer,
@@ -1472,13 +1472,13 @@ gimp_drawable_init_src_region (GimpDrawable  *drawable,
 }
 
 GeglBuffer *
-gimp_drawable_get_buffer (GimpDrawable *drawable,
-                          gboolean      write)
+gimp_drawable_create_buffer (GimpDrawable *drawable,
+                             gboolean      write)
 {
   g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
 
-  return gimp_tile_manager_get_gegl_buffer (gimp_drawable_get_tiles (drawable),
-                                            write);
+  return gimp_tile_manager_create_buffer (gimp_drawable_get_tiles (drawable),
+                                          write);
 }
 
 TileManager *
@@ -1567,7 +1567,7 @@ gimp_drawable_get_source_node (GimpDrawable *drawable)
 
   drawable->private->source_node = gegl_node_new ();
 
-  buffer = gimp_drawable_get_buffer (drawable, FALSE);
+  buffer = gimp_drawable_create_buffer (drawable, FALSE);
 
   drawable->private->tile_source_node =
     gegl_node_new_child (drawable->private->source_node,
diff --git a/app/core/gimpdrawable.h b/app/core/gimpdrawable.h
index 2163121..821dd2c 100644
--- a/app/core/gimpdrawable.h
+++ b/app/core/gimpdrawable.h
@@ -178,8 +178,9 @@ void            gimp_drawable_init_src_region    (GimpDrawable       *drawable,
                                                   gint                height,
                                                   TileManager       **temp_tiles);
 
-GeglBuffer    * gimp_drawable_get_buffer         (GimpDrawable       *drawable,
+GeglBuffer    * gimp_drawable_create_buffer      (GimpDrawable       *drawable,
                                                   gboolean            write);
+
 TileManager   * gimp_drawable_get_tiles          (GimpDrawable       *drawable);
 void            gimp_drawable_set_tiles          (GimpDrawable       *drawable,
                                                   gboolean            push_undo,
diff --git a/app/core/gimpimagemap.c b/app/core/gimpimagemap.c
index a86acbe..ff681d6 100644
--- a/app/core/gimpimagemap.c
+++ b/app/core/gimpimagemap.c
@@ -382,9 +382,9 @@ gimp_image_map_apply (GimpImageMap        *image_map,
       GeglBuffer *output_buffer;
 
       input_buffer =
-        gimp_tile_manager_get_gegl_buffer (image_map->undo_tiles, FALSE);
+        gimp_tile_manager_create_buffer (image_map->undo_tiles, FALSE);
       output_buffer =
-        gimp_tile_manager_get_gegl_buffer (gimp_drawable_get_shadow_tiles (image_map->drawable), TRUE);
+        gimp_tile_manager_create_buffer (gimp_drawable_get_shadow_tiles (image_map->drawable), TRUE);
 
       if (! image_map->gegl)
         {
diff --git a/app/core/gimplayer.c b/app/core/gimplayer.c
index 1f472ee..3816fff 100644
--- a/app/core/gimplayer.c
+++ b/app/core/gimplayer.c
@@ -1200,11 +1200,8 @@ gimp_layer_new_from_buffer (GeglBuffer           *buffer,
                           type, name,
                           opacity, mode);
 
-  dest = gimp_tile_manager_get_gegl_buffer (gimp_drawable_get_tiles (GIMP_DRAWABLE (layer)),
-                                            TRUE);
-
+  dest = gimp_drawable_create_buffer (GIMP_DRAWABLE (layer), TRUE);
   gegl_buffer_copy (buffer, NULL, dest, NULL);
-
   g_object_unref (dest);
 
   return layer;
diff --git a/app/core/gimpprojection.c b/app/core/gimpprojection.c
index ca6dc94..39f2566 100644
--- a/app/core/gimpprojection.c
+++ b/app/core/gimpprojection.c
@@ -393,7 +393,7 @@ gimp_projection_get_sink_node (GimpProjection *proj)
   gegl_node_add_child (proj->graph, graph);
 
   tiles  = gimp_projection_get_tiles (GIMP_PICKABLE (proj));
-  buffer = gimp_tile_manager_get_gegl_buffer (tiles, TRUE);
+  buffer = gimp_tile_manager_create_buffer (tiles, TRUE);
 
   proj->sink_node =
     gegl_node_new_child (proj->graph,
@@ -433,9 +433,10 @@ gimp_projection_get_tiles_at_level (GimpProjection *proj,
       if (proj->sink_node)
         {
           TileManager *tiles;
-          GeglBuffer *buffer;
+          GeglBuffer  *buffer;
+
           tiles = tile_pyramid_get_tiles (proj->pyramid, 0, NULL);
-          buffer = gimp_tile_manager_get_gegl_buffer (tiles, TRUE);
+          buffer = gimp_tile_manager_create_buffer (tiles, TRUE);
 
           gegl_node_set (proj->sink_node,
                          "buffer", buffer,
diff --git a/app/gegl/gimp-gegl-utils.c b/app/gegl/gimp-gegl-utils.c
index 34189a1..a6aae8a 100644
--- a/app/gegl/gimp-gegl-utils.c
+++ b/app/gegl/gimp-gegl-utils.c
@@ -89,16 +89,17 @@ gimp_buffer_to_tiles (GeglBuffer *buffer)
 {
   TileManager *new_tiles;
   GeglBuffer  *temp;
+  gint         width  = gegl_buffer_get_width (buffer);
+  gint         height = gegl_buffer_get_height (buffer);
+  const Babl  *format = gegl_buffer_get_format (buffer);
 
-  gint  width  = gegl_buffer_get_width (buffer);
-  gint  height = gegl_buffer_get_height (buffer);
-  const Babl *format = gegl_buffer_get_format (buffer);
-  
   new_tiles = tile_manager_new (width, height,
                                 gimp_babl_format_to_legacy_bpp (format));
-  temp = gimp_tile_manager_get_gegl_buffer (new_tiles, TRUE);
+
+  temp = gimp_tile_manager_create_buffer (new_tiles, TRUE);
   gegl_buffer_copy (buffer, NULL, temp, NULL);
   g_object_unref (temp);
+
   return new_tiles;
 }
 
@@ -157,8 +158,8 @@ gimp_interpolation_to_gegl_filter (GimpInterpolationType interpolation)
 }
 
 GeglBuffer *
-gimp_tile_manager_get_gegl_buffer (TileManager *tm,
-                                   gboolean     write)
+gimp_tile_manager_create_buffer (TileManager *tm,
+                                 gboolean     write)
 {
   GeglTileBackend *backend;
   GeglBuffer      *buffer;
diff --git a/app/gegl/gimp-gegl-utils.h b/app/gegl/gimp-gegl-utils.h
index cff7710..01b17c4 100644
--- a/app/gegl/gimp-gegl-utils.h
+++ b/app/gegl/gimp-gegl-utils.h
@@ -30,7 +30,7 @@ TileManager * gimp_buffer_to_tiles              (GeglBuffer            *buffer);
 const gchar * gimp_layer_mode_to_gegl_operation (GimpLayerModeEffects   mode) G_GNUC_CONST;
 const gchar * gimp_interpolation_to_gegl_filter (GimpInterpolationType  interpolation) G_GNUC_CONST;
 
-GeglBuffer  * gimp_tile_manager_get_gegl_buffer (TileManager           *tm,
+GeglBuffer  * gimp_tile_manager_create_buffer   (TileManager           *tm,
                                                  gboolean               write);
 
 



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