[gimp/goat-invasion: 175/526] app: remove write property of GeglBuffer backend
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/goat-invasion: 175/526] app: remove write property of GeglBuffer backend
- Date: Sun, 22 Apr 2012 13:13:58 +0000 (UTC)
commit 929f523fcf2cef8bb6132e5574e6c596eefb3b7c
Author: Ãyvind KolÃs <pippin gimp org>
Date: Tue Mar 20 23:53:08 2012 +0000
app: remove write property of GeglBuffer backend
app/core/gimp-edit.c | 4 +-
app/core/gimpchannel.c | 8 ++---
app/core/gimpdrawable-blend.c | 9 ++---
app/core/gimpdrawable-bucket-fill.c | 3 +-
app/core/gimpdrawable-convert.c | 6 ++--
app/core/gimpdrawable-offset.c | 3 +-
app/core/gimpdrawable-operation.c | 3 +-
app/core/gimpdrawable-stroke.c | 4 +-
app/core/gimpdrawable-transform.c | 16 ++++-----
app/core/gimpdrawable.c | 17 +++------
app/core/gimpimagemap.c | 13 +++----
app/core/gimplayer.c | 17 +++------
app/core/gimpprojection-construct.c | 2 +-
app/core/gimpprojection.c | 6 ++--
app/core/gimpselection.c | 2 +-
app/gegl/gimp-gegl-utils.c | 7 ++--
app/gegl/gimp-gegl-utils.h | 4 +--
app/gegl/gimptilebackendtilemanager.c | 61 +++-----------------------------
app/gegl/gimptilebackendtilemanager.h | 3 +-
19 files changed, 56 insertions(+), 132 deletions(-)
---
diff --git a/app/core/gimp-edit.c b/app/core/gimp-edit.c
index 8ee7a68..782b737 100644
--- a/app/core/gimp-edit.c
+++ b/app/core/gimp-edit.c
@@ -488,7 +488,7 @@ gimp_edit_fill_full (GimpImage *image,
buf_tiles = tile_manager_new (width, height, tiles_bytes);
- dest_buffer = gimp_tile_manager_create_buffer (buf_tiles, format, TRUE);
+ dest_buffer = gimp_tile_manager_create_buffer (buf_tiles, format);
if (pattern)
{
@@ -599,7 +599,7 @@ gimp_edit_extract (GimpImage *image,
GeglBuffer *temp;
GimpBuffer *buffer;
- temp = gimp_tile_manager_create_buffer (tiles, format, TRUE);
+ temp = gimp_tile_manager_create_buffer (tiles, format);
tile_manager_unref (tiles);
buffer = gimp_buffer_new (temp, _("Global Buffer"),
diff --git a/app/core/gimpchannel.c b/app/core/gimpchannel.c
index fc85108..51187c3 100644
--- a/app/core/gimpchannel.c
+++ b/app/core/gimpchannel.c
@@ -472,8 +472,7 @@ gimp_channel_convert (GimpItem *item,
flatten = gimp_gegl_create_flatten_node (&background);
buffer = gimp_tile_manager_create_buffer (new_tiles,
- gimp_drawable_get_format_without_alpha (drawable),
- TRUE);
+ gimp_drawable_get_format_without_alpha (drawable));
gimp_drawable_apply_operation_to_buffer (drawable, NULL, NULL,
flatten, TRUE, buffer);
@@ -1665,8 +1664,7 @@ gimp_channel_new_from_alpha (GimpImage *image,
dest_tiles = gimp_drawable_get_tiles (GIMP_DRAWABLE (channel));
dest_buffer = gimp_tile_manager_create_buffer (dest_tiles,
- babl_format ("A u8"),
- TRUE);
+ babl_format ("A u8"));
gegl_buffer_copy (gimp_drawable_get_buffer (drawable), NULL,
dest_buffer, NULL);
@@ -1710,7 +1708,7 @@ gimp_channel_new_from_component (GimpImage *image,
channel = gimp_channel_new (image, width, height, name, color);
dest_tiles = gimp_drawable_get_tiles (GIMP_DRAWABLE (channel));
- dest_buffer = gimp_tile_manager_create_buffer (dest_tiles, format, TRUE);
+ dest_buffer = gimp_tile_manager_create_buffer (dest_tiles, format);
gegl_buffer_copy (src_buffer, NULL, dest_buffer, NULL);
diff --git a/app/core/gimpdrawable-blend.c b/app/core/gimpdrawable-blend.c
index 2c99e3d..b1bd9d9 100644
--- a/app/core/gimpdrawable-blend.c
+++ b/app/core/gimpdrawable-blend.c
@@ -598,8 +598,7 @@ gradient_precalc_shapeburst (GimpImage *image,
gimp_item_get_offset (GIMP_ITEM (drawable), &off_x, &off_y);
temp_buffer = gimp_tile_manager_create_buffer (temp_tiles,
- babl_format ("Y u8"),
- TRUE);
+ babl_format ("Y u8"));
src_rect.x = x + off_x;
src_rect.y = y + off_y;
@@ -620,8 +619,7 @@ gradient_precalc_shapeburst (GimpImage *image,
GeglRectangle dest_rect = { 0, };
temp_buffer = gimp_tile_manager_create_buffer (temp_tiles,
- babl_format ("A u8"),
- TRUE);
+ babl_format ("A u8"));
src_rect.x = PR->x;
src_rect.y = PR->y;
@@ -637,8 +635,7 @@ gradient_precalc_shapeburst (GimpImage *image,
GeglColor *white = gegl_color_new ("white");
temp_buffer = gimp_tile_manager_create_buffer (temp_tiles,
- babl_format ("Y u8"),
- TRUE);
+ babl_format ("Y u8"));
/* Otherwise, just fill the shapeburst to white */
gegl_buffer_set_color (temp_buffer, NULL, white);
diff --git a/app/core/gimpdrawable-bucket-fill.c b/app/core/gimpdrawable-bucket-fill.c
index 7b14424..0603882 100644
--- a/app/core/gimpdrawable-bucket-fill.c
+++ b/app/core/gimpdrawable-bucket-fill.c
@@ -228,8 +228,7 @@ gimp_drawable_bucket_fill_internal (GimpDrawable *drawable,
tiles = tile_manager_new ((x2 - x1), (y2 - y1),
gimp_drawable_bytes_with_alpha (drawable));
buffer = gimp_tile_manager_create_buffer (tiles,
- gimp_drawable_get_format_with_alpha (drawable),
- TRUE);
+ gimp_drawable_get_format_with_alpha (drawable));
switch (fill_mode)
{
diff --git a/app/core/gimpdrawable-convert.c b/app/core/gimpdrawable-convert.c
index af5c5a3..45708d1 100644
--- a/app/core/gimpdrawable-convert.c
+++ b/app/core/gimpdrawable-convert.c
@@ -55,7 +55,7 @@ gimp_drawable_convert_rgb (GimpDrawable *drawable,
gimp_item_get_height (GIMP_ITEM (drawable)),
GIMP_IMAGE_TYPE_BYTES (type));
- dest_buffer = gimp_tile_manager_create_buffer (tiles, NULL, TRUE);
+ dest_buffer = gimp_tile_manager_create_buffer (tiles, NULL);
gegl_buffer_copy (gimp_drawable_get_buffer (drawable), NULL,
dest_buffer, NULL);
@@ -87,7 +87,7 @@ gimp_drawable_convert_grayscale (GimpDrawable *drawable,
gimp_item_get_height (GIMP_ITEM (drawable)),
GIMP_IMAGE_TYPE_BYTES (type));
- dest_buffer = gimp_tile_manager_create_buffer (tiles, NULL, TRUE);
+ dest_buffer = gimp_tile_manager_create_buffer (tiles, NULL);
gegl_buffer_copy (gimp_drawable_get_buffer (drawable), NULL,
dest_buffer, NULL);
@@ -130,7 +130,7 @@ gimp_drawable_convert_indexed (GimpDrawable *drawable,
gimp_item_get_height (GIMP_ITEM (drawable)),
GIMP_IMAGE_TYPE_BYTES (type));
- dest_buffer = gimp_tile_manager_create_buffer (tiles, format, TRUE);
+ dest_buffer = gimp_tile_manager_create_buffer (tiles, format);
gegl_buffer_copy (gimp_drawable_get_buffer (drawable), NULL,
dest_buffer, NULL);
diff --git a/app/core/gimpdrawable-offset.c b/app/core/gimpdrawable-offset.c
index 72f44ca..ca8808c 100644
--- a/app/core/gimpdrawable-offset.c
+++ b/app/core/gimpdrawable-offset.c
@@ -90,8 +90,7 @@ gimp_drawable_offset (GimpDrawable *drawable,
src_buffer = gimp_drawable_get_buffer (drawable);
dest_buffer = gimp_tile_manager_create_buffer (new_tiles,
- gimp_drawable_get_format (drawable),
- TRUE);
+ gimp_drawable_get_format (drawable));
if (! wrap_around)
{
diff --git a/app/core/gimpdrawable-operation.c b/app/core/gimpdrawable-operation.c
index a48a4f5..9414ee3 100644
--- a/app/core/gimpdrawable-operation.c
+++ b/app/core/gimpdrawable-operation.c
@@ -63,8 +63,7 @@ gimp_drawable_apply_operation (GimpDrawable *drawable,
dest_buffer =
gimp_tile_manager_create_buffer (gimp_drawable_get_shadow_tiles (drawable),
- gimp_drawable_get_format (drawable),
- TRUE);
+ gimp_drawable_get_format (drawable));
gimp_apply_operation (gimp_drawable_get_buffer (drawable),
progress, undo_desc,
diff --git a/app/core/gimpdrawable-stroke.c b/app/core/gimpdrawable-stroke.c
index b30a250..799afc9 100644
--- a/app/core/gimpdrawable-stroke.c
+++ b/app/core/gimpdrawable-stroke.c
@@ -362,8 +362,8 @@ gimp_drawable_stroke_scan_convert (GimpDrawable *drawable,
base = tile_manager_new (w, h, bytes);
base_buffer = gimp_tile_manager_create_buffer (base,
- gimp_drawable_get_format_with_alpha (drawable),
- TRUE);
+
+ gimp_drawable_get_format_with_alpha (drawable));
switch (gimp_fill_options_get_style (options))
{
diff --git a/app/core/gimpdrawable-transform.c b/app/core/gimpdrawable-transform.c
index 9969d45..f2766f6 100644
--- a/app/core/gimpdrawable-transform.c
+++ b/app/core/gimpdrawable-transform.c
@@ -140,10 +140,8 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
gchar *matrix_string;
GimpMatrix3 gegl_matrix;
- src_buffer = gimp_tile_manager_create_buffer (orig_tiles, orig_format,
- FALSE);
- dest_buffer = gimp_tile_manager_create_buffer (new_tiles, orig_format,
- TRUE);
+ src_buffer = gimp_tile_manager_create_buffer (orig_tiles, orig_format);
+ dest_buffer = gimp_tile_manager_create_buffer (new_tiles, orig_format);
gimp_matrix3_identity (&gegl_matrix);
gimp_matrix3_translate (&gegl_matrix, u1, v1);
@@ -254,7 +252,7 @@ gimp_drawable_transform_tiles_flip (GimpDrawable *drawable,
}
new_tiles = tile_manager_new (new_width, new_height, orig_bpp);
- dest_buffer = gimp_tile_manager_create_buffer (new_tiles, orig_format, TRUE);
+ dest_buffer = gimp_tile_manager_create_buffer (new_tiles, orig_format);
if (clip_result && (new_x != orig_x || new_y != orig_y))
{
@@ -305,7 +303,7 @@ gimp_drawable_transform_tiles_flip (GimpDrawable *drawable,
return new_tiles;
}
- src_buffer = gimp_tile_manager_create_buffer (orig_tiles, orig_format, FALSE);
+ src_buffer = gimp_tile_manager_create_buffer (orig_tiles, orig_format);
switch (flip_type)
{
@@ -475,7 +473,7 @@ gimp_drawable_transform_tiles_rotate (GimpDrawable *drawable,
gint clip_width, clip_height;
new_tiles = tile_manager_new (orig_width, orig_height, orig_bpp);
- dest_buffer = gimp_tile_manager_create_buffer (new_tiles, orig_format, TRUE);
+ dest_buffer = gimp_tile_manager_create_buffer (new_tiles, orig_format);
*new_offset_x = orig_x;
*new_offset_y = orig_y;
@@ -551,7 +549,7 @@ gimp_drawable_transform_tiles_rotate (GimpDrawable *drawable,
else
{
new_tiles = tile_manager_new (new_width, new_height, orig_bpp);
- dest_buffer = gimp_tile_manager_create_buffer (new_tiles, orig_format, TRUE);
+ dest_buffer = gimp_tile_manager_create_buffer (new_tiles, orig_format);
*new_offset_x = new_x;
*new_offset_y = new_y;
@@ -568,7 +566,7 @@ gimp_drawable_transform_tiles_rotate (GimpDrawable *drawable,
return new_tiles;
}
- src_buffer = gimp_tile_manager_create_buffer (orig_tiles, orig_format, FALSE);
+ src_buffer = gimp_tile_manager_create_buffer (orig_tiles, orig_format);
src_rect.x = orig_x;
src_rect.y = orig_y;
diff --git a/app/core/gimpdrawable.c b/app/core/gimpdrawable.c
index 206ed03..3d2935f 100644
--- a/app/core/gimpdrawable.c
+++ b/app/core/gimpdrawable.c
@@ -489,8 +489,7 @@ gimp_drawable_scale (GimpItem *item,
NULL);
buffer = gimp_tile_manager_create_buffer (new_tiles,
- gimp_drawable_get_format (drawable),
- TRUE);
+ gimp_drawable_get_format (drawable));
gimp_drawable_apply_operation_to_buffer (drawable, progress,
C_("undo-type", "Scale"),
@@ -577,8 +576,7 @@ gimp_drawable_resize (GimpItem *item,
gimp_drawable_bytes (drawable));
dest_buffer = gimp_tile_manager_create_buffer (new_tiles,
- gimp_drawable_get_format (drawable),
- TRUE);
+ gimp_drawable_get_format (drawable));
if (copy_width != new_width ||
copy_height != new_height)
@@ -930,8 +928,7 @@ gimp_drawable_real_push_undo (GimpDrawable *drawable,
tiles = tile_manager_new (width, height, gimp_drawable_bytes (drawable));
dest_buffer = gimp_tile_manager_create_buffer (tiles,
- gimp_drawable_get_format (drawable),
- TRUE);
+ gimp_drawable_get_format (drawable));
src_rect.x = x;
src_rect.y = y;
@@ -1504,13 +1501,12 @@ gimp_drawable_init_src_region (GimpDrawable *drawable,
}
static GeglBuffer *
-gimp_drawable_create_buffer (GimpDrawable *drawable,
- gboolean write)
+gimp_drawable_create_buffer (GimpDrawable *drawable)
{
TileManager *tiles = gimp_drawable_get_tiles (drawable);
const Babl *format = gimp_drawable_get_format (drawable);
- return gimp_tile_manager_create_buffer (tiles, format, write);
+ return gimp_tile_manager_create_buffer (tiles, format);
}
GeglBuffer *
@@ -1520,8 +1516,7 @@ gimp_drawable_get_buffer (GimpDrawable *drawable)
if (! drawable->private->buffer)
{
- drawable->private->buffer = gimp_drawable_create_buffer (drawable,
- FALSE);
+ drawable->private->buffer = gimp_drawable_create_buffer (drawable);
}
else
{
diff --git a/app/core/gimpimagemap.c b/app/core/gimpimagemap.c
index 9d2da72..4892a46 100644
--- a/app/core/gimpimagemap.c
+++ b/app/core/gimpimagemap.c
@@ -309,8 +309,7 @@ gimp_image_map_get_buffer (GimpPickable *pickable)
if (! image_map->undo_buffer)
image_map->undo_buffer =
gimp_tile_manager_create_buffer (image_map->undo_tiles,
- gimp_drawable_get_format (image_map->drawable),
- FALSE);
+ gimp_drawable_get_format (image_map->drawable));
return image_map->undo_buffer;
}
@@ -432,9 +431,9 @@ gimp_image_map_apply (GimpImageMap *image_map,
GeglBuffer *output_buffer;
input_buffer =
- gimp_tile_manager_create_buffer (image_map->undo_tiles, format, FALSE);
+ gimp_tile_manager_create_buffer (image_map->undo_tiles, format);
output_buffer =
- gimp_tile_manager_create_buffer (gimp_drawable_get_shadow_tiles (image_map->drawable), format, TRUE);
+ gimp_tile_manager_create_buffer (gimp_drawable_get_shadow_tiles (image_map->drawable), format);
if (! image_map->gegl)
{
@@ -724,8 +723,7 @@ gimp_image_map_update_undo_tiles (GimpImageMap *image_map,
/* Copy from the image to the new tiles */
src = gimp_drawable_get_buffer (image_map->drawable);
dest = gimp_tile_manager_create_buffer (image_map->undo_tiles,
- gimp_drawable_get_format (image_map->drawable),
- TRUE);
+ gimp_drawable_get_format (image_map->drawable));
gegl_buffer_copy (src, rect, dest, &dest_rect);
@@ -886,8 +884,7 @@ gimp_image_map_data_written (GObject *operation,
GeglRectangle dest_rect;
src = gimp_tile_manager_create_buffer (image_map->undo_tiles,
- gimp_drawable_get_format (image_map->drawable),
- FALSE);
+ gimp_drawable_get_format (image_map->drawable));
dest = gimp_drawable_get_buffer (image_map->drawable);
src_rect.x = extent->x - image_map->undo_offset_x;
diff --git a/app/core/gimplayer.c b/app/core/gimplayer.c
index 1c66334..af62dc2 100644
--- a/app/core/gimplayer.c
+++ b/app/core/gimplayer.c
@@ -1177,7 +1177,7 @@ gimp_layer_new_from_tiles (TileManager *tiles,
g_return_val_if_fail (format != NULL, NULL);
g_return_val_if_fail (GIMP_IS_IMAGE (dest_image), NULL);
- buffer = gimp_tile_manager_create_buffer (tiles, format, FALSE);
+ buffer = gimp_tile_manager_create_buffer (tiles, format);
layer = gimp_layer_new_from_buffer (buffer, dest_image, type,
name, opacity, mode);
@@ -1394,8 +1394,7 @@ gimp_layer_create_mask (const GimpLayer *layer,
dest_tiles = gimp_drawable_get_tiles (GIMP_DRAWABLE (mask));
dest_buffer = gimp_tile_manager_create_buffer (dest_tiles,
- babl_format ("A u8"),
- TRUE);
+ babl_format ("A u8"));
gegl_buffer_copy (gimp_drawable_get_buffer (drawable), NULL,
dest_buffer, NULL);
@@ -1500,16 +1499,14 @@ gimp_layer_create_mask (const GimpLayer *layer,
gimp_item_get_height (item),
GIMP_IMAGE_TYPE_BYTES (copy_type));
- dest_buffer = gimp_tile_manager_create_buffer (copy_tiles, NULL,
- TRUE);
+ dest_buffer = gimp_tile_manager_create_buffer (copy_tiles, NULL);
gegl_buffer_copy (gimp_drawable_get_buffer (drawable), NULL,
dest_buffer, NULL);
g_object_unref (dest_buffer);
- src_buffer = gimp_tile_manager_create_buffer (copy_tiles, NULL,
- FALSE);
+ src_buffer = gimp_tile_manager_create_buffer (copy_tiles, NULL);
}
else
{
@@ -1827,8 +1824,7 @@ gimp_layer_add_alpha (GimpLayer *layer)
GIMP_IMAGE_TYPE_BYTES (new_type));
dest_buffer = gimp_tile_manager_create_buffer (new_tiles,
- gimp_drawable_get_format_with_alpha (GIMP_DRAWABLE (layer)),
- TRUE);
+ gimp_drawable_get_format_with_alpha (GIMP_DRAWABLE (layer)));
gegl_buffer_copy (gimp_drawable_get_buffer (drawable), NULL,
dest_buffer, NULL);
@@ -1865,8 +1861,7 @@ gimp_layer_flatten (GimpLayer *layer,
GIMP_IMAGE_TYPE_BYTES (new_type));
dest_buffer = gimp_tile_manager_create_buffer (new_tiles,
- gimp_drawable_get_format_without_alpha (GIMP_DRAWABLE (layer)),
- TRUE);
+ gimp_drawable_get_format_without_alpha (GIMP_DRAWABLE (layer)));
gimp_context_get_background (context, &background);
flatten = gimp_gegl_create_flatten_node (&background);
diff --git a/app/core/gimpprojection-construct.c b/app/core/gimpprojection-construct.c
index ead45d9..cf24750 100644
--- a/app/core/gimpprojection-construct.c
+++ b/app/core/gimpprojection-construct.c
@@ -264,7 +264,7 @@ gimp_projection_initialize (GimpProjection *proj,
{
TileManager *tiles = gimp_pickable_get_tiles (GIMP_PICKABLE (proj));
- buffer = gimp_tile_manager_create_buffer (tiles, NULL, TRUE);
+ buffer = gimp_tile_manager_create_buffer (tiles, NULL);
}
gegl_buffer_clear (buffer, &rect);
diff --git a/app/core/gimpprojection.c b/app/core/gimpprojection.c
index 1f4bb35..8610b8a 100644
--- a/app/core/gimpprojection.c
+++ b/app/core/gimpprojection.c
@@ -356,7 +356,7 @@ gimp_projection_get_buffer (GimpPickable *pickable)
{
TileManager *tiles = gimp_projection_get_tiles (pickable);
- proj->buffer = gimp_tile_manager_create_buffer (tiles, NULL, FALSE);
+ proj->buffer = gimp_tile_manager_create_buffer (tiles, NULL);
}
return proj->buffer;
@@ -445,7 +445,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_create_buffer (tiles, NULL, TRUE);
+ buffer = gimp_tile_manager_create_buffer (tiles, NULL);
proj->sink_node =
gegl_node_new_child (proj->graph,
@@ -488,7 +488,7 @@ gimp_projection_get_tiles_at_level (GimpProjection *proj,
GeglBuffer *buffer;
tiles = tile_pyramid_get_tiles (proj->pyramid, 0, NULL);
- buffer = gimp_tile_manager_create_buffer (tiles, NULL, TRUE);
+ buffer = gimp_tile_manager_create_buffer (tiles, NULL);
gegl_node_set (proj->sink_node,
"buffer", buffer,
diff --git a/app/core/gimpselection.c b/app/core/gimpselection.c
index 8c0a928..f0e047a 100644
--- a/app/core/gimpselection.c
+++ b/app/core/gimpselection.c
@@ -728,7 +728,7 @@ gimp_selection_extract (GimpSelection *selection,
/* Allocate the temp buffer */
tiles = tile_manager_new (x2 - x1, y2 - y1,
babl_format_get_bytes_per_pixel (*format));
- dest_buffer = gimp_tile_manager_create_buffer (tiles, *format, TRUE);
+ dest_buffer = gimp_tile_manager_create_buffer (tiles, *format);
/* First, copy the pixels, possibly doing INDEXED->RGB and adding alpha */
gegl_buffer_copy (src_buffer, &src_rect,
diff --git a/app/gegl/gimp-gegl-utils.c b/app/gegl/gimp-gegl-utils.c
index 3b416e3..3bf818f 100644
--- a/app/gegl/gimp-gegl-utils.c
+++ b/app/gegl/gimp-gegl-utils.c
@@ -215,7 +215,7 @@ gimp_gegl_buffer_new (const GeglRectangle *rect,
tiles = tile_manager_new (rect->width, rect->height,
babl_format_get_bytes_per_pixel (format));
- buffer = gimp_tile_manager_create_buffer (tiles, format, TRUE);
+ buffer = gimp_tile_manager_create_buffer (tiles, format);
tile_manager_unref (tiles);
return buffer;
@@ -223,13 +223,12 @@ gimp_gegl_buffer_new (const GeglRectangle *rect,
GeglBuffer *
gimp_tile_manager_create_buffer (TileManager *tm,
- const Babl *format,
- gboolean write)
+ const Babl *format)
{
GeglTileBackend *backend;
GeglBuffer *buffer;
- backend = gimp_tile_backend_tile_manager_new (tm, format, write);
+ backend = gimp_tile_backend_tile_manager_new (tm, format);
buffer = gegl_buffer_new_for_backend (NULL, backend);
g_object_unref (backend);
diff --git a/app/gegl/gimp-gegl-utils.h b/app/gegl/gimp-gegl-utils.h
index 1a65bfe..da5527a 100644
--- a/app/gegl/gimp-gegl-utils.h
+++ b/app/gegl/gimp-gegl-utils.h
@@ -36,10 +36,8 @@ const gchar * gimp_interpolation_to_gegl_filter (GimpInterpolationType interpo
GeglBuffer * gimp_gegl_buffer_new (const GeglRectangle *rect,
const Babl *format);
GeglBuffer * gimp_tile_manager_create_buffer (TileManager *tm,
- const Babl *format,
- gboolean write);
+ const Babl *format);
TileManager * gimp_gegl_buffer_get_tiles (GeglBuffer *buffer);
-
GeglBuffer * gimp_pixbuf_create_buffer (GdkPixbuf *pixbuf);
void gimp_gegl_buffer_refetch_tiles (GeglBuffer *buffer);
diff --git a/app/gegl/gimptilebackendtilemanager.c b/app/gegl/gimptilebackendtilemanager.c
index daeefb7..c498de0 100644
--- a/app/gegl/gimptilebackendtilemanager.c
+++ b/app/gegl/gimptilebackendtilemanager.c
@@ -43,39 +43,11 @@
struct _GimpTileBackendTileManagerPrivate
{
TileManager *tile_manager;
- int write;
int mul;
};
static int gimp_gegl_tile_mul (void)
{
- // gegl projection
- // 8 - 18.6
- // 4 - 15.09
- // 2 - 16.09
- // 1 - 21.5 <---------
- //------
- // legacy projection
- // 1 - 18.6 <---------
- // 2 - 15.07
- // 4 - 15.8
- // 8 - 18.1
- //
- // ---------------------------------------- projection 0copy
- // 1 - 21.15
- // 2 - 17.6
- // 4 - 14.9
- // 8 - 17.036
- // ---------------------------------------- 2d, with projection 0copy
- //10 - 14.1
- // 9 - 15.11
- // 8 - 18.11 \ 15.2
- // 7 - 16
- // 6 - 14.11
- // 4 - 16.8
- // 3 - 17.8
- // 2 - 16.1
-
static int mul = 8;
static gboolean inited = 0;
if (G_LIKELY (inited))
@@ -88,7 +60,6 @@ static int gimp_gegl_tile_mul (void)
return mul;
}
-
static void gimp_tile_backend_tile_manager_finalize (GObject *object);
static void gimp_tile_backend_tile_manager_dispose (GObject *object);
static gpointer gimp_tile_backend_tile_manager_command (GeglTileSource *tile_store,
@@ -167,12 +138,6 @@ gimp_tile_backend_tile_manager_finalize (GObject *object)
}
static void
-tile_done (void *data)
-{
- tile_release (data, FALSE);
-}
-
-static void
tile_done_writing (void *data)
{
tile_release (data, TRUE);
@@ -197,11 +162,6 @@ gimp_tile_backend_tile_manager_command (GeglTileSource *tile_store,
return gimp_tile_read_mul (backend_tm, x, y);
return gimp_tile_read (backend_tm, x, y);
case GEGL_TILE_SET:
- if (backend_tm->priv->write == FALSE)
- {
- g_warning ("writing to a read only geglbuffer");
- return NULL;
- }
if (backend_tm->priv->mul > 1)
gimp_tile_write_mul (backend_tm, x, y, gegl_tile_get_data (data));
else
@@ -237,7 +197,7 @@ gimp_tile_read (GimpTileBackendTileManager *backend_tm,
backend = GEGL_TILE_BACKEND (backend_tm);
gimp_tile = tile_manager_get_at (backend_tm->priv->tile_manager,
- x, y, TRUE, backend_tm->priv->write);
+ x, y, TRUE, TRUE);
if (!gimp_tile)
return NULL;
g_return_val_if_fail (gimp_tile != NULL, NULL);
@@ -252,10 +212,7 @@ gimp_tile_read (GimpTileBackendTileManager *backend_tm,
/* use the GimpTile directly as GEGL tile */
tile = gegl_tile_new_bare ();
gegl_tile_set_data_full (tile, tile_data_pointer (gimp_tile, 0, 0),
- tile_size,
- backend_tm->priv->write?
- tile_done_writing:tile_done,
- gimp_tile);
+ tile_size, tile_done_writing, gimp_tile);
}
else
{
@@ -267,7 +224,7 @@ gimp_tile_read (GimpTileBackendTileManager *backend_tm,
tile_data_pointer (gimp_tile, 0, row),
gimp_tile_stride);
}
- tile_release (gimp_tile, backend_tm->priv->write);
+ tile_release (gimp_tile, TRUE);
}
return tile;
}
@@ -283,8 +240,6 @@ gimp_tile_write (GimpTileBackendTileManager *backend_tm,
gint gimp_tile_stride;
int row;
- g_assert (backend_tm->priv->write);
-
gimp_tile = tile_manager_get_at (backend_tm->priv->tile_manager,
x, y, TRUE, TRUE);
@@ -375,7 +330,6 @@ gimp_tile_write_mul (GimpTileBackendTileManager *backend_tm,
int mul = backend_tm->priv->mul;
void *validate_proc;
- g_assert (backend_tm->priv->write);
x *= mul;
y *= mul;
@@ -399,7 +353,8 @@ gimp_tile_write_mul (GimpTileBackendTileManager *backend_tm,
for (row = 0; row < eheight; row++)
memcpy (tile_data_pointer (gimp_tile, 0, row),
- source + (row + v * TILE_HEIGHT) * tile_stride + u * TILE_WIDTH * bpp,
+ source + (row + v * TILE_HEIGHT) *
+ tile_stride + u * TILE_WIDTH * bpp,
gimp_tile_stride);
tile_release (gimp_tile, TRUE);
@@ -410,8 +365,7 @@ gimp_tile_write_mul (GimpTileBackendTileManager *backend_tm,
GeglTileBackend *
gimp_tile_backend_tile_manager_new (TileManager *tm,
- const Babl *format,
- gboolean write)
+ const Babl *format)
{
GeglTileBackend *ret;
GimpTileBackendTileManager *backend_tm;
@@ -422,8 +376,6 @@ gimp_tile_backend_tile_manager_new (TileManager *tm,
gint mul = gimp_gegl_tile_mul ();
GeglRectangle rect = { 0, 0, width, height };
- write = TRUE;
-
g_return_val_if_fail (format == NULL ||
babl_format_get_bytes_per_pixel (format) ==
babl_format_get_bytes_per_pixel (gimp_bpp_to_babl_format (bpp, TRUE)),
@@ -442,7 +394,6 @@ gimp_tile_backend_tile_manager_new (TileManager *tm,
NULL);
backend_tm = GIMP_TILE_BACKEND_TILE_MANAGER (ret);
- backend_tm->priv->write = write;
backend_tm->priv->mul = mul;
backend_tm->priv->tile_manager = tile_manager_ref (tm);
diff --git a/app/gegl/gimptilebackendtilemanager.h b/app/gegl/gimptilebackendtilemanager.h
index 54b34ae..32633ec 100644
--- a/app/gegl/gimptilebackendtilemanager.h
+++ b/app/gegl/gimptilebackendtilemanager.h
@@ -53,8 +53,7 @@ struct _GimpTileBackendTileManagerClass
GType gimp_tile_backend_tile_manager_get_type (void) G_GNUC_CONST;
GeglTileBackend * gimp_tile_backend_tile_manager_new (TileManager *tm,
- const Babl *format,
- gboolean write);
+ const Babl *format);
TileManager * gimp_tile_backend_tile_manager_get_tiles (GeglTileBackend *backend);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]