diff --git a/app/core/gimp-edit.c b/app/core/gimp-edit.c index 1ba12dbce7..73a1fb0cbc 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 5a24d34e0e..7795069068 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 ae873284c9..ff4e24854e 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 008c88cc70..e5d0534d70 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 216312170d..821dd2c1f5 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 a86acbe560..ff681d6ccb 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 1f472ee115..3816fff8ae 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 ca6dc94795..39f2566221 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 34189a1039..a6aae8abd5 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 cff7710ffa..01b17c412a 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);