[gimp/goat-invasion: 30/608] app: stop gimp_buffer_to_tiles use GeglBuffer
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/goat-invasion: 30/608] app: stop gimp_buffer_to_tiles use GeglBuffer
- Date: Fri, 27 Apr 2012 20:27:55 +0000 (UTC)
commit 65f4c1585168f7f21efc294468d82d3a27cb6c7c
Author: Ãyvind KolÃs <pippin gimp org>
Date: Wed Mar 14 21:28:53 2012 +0000
app: stop gimp_buffer_to_tiles use GeglBuffer
app/gegl/gimp-gegl-utils.c | 36 +++++++++++-------------------------
1 files changed, 11 insertions(+), 25 deletions(-)
---
diff --git a/app/gegl/gimp-gegl-utils.c b/app/gegl/gimp-gegl-utils.c
index 314a2e9..34189a1 100644
--- a/app/gegl/gimp-gegl-utils.c
+++ b/app/gegl/gimp-gegl-utils.c
@@ -87,32 +87,18 @@ gimp_babl_format_to_legacy_bpp (const Babl *format)
TileManager *
gimp_buffer_to_tiles (GeglBuffer *buffer)
{
- const Babl *format = gegl_buffer_get_format (buffer);
- TileManager *new_tiles = NULL;
- GeglNode *source = NULL;
- GeglNode *sink = NULL;
-
- g_return_val_if_fail (buffer != NULL, NULL);
-
- /* Setup and process the graph */
- new_tiles = tile_manager_new (gegl_buffer_get_width (buffer),
- gegl_buffer_get_height (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);
+
+ new_tiles = tile_manager_new (width, height,
gimp_babl_format_to_legacy_bpp (format));
- source = gegl_node_new_child (NULL,
- "operation", "gegl:buffer-source",
- "buffer", buffer,
- NULL);
- sink = gegl_node_new_child (NULL,
- "operation", "gimp:tilemanager-sink",
- "tile-manager", new_tiles,
- NULL);
- gegl_node_link_many (source, sink, NULL);
- gegl_node_process (sink);
-
- /* Clenaup */
- g_object_unref (sink);
- g_object_unref (source);
-
+ temp = gimp_tile_manager_get_gegl_buffer (new_tiles, TRUE);
+ gegl_buffer_copy (buffer, NULL, temp, NULL);
+ g_object_unref (temp);
return new_tiles;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]