[gimp/metadata-browser] app: remove gimp_drawable_get_tiles()
- From: Roman Joost <romanofski src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/metadata-browser] app: remove gimp_drawable_get_tiles()
- Date: Thu, 13 Sep 2012 00:08:06 +0000 (UTC)
commit 140f57d8f0deead14475ffbbe888dfd78c8db8b9
Author: Michael Natterer <mitch gimp org>
Date: Sun May 6 04:39:23 2012 +0200
app: remove gimp_drawable_get_tiles()
app/core/gimpdrawable-combine.c | 29 ++++++++++++++++-----------
app/core/gimpdrawable-foreground-extract.c | 17 ++++++++++++---
app/core/gimpdrawable-preview.c | 14 +++++++++---
app/core/gimpdrawable.c | 19 ++++-------------
app/core/gimpdrawable.h | 2 -
app/core/gimpimage-merge.c | 22 +++++++++++---------
app/display/gimpdisplayshell-render.c | 7 +++++-
7 files changed, 63 insertions(+), 47 deletions(-)
---
diff --git a/app/core/gimpdrawable-combine.c b/app/core/gimpdrawable-combine.c
index fc290fe..ca759e5 100644
--- a/app/core/gimpdrawable-combine.c
+++ b/app/core/gimpdrawable-combine.c
@@ -57,9 +57,10 @@ gimp_drawable_real_apply_buffer (GimpDrawable *drawable,
gint dest_x,
gint dest_y)
{
- GimpItem *item = GIMP_ITEM (drawable);
- GimpImage *image = gimp_item_get_image (item);
- GimpChannel *mask = gimp_image_get_mask (image);
+ GimpItem *item = GIMP_ITEM (drawable);
+ GimpImage *image = gimp_item_get_image (item);
+ GimpChannel *mask = gimp_image_get_mask (image);
+ GeglBuffer *mask_buffer = NULL;
gint x, y, width, height;
gint offset_x, offset_y;
@@ -123,15 +124,14 @@ gimp_drawable_real_apply_buffer (GimpDrawable *drawable,
}
}
+ if (mask)
+ mask_buffer = gimp_drawable_get_buffer (GIMP_DRAWABLE (mask));
+
if (gimp_use_gegl (image->gimp) && ! dest_buffer)
{
- GeglBuffer *mask_buffer = NULL;
GeglNode *apply;
GimpComponentMask affect;
- if (mask)
- mask_buffer = gimp_drawable_get_buffer (GIMP_DRAWABLE (mask));
-
dest_buffer = gimp_drawable_get_buffer (drawable);
affect = gimp_drawable_get_active_mask (drawable);
@@ -211,17 +211,19 @@ gimp_drawable_real_apply_buffer (GimpDrawable *drawable,
}
else
{
- pixel_region_init (&destPR, gimp_drawable_get_tiles (drawable),
+ dest_buffer = gimp_drawable_get_buffer (drawable);
+
+ pixel_region_init (&destPR, gimp_gegl_buffer_get_tiles (dest_buffer),
x, y, width, height,
TRUE);
}
- if (mask)
+ if (mask_buffer)
{
PixelRegion maskPR;
pixel_region_init (&maskPR,
- gimp_drawable_get_tiles (GIMP_DRAWABLE (mask)),
+ gimp_gegl_buffer_get_tiles (mask_buffer),
x + offset_x,
y + offset_y,
width, height,
@@ -265,6 +267,7 @@ gimp_drawable_real_replace_buffer (GimpDrawable *drawable,
GimpItem *item = GIMP_ITEM (drawable);
GimpImage *image = gimp_item_get_image (item);
GimpChannel *mask = gimp_image_get_mask (image);
+ GeglBuffer *drawable_buffer;
GimpTempBuf *temp_buf;
PixelRegion src2PR;
PixelRegion maskPR;
@@ -346,11 +349,13 @@ gimp_drawable_real_replace_buffer (GimpDrawable *drawable,
gimp_drawable_push_undo (drawable, undo_desc,
NULL, x, y, width, height);
+ drawable_buffer = gimp_drawable_get_buffer (drawable);
+
/* configure the pixel regions */
- pixel_region_init (&src1PR, gimp_drawable_get_tiles (drawable),
+ pixel_region_init (&src1PR, gimp_gegl_buffer_get_tiles (drawable_buffer),
x, y, width, height,
FALSE);
- pixel_region_init (&destPR, gimp_drawable_get_tiles (drawable),
+ pixel_region_init (&destPR, gimp_gegl_buffer_get_tiles (drawable_buffer),
x, y, width, height,
TRUE);
pixel_region_resize (&src2PR,
diff --git a/app/core/gimpdrawable-foreground-extract.c b/app/core/gimpdrawable-foreground-extract.c
index 345b512..6c74679 100644
--- a/app/core/gimpdrawable-foreground-extract.c
+++ b/app/core/gimpdrawable-foreground-extract.c
@@ -26,6 +26,8 @@
#include "base/siox.h"
#include "base/tile-manager.h"
+#include "gegl/gimp-gegl-utils.h"
+
#include "gimpchannel.h"
#include "gimpdrawable.h"
#include "gimpdrawable-foreground-extract.h"
@@ -77,6 +79,7 @@ gimp_drawable_foreground_extract_siox_init (GimpDrawable *drawable,
gint width,
gint height)
{
+ GeglBuffer *buffer;
const guchar *colormap = NULL;
gboolean intersect;
gint offset_x;
@@ -104,7 +107,9 @@ gimp_drawable_foreground_extract_siox_init (GimpDrawable *drawable,
if (! intersect)
return NULL;
- return siox_init (gimp_drawable_get_tiles (drawable), colormap,
+ buffer = gimp_drawable_get_buffer (drawable);
+
+ return siox_init (gimp_gegl_buffer_get_tiles (buffer), colormap,
offset_x, offset_y,
x, y, width, height);
}
@@ -118,8 +123,9 @@ gimp_drawable_foreground_extract_siox (GimpDrawable *mask,
gboolean multiblob,
GimpProgress *progress)
{
- gint x1, y1;
- gint x2, y2;
+ GeglBuffer *buffer;
+ gint x1, y1;
+ gint x2, y2;
g_return_if_fail (GIMP_IS_DRAWABLE (mask));
g_return_if_fail (babl_format_get_bytes_per_pixel (gimp_drawable_get_format (mask)) == 1);
@@ -143,8 +149,11 @@ gimp_drawable_foreground_extract_siox (GimpDrawable *mask,
y2 = gimp_item_get_height (GIMP_ITEM (mask));
}
+ buffer = gimp_drawable_get_buffer (mask);
+
siox_foreground_extract (state, refinement,
- gimp_drawable_get_tiles (mask), x1, y1, x2, y2,
+ gimp_gegl_buffer_get_tiles (buffer),
+ x1, y1, x2, y2,
smoothness, sensitivity, multiblob,
(SioxProgressFunc) gimp_progress_set_value,
progress);
diff --git a/app/core/gimpdrawable-preview.c b/app/core/gimpdrawable-preview.c
index 4936196..93a2be7 100644
--- a/app/core/gimpdrawable-preview.c
+++ b/app/core/gimpdrawable-preview.c
@@ -130,8 +130,9 @@ gimp_drawable_get_sub_preview (GimpDrawable *drawable,
gint dest_width,
gint dest_height)
{
- GimpItem *item;
- GimpImage *image;
+ GimpItem *item;
+ GimpImage *image;
+ GeglBuffer *buffer;
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
g_return_val_if_fail (src_x >= 0, NULL);
@@ -159,7 +160,9 @@ gimp_drawable_get_sub_preview (GimpDrawable *drawable,
src_x, src_y, src_width, src_height,
dest_width, dest_height);
- return tile_manager_get_sub_preview (gimp_drawable_get_tiles (drawable),
+ buffer = gimp_drawable_get_buffer (drawable);
+
+ return tile_manager_get_sub_preview (gimp_gegl_buffer_get_tiles (buffer),
gimp_drawable_get_preview_format (drawable),
src_x, src_y, src_width, src_height,
dest_width, dest_height);
@@ -209,6 +212,7 @@ gimp_drawable_indexed_preview (GimpDrawable *drawable,
gint dest_width,
gint dest_height)
{
+ GeglBuffer *buffer;
GimpTempBuf *preview_buf;
PixelRegion srcPR;
PixelRegion destPR;
@@ -219,7 +223,9 @@ gimp_drawable_indexed_preview (GimpDrawable *drawable,
(dest_height * (subsample + 1) * 2 < src_width))
subsample += 1;
- pixel_region_init (&srcPR, gimp_drawable_get_tiles (drawable),
+ buffer = gimp_drawable_get_buffer (drawable);
+
+ pixel_region_init (&srcPR, gimp_gegl_buffer_get_tiles (buffer),
src_x, src_y, src_width, src_height,
FALSE);
diff --git a/app/core/gimpdrawable.c b/app/core/gimpdrawable.c
index 7c48f70..5e9dbfb 100644
--- a/app/core/gimpdrawable.c
+++ b/app/core/gimpdrawable.c
@@ -1277,7 +1277,8 @@ gimp_drawable_init_src_region (GimpDrawable *drawable,
gint height,
GeglBuffer **temp_buffer)
{
- GimpLayer *fs;
+ GeglBuffer *buffer;
+ GimpLayer *fs;
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
g_return_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)));
@@ -1362,7 +1363,9 @@ gimp_drawable_init_src_region (GimpDrawable *drawable,
}
}
- pixel_region_init (srcPR, gimp_drawable_get_tiles (drawable),
+ buffer = gimp_drawable_get_buffer (drawable);
+
+ pixel_region_init (srcPR, gimp_gegl_buffer_get_tiles (buffer),
x, y, width, height,
FALSE);
*temp_buffer = NULL;
@@ -1376,18 +1379,6 @@ gimp_drawable_get_buffer (GimpDrawable *drawable)
return GIMP_DRAWABLE_GET_CLASS (drawable)->get_buffer (drawable);
}
-TileManager *
-gimp_drawable_get_tiles (GimpDrawable *drawable)
-{
- GeglBuffer *buffer;
-
- g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
-
- buffer = gimp_drawable_get_buffer (drawable);
-
- return gimp_gegl_buffer_get_tiles (buffer);
-}
-
void
gimp_drawable_set_buffer (GimpDrawable *drawable,
gboolean push_undo,
diff --git a/app/core/gimpdrawable.h b/app/core/gimpdrawable.h
index be8d039..ebeb35f 100644
--- a/app/core/gimpdrawable.h
+++ b/app/core/gimpdrawable.h
@@ -199,8 +199,6 @@ void gimp_drawable_set_buffer_full (GimpDrawable *drawable,
gint offset_x,
gint offset_y);
-TileManager * gimp_drawable_get_tiles (GimpDrawable *drawable);
-
GeglNode * gimp_drawable_get_source_node (GimpDrawable *drawable);
GeglNode * gimp_drawable_get_mode_node (GimpDrawable *drawable);
diff --git a/app/core/gimpimage-merge.c b/app/core/gimpimage-merge.c
index 84513cf..54f5caf 100644
--- a/app/core/gimpimage-merge.c
+++ b/app/core/gimpimage-merge.c
@@ -595,8 +595,10 @@ gimp_image_merge_layers (GimpImage *image,
for (layers = reverse_list; layers; layers = g_slist_next (layers))
{
- GimpLayerModeEffects mode;
- gint x3, y3, x4, y4;
+ GeglBuffer *merge_buffer;
+ GeglBuffer *layer_buffer;
+ GimpLayerModeEffects mode;
+ gint x3, y3, x4, y4;
layer = layers->data;
@@ -615,16 +617,14 @@ gimp_image_merge_layers (GimpImage *image,
if (layer == bottom_layer && mode != GIMP_DISSOLVE_MODE)
mode = GIMP_NORMAL_MODE;
+ merge_buffer = gimp_drawable_get_buffer (GIMP_DRAWABLE (merge_layer));
+ layer_buffer = gimp_drawable_get_buffer (GIMP_DRAWABLE (layer));
+
if (gimp_use_gegl (image->gimp))
{
- GeglBuffer *merge_buffer;
- GeglBuffer *layer_buffer;
GeglBuffer *mask_buffer = NULL;
GeglNode *apply;
- merge_buffer = gimp_drawable_get_buffer (GIMP_DRAWABLE (merge_layer));
- layer_buffer = gimp_drawable_get_buffer (GIMP_DRAWABLE (layer));
-
if (gimp_layer_get_mask (layer) &&
gimp_layer_get_apply_mask (layer))
{
@@ -682,11 +682,11 @@ gimp_image_merge_layers (GimpImage *image,
/* configure the pixel regions */
pixel_region_init (&src1PR,
- gimp_drawable_get_tiles (GIMP_DRAWABLE (merge_layer)),
+ gimp_gegl_buffer_get_tiles (merge_buffer),
(x3 - x1), (y3 - y1), (x4 - x3), (y4 - y3),
TRUE);
pixel_region_init (&src2PR,
- gimp_drawable_get_tiles (GIMP_DRAWABLE (layer)),
+ gimp_gegl_buffer_get_tiles (layer_buffer),
(x3 - off_x), (y3 - off_y),
(x4 - x3), (y4 - y3),
FALSE);
@@ -694,9 +694,11 @@ gimp_image_merge_layers (GimpImage *image,
if (gimp_layer_get_mask (layer) &&
gimp_layer_get_apply_mask (layer))
{
+ GeglBuffer *buffer;
TileManager *tiles;
- tiles = gimp_drawable_get_tiles (GIMP_DRAWABLE (layer->mask));
+ buffer = gimp_drawable_get_buffer (GIMP_DRAWABLE (layer->mask));
+ tiles = gimp_gegl_buffer_get_tiles (buffer);
pixel_region_init (&maskPR, tiles,
(x3 - off_x), (y3 - off_y), (x4 - x3), (y4 - y3),
diff --git a/app/display/gimpdisplayshell-render.c b/app/display/gimpdisplayshell-render.c
index cca8878..841f2e0 100644
--- a/app/display/gimpdisplayshell-render.c
+++ b/app/display/gimpdisplayshell-render.c
@@ -30,6 +30,8 @@
#include "config/gimpdisplayconfig.h"
+#include "gegl/gimp-gegl-utils.h"
+
#include "core/gimpdrawable.h"
#include "core/gimpimage.h"
#include "core/gimppickable.h"
@@ -183,6 +185,8 @@ gimp_display_shell_render (GimpDisplayShell *shell,
if (shell->mask)
{
+ GeglBuffer *buffer;
+
if (! shell->mask_surface)
{
shell->mask_surface =
@@ -191,7 +195,8 @@ gimp_display_shell_render (GimpDisplayShell *shell,
GIMP_DISPLAY_RENDER_BUF_HEIGHT);
}
- tiles = gimp_drawable_get_tiles (shell->mask);
+ buffer = gimp_drawable_get_buffer (shell->mask);
+ tiles = gimp_gegl_buffer_get_tiles (buffer);
/* The mask does not (yet) have an image pyramid, use 0 as level, */
gimp_display_shell_render_info_init (&info,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]