[gimp/goat-invasion: 466/526] app: make GimpTempBuf reference counted
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/goat-invasion: 466/526] app: make GimpTempBuf reference counted
- Date: Sun, 22 Apr 2012 13:38:25 +0000 (UTC)
commit 79965db4eaea7cedb6b972cd01cf38a4b413a439
Author: Michael Natterer <mitch gimp org>
Date: Mon Apr 9 00:16:46 2012 +0200
app: make GimpTempBuf reference counted
and remove the "take_ownership" parameter from
gimp_temp_buf_create_buffer(), simply always ref the buf.
app/base/temp-buf.c | 44 +++++++++++++++++++++-----------
app/base/temp-buf.h | 8 +++--
app/core/gimpbrush-boundary.c | 2 +-
app/core/gimpbrush-transform.c | 12 ++++++---
app/core/gimpbrush.c | 17 ++++++------
app/core/gimpbrushclipboard.c | 8 +++---
app/core/gimpbrushgenerated.c | 2 +-
app/core/gimpimage-preview.c | 2 +-
app/core/gimpimage.c | 4 +-
app/core/gimppattern-load.c | 2 +-
app/core/gimppattern.c | 8 +++---
app/core/gimppatternclipboard.c | 2 +-
app/core/gimppreviewcache.c | 4 +-
app/core/gimpundo.c | 4 +-
app/core/gimpviewable.c | 8 +++---
app/paint/gimpbrushcore.c | 20 ++++++++------
app/paint/gimpconvolve.c | 4 +-
app/paint/gimpheal.c | 2 +-
app/paint/gimpink.c | 4 ++-
app/paint/gimpsmudge.c | 4 +-
app/pdb/drawable-cmds.c | 4 +-
app/pdb/image-cmds.c | 2 +-
app/tools/gimpiscissorstool.c | 4 +-
app/widgets/gimpviewrendererbrush.c | 6 ++--
app/widgets/gimpviewrendererbuffer.c | 4 +-
app/widgets/gimpviewrendererdrawable.c | 4 +-
app/widgets/gimpviewrendererimage.c | 6 ++--
tools/pdbgen/pdb/drawable.pdb | 4 +-
tools/pdbgen/pdb/image.pdb | 2 +-
29 files changed, 111 insertions(+), 86 deletions(-)
---
diff --git a/app/base/temp-buf.c b/app/base/temp-buf.c
index 6cc9dc0..435135e 100644
--- a/app/base/temp-buf.c
+++ b/app/base/temp-buf.c
@@ -44,11 +44,12 @@ gimp_temp_buf_new (gint width,
temp = g_slice_new (GimpTempBuf);
- temp->format = format;
- temp->width = width;
- temp->height = height;
- temp->x = 0;
- temp->y = 0;
+ temp->ref_count = 1;
+ temp->format = format;
+ temp->width = width;
+ temp->height = height;
+ temp->x = 0;
+ temp->y = 0;
temp->data = g_new (guchar,
width * height *
@@ -73,15 +74,31 @@ gimp_temp_buf_copy (GimpTempBuf *src)
return dest;
}
+GimpTempBuf *
+gimp_temp_buf_ref (GimpTempBuf *buf)
+{
+ g_return_val_if_fail (buf != NULL, NULL);
+
+ buf->ref_count++;
+
+ return buf;
+}
+
void
-gimp_temp_buf_free (GimpTempBuf *buf)
+gimp_temp_buf_unref (GimpTempBuf *buf)
{
g_return_if_fail (buf != NULL);
+ g_return_if_fail (buf->ref_count > 0);
+
+ buf->ref_count--;
- if (buf->data)
- g_free (buf->data);
+ if (buf->ref_count < 1)
+ {
+ if (buf->data)
+ g_free (buf->data);
- g_slice_free (GimpTempBuf, buf);
+ g_slice_free (GimpTempBuf, buf);
+ }
}
GimpTempBuf *
@@ -218,8 +235,7 @@ gimp_temp_buf_get_memsize (GimpTempBuf *buf)
}
GeglBuffer *
-gimp_temp_buf_create_buffer (GimpTempBuf *temp_buf,
- gboolean take_ownership)
+gimp_temp_buf_create_buffer (GimpTempBuf *temp_buf)
{
GeglBuffer *buffer;
@@ -232,10 +248,8 @@ gimp_temp_buf_create_buffer (GimpTempBuf *temp_buf,
temp_buf->width,
temp_buf->height),
GEGL_AUTO_ROWSTRIDE,
- take_ownership ?
- (GDestroyNotify) gimp_temp_buf_free : NULL,
- take_ownership ?
- temp_buf : NULL);
+ (GDestroyNotify) gimp_temp_buf_unref,
+ gimp_temp_buf_ref (temp_buf));
g_object_set_data (G_OBJECT (buffer), "gimp-temp-buf", temp_buf);
diff --git a/app/base/temp-buf.h b/app/base/temp-buf.h
index a7757c2..fe3b072 100644
--- a/app/base/temp-buf.h
+++ b/app/base/temp-buf.h
@@ -21,6 +21,7 @@
struct _GimpTempBuf
{
+ gint ref_count;
const Babl *format; /* pixel format */
gint width;
gint height;
@@ -36,7 +37,9 @@ GimpTempBuf * gimp_temp_buf_new (gint width,
gint height,
const Babl *fomat) G_GNUC_WARN_UNUSED_RESULT;
GimpTempBuf * gimp_temp_buf_copy (GimpTempBuf *src) G_GNUC_WARN_UNUSED_RESULT;
-void gimp_temp_buf_free (GimpTempBuf *buf);
+
+GimpTempBuf * gimp_temp_buf_ref (GimpTempBuf *buf);
+void gimp_temp_buf_unref (GimpTempBuf *buf);
GimpTempBuf * gimp_temp_buf_scale (GimpTempBuf *buf,
gint width,
@@ -50,8 +53,7 @@ guchar * gimp_temp_buf_data_clear (GimpTempBuf *buf);
gsize gimp_temp_buf_get_memsize (GimpTempBuf *buf);
-GeglBuffer * gimp_temp_buf_create_buffer (GimpTempBuf *temp_buf,
- gboolean take_ownership) G_GNUC_WARN_UNUSED_RESULT;
+GeglBuffer * gimp_temp_buf_create_buffer (GimpTempBuf *temp_buf) G_GNUC_WARN_UNUSED_RESULT;
#endif /* __GIMP_TEMP_BUF_H__ */
diff --git a/app/core/gimpbrush-boundary.c b/app/core/gimpbrush-boundary.c
index 2be0450..c45f890 100644
--- a/app/core/gimpbrush-boundary.c
+++ b/app/core/gimpbrush-boundary.c
@@ -48,7 +48,7 @@ gimp_brush_transform_boundary_exact (GimpBrush *brush,
GimpBoundSeg *bound_segs;
gint n_bound_segs;
- buffer = gimp_temp_buf_create_buffer ((GimpTempBuf *) mask, FALSE);
+ buffer = gimp_temp_buf_create_buffer ((GimpTempBuf *) mask);
bound_segs = gimp_boundary_find (buffer, NULL,
GIMP_BOUNDARY_WITHIN_BOUNDS,
diff --git a/app/core/gimpbrush-transform.c b/app/core/gimpbrush-transform.c
index 8ea182a..37c39ab 100644
--- a/app/core/gimpbrush-transform.c
+++ b/app/core/gimpbrush-transform.c
@@ -342,8 +342,10 @@ gimp_brush_real_transform_mask (GimpBrush *brush,
blur_src = gimp_temp_buf_copy (result);
- src_buffer = gimp_temp_buf_create_buffer (blur_src, TRUE);
- dest_buffer = gimp_temp_buf_create_buffer (blur_src, FALSE);
+ src_buffer = gimp_temp_buf_create_buffer (blur_src);
+ dest_buffer = gimp_temp_buf_create_buffer (result);
+
+ gimp_temp_buf_unref (blur_src);
gimp_gegl_convolve (src_buffer,
GEGL_RECTANGLE (0, 0,
@@ -643,8 +645,10 @@ gimp_brush_real_transform_pixmap (GimpBrush *brush,
blur_src = gimp_temp_buf_copy (result);
- src_buffer = gimp_temp_buf_create_buffer (blur_src, TRUE);
- dest_buffer = gimp_temp_buf_create_buffer (blur_src, FALSE);
+ src_buffer = gimp_temp_buf_create_buffer (blur_src);
+ dest_buffer = gimp_temp_buf_create_buffer (result);
+
+ gimp_temp_buf_unref (blur_src);
gimp_gegl_convolve (src_buffer,
GEGL_RECTANGLE (0, 0,
diff --git a/app/core/gimpbrush.c b/app/core/gimpbrush.c
index b21b7bc..b5f42a0 100644
--- a/app/core/gimpbrush.c
+++ b/app/core/gimpbrush.c
@@ -177,13 +177,13 @@ gimp_brush_finalize (GObject *object)
if (brush->mask)
{
- gimp_temp_buf_free (brush->mask);
+ gimp_temp_buf_unref (brush->mask);
brush->mask = NULL;
}
if (brush->pixmap)
{
- gimp_temp_buf_free (brush->pixmap);
+ gimp_temp_buf_unref (brush->pixmap);
brush->pixmap = NULL;
}
@@ -283,7 +283,6 @@ gimp_brush_get_new_preview (GimpViewable *viewable,
{
GimpBrush *brush = GIMP_BRUSH (viewable);
const GimpTempBuf *mask_buf = NULL;
- gboolean free_mask = FALSE;
const GimpTempBuf *pixmap_buf = NULL;
GimpTempBuf *return_buf = NULL;
gint mask_width;
@@ -316,7 +315,10 @@ gimp_brush_get_new_preview (GimpViewable *viewable,
{
mask_buf = gimp_temp_buf_new (1, 1, babl_format ("Y u8"));
gimp_temp_buf_data_clear ((GimpTempBuf *) mask_buf);
- free_mask = TRUE;
+ }
+ else
+ {
+ gimp_temp_buf_ref ((GimpTempBuf *) mask_buf);
}
if (pixmap_buf)
@@ -368,8 +370,7 @@ gimp_brush_get_new_preview (GimpViewable *viewable,
if (scaled)
{
- if (free_mask)
- gimp_temp_buf_free ((GimpTempBuf *) mask_buf);
+ gimp_temp_buf_unref ((GimpTempBuf *) mask_buf);
gimp_brush_end_use (brush);
}
@@ -416,10 +417,10 @@ static void
gimp_brush_real_begin_use (GimpBrush *brush)
{
brush->mask_cache =
- gimp_brush_cache_new ((GDestroyNotify) gimp_temp_buf_free, 'M', 'm');
+ gimp_brush_cache_new ((GDestroyNotify) gimp_temp_buf_unref, 'M', 'm');
brush->pixmap_cache =
- gimp_brush_cache_new ((GDestroyNotify) gimp_temp_buf_free, 'P', 'p');
+ gimp_brush_cache_new ((GDestroyNotify) gimp_temp_buf_unref, 'P', 'p');
brush->boundary_cache =
gimp_brush_cache_new ((GDestroyNotify) gimp_bezier_desc_free, 'B', 'b');
diff --git a/app/core/gimpbrushclipboard.c b/app/core/gimpbrushclipboard.c
index 379ffac..179d145 100644
--- a/app/core/gimpbrushclipboard.c
+++ b/app/core/gimpbrushclipboard.c
@@ -184,13 +184,13 @@ gimp_brush_clipboard_buffer_changed (Gimp *gimp,
if (brush->mask)
{
- gimp_temp_buf_free (brush->mask);
+ gimp_temp_buf_unref (brush->mask);
brush->mask = NULL;
}
if (brush->pixmap)
{
- gimp_temp_buf_free (brush->pixmap);
+ gimp_temp_buf_unref (brush->pixmap);
brush->pixmap = NULL;
}
@@ -211,7 +211,7 @@ gimp_brush_clipboard_buffer_changed (Gimp *gimp,
/* copy the alpha channel into the brush's mask */
if (babl_format_has_alpha (format))
{
- dest_buffer = gimp_temp_buf_create_buffer (brush->mask, FALSE);
+ dest_buffer = gimp_temp_buf_create_buffer (brush->mask);
gegl_buffer_set_format (dest_buffer, babl_format ("A u8"));
gegl_buffer_copy (buffer, NULL, dest_buffer, NULL);
@@ -225,7 +225,7 @@ gimp_brush_clipboard_buffer_changed (Gimp *gimp,
}
/* copy the color channels into the brush's pixmap */
- dest_buffer = gimp_temp_buf_create_buffer (brush->pixmap, FALSE);
+ dest_buffer = gimp_temp_buf_create_buffer (brush->pixmap);
gegl_buffer_copy (buffer, NULL, dest_buffer, NULL);
diff --git a/app/core/gimpbrushgenerated.c b/app/core/gimpbrushgenerated.c
index 63cb963..99b1c4f 100644
--- a/app/core/gimpbrushgenerated.c
+++ b/app/core/gimpbrushgenerated.c
@@ -254,7 +254,7 @@ gimp_brush_generated_dirty (GimpData *data)
GimpBrush *gbrush = GIMP_BRUSH (brush);
if (gbrush->mask)
- gimp_temp_buf_free (gbrush->mask);
+ gimp_temp_buf_unref (gbrush->mask);
gbrush->mask = gimp_brush_generated_calc (brush,
brush->shape,
diff --git a/app/core/gimpimage-preview.c b/app/core/gimpimage-preview.c
index 4489e49..ae924c8 100644
--- a/app/core/gimpimage-preview.c
+++ b/app/core/gimpimage-preview.c
@@ -111,7 +111,7 @@ gimp_image_get_preview (GimpViewable *viewable,
{
/* The hard way */
if (private->preview)
- gimp_temp_buf_free (private->preview);
+ gimp_temp_buf_unref (private->preview);
private->preview = gimp_image_get_new_preview (viewable, context,
width, height);
diff --git a/app/core/gimpimage.c b/app/core/gimpimage.c
index 29febcd..14e6657 100644
--- a/app/core/gimpimage.c
+++ b/app/core/gimpimage.c
@@ -945,7 +945,7 @@ gimp_image_finalize (GObject *object)
if (private->preview)
{
- gimp_temp_buf_free (private->preview);
+ gimp_temp_buf_unref (private->preview);
private->preview = NULL;
}
@@ -1098,7 +1098,7 @@ gimp_image_invalidate_preview (GimpViewable *viewable)
if (private->preview)
{
- gimp_temp_buf_free (private->preview);
+ gimp_temp_buf_unref (private->preview);
private->preview = NULL;
}
}
diff --git a/app/core/gimppattern-load.c b/app/core/gimppattern-load.c
index 48bb0c2..8d6fddb 100644
--- a/app/core/gimppattern-load.c
+++ b/app/core/gimppattern-load.c
@@ -223,7 +223,7 @@ gimp_pattern_load_pixbuf (GimpContext *context,
gimp_bpp_to_babl_format (gdk_pixbuf_get_n_channels (pixbuf)));
src_buffer = gimp_pixbuf_create_buffer (pixbuf);
- dest_buffer = gimp_temp_buf_create_buffer (pattern->mask, FALSE);
+ dest_buffer = gimp_temp_buf_create_buffer (pattern->mask);
gegl_buffer_copy (src_buffer, NULL, dest_buffer, NULL);
diff --git a/app/core/gimppattern.c b/app/core/gimppattern.c
index 86b59d8..4838391 100644
--- a/app/core/gimppattern.c
+++ b/app/core/gimppattern.c
@@ -105,7 +105,7 @@ gimp_pattern_finalize (GObject *object)
if (pattern->mask)
{
- gimp_temp_buf_free (pattern->mask);
+ gimp_temp_buf_unref (pattern->mask);
pattern->mask = NULL;
}
@@ -157,8 +157,8 @@ gimp_pattern_get_new_preview (GimpViewable *viewable,
temp_buf = gimp_temp_buf_new (copy_width, copy_height,
pattern->mask->format);
- src_buffer = gimp_temp_buf_create_buffer (pattern->mask, FALSE);
- dest_buffer = gimp_temp_buf_create_buffer (temp_buf, FALSE);
+ src_buffer = gimp_temp_buf_create_buffer (pattern->mask);
+ dest_buffer = gimp_temp_buf_create_buffer (temp_buf);
gegl_buffer_copy (src_buffer, GEGL_RECTANGLE (0, 0, copy_width, copy_height),
dest_buffer, GEGL_RECTANGLE (0, 0, 0, 0));
@@ -279,5 +279,5 @@ gimp_pattern_create_buffer (const GimpPattern *pattern)
{
g_return_val_if_fail (GIMP_IS_PATTERN (pattern), NULL);
- return gimp_temp_buf_create_buffer (pattern->mask, FALSE);
+ return gimp_temp_buf_create_buffer (pattern->mask);
}
diff --git a/app/core/gimppatternclipboard.c b/app/core/gimppatternclipboard.c
index 8ced5bc..800c577 100644
--- a/app/core/gimppatternclipboard.c
+++ b/app/core/gimppatternclipboard.c
@@ -182,7 +182,7 @@ gimp_pattern_clipboard_buffer_changed (Gimp *gimp,
{
if (pattern->mask)
{
- gimp_temp_buf_free (pattern->mask);
+ gimp_temp_buf_unref (pattern->mask);
pattern->mask = NULL;
}
diff --git a/app/core/gimppreviewcache.c b/app/core/gimppreviewcache.c
index 622ed93..43734cc 100644
--- a/app/core/gimppreviewcache.c
+++ b/app/core/gimppreviewcache.c
@@ -126,7 +126,7 @@ preview_cache_remove_smallest (GSList **plist)
smallest->width, smallest->height);
#endif
- gimp_temp_buf_free (smallest);
+ gimp_temp_buf_unref (smallest);
}
}
@@ -155,7 +155,7 @@ gimp_preview_cache_invalidate (GSList **plist)
preview_cache_print (*plist);
#endif
- g_slist_free_full (*plist, (GDestroyNotify) gimp_temp_buf_free);
+ g_slist_free_full (*plist, (GDestroyNotify) gimp_temp_buf_unref);
*plist = NULL;
}
diff --git a/app/core/gimpundo.c b/app/core/gimpundo.c
index af7d2f6..59de0d9 100644
--- a/app/core/gimpundo.c
+++ b/app/core/gimpundo.c
@@ -199,7 +199,7 @@ gimp_undo_finalize (GObject *object)
if (undo->preview)
{
- gimp_temp_buf_free (undo->preview);
+ gimp_temp_buf_unref (undo->preview);
undo->preview = NULL;
}
@@ -511,7 +511,7 @@ gimp_undo_refresh_preview (GimpUndo *undo,
if (undo->preview)
{
- gimp_temp_buf_free (undo->preview);
+ gimp_temp_buf_unref (undo->preview);
undo->preview = NULL;
gimp_undo_create_preview (undo, context, FALSE);
}
diff --git a/app/core/gimpviewable.c b/app/core/gimpviewable.c
index 2b722a7..aaedcef 100644
--- a/app/core/gimpviewable.c
+++ b/app/core/gimpviewable.c
@@ -211,7 +211,7 @@ gimp_viewable_finalize (GObject *object)
if (private->preview_temp_buf)
{
- gimp_temp_buf_free (private->preview_temp_buf);
+ gimp_temp_buf_unref (private->preview_temp_buf);
private->preview_temp_buf = NULL;
}
@@ -295,7 +295,7 @@ gimp_viewable_real_invalidate_preview (GimpViewable *viewable)
if (private->preview_temp_buf)
{
- gimp_temp_buf_free (private->preview_temp_buf);
+ gimp_temp_buf_unref (private->preview_temp_buf);
private->preview_temp_buf = NULL;
}
@@ -364,7 +364,7 @@ gimp_viewable_real_get_new_pixbuf (GimpViewable *viewable,
temp_buf->width,
temp_buf->height);
- src_buffer = gimp_temp_buf_create_buffer (temp_buf, FALSE);
+ src_buffer = gimp_temp_buf_create_buffer (temp_buf);
dest_buffer = gimp_pixbuf_create_buffer (pixbuf);
gegl_buffer_copy (src_buffer, NULL, dest_buffer, NULL);
@@ -716,7 +716,7 @@ gimp_viewable_get_preview (GimpViewable *viewable,
return private->preview_temp_buf;
}
- gimp_temp_buf_free (private->preview_temp_buf);
+ gimp_temp_buf_unref (private->preview_temp_buf);
private->preview_temp_buf = NULL;
}
diff --git a/app/paint/gimpbrushcore.c b/app/paint/gimpbrushcore.c
index 08eedc6..a1761d1 100644
--- a/app/paint/gimpbrushcore.c
+++ b/app/paint/gimpbrushcore.c
@@ -243,7 +243,7 @@ gimp_brush_core_finalize (GObject *object)
if (core->pressure_brush)
{
- gimp_temp_buf_free (core->pressure_brush);
+ gimp_temp_buf_unref (core->pressure_brush);
core->pressure_brush = NULL;
}
@@ -251,7 +251,7 @@ gimp_brush_core_finalize (GObject *object)
for (j = 0; j < BRUSH_CORE_SOLID_SUBSAMPLE; j++)
if (core->solid_brushes[i][j])
{
- gimp_temp_buf_free (core->solid_brushes[i][j]);
+ gimp_temp_buf_unref (core->solid_brushes[i][j]);
core->solid_brushes[i][j] = NULL;
}
@@ -265,7 +265,7 @@ gimp_brush_core_finalize (GObject *object)
for (j = 0; j < KERNEL_SUBSAMPLE + 1; j++)
if (core->subsample_brushes[i][j])
{
- gimp_temp_buf_free (core->subsample_brushes[i][j]);
+ gimp_temp_buf_unref (core->subsample_brushes[i][j]);
core->subsample_brushes[i][j] = NULL;
}
@@ -843,7 +843,9 @@ gimp_brush_core_get_paint_buffer (GimpPaintCore *paint_core,
if (paint_core->paint_buffer)
g_object_unref (paint_core->paint_buffer);
- paint_core->paint_buffer = gimp_temp_buf_create_buffer (temp_buf, TRUE);
+ paint_core->paint_buffer = gimp_temp_buf_create_buffer (temp_buf);
+
+ gimp_temp_buf_unref (temp_buf);
return paint_core->paint_buffer;
}
@@ -950,7 +952,7 @@ gimp_brush_core_paste_canvas (GimpBrushCore *core,
off_x = (x < 0) ? -x : 0;
off_y = (y < 0) ? -y : 0;
- paint_mask = gimp_temp_buf_create_buffer ((GimpTempBuf *) brush_mask, FALSE);
+ paint_mask = gimp_temp_buf_create_buffer ((GimpTempBuf *) brush_mask);
gimp_paint_core_paste (paint_core, paint_mask,
GEGL_RECTANGLE (off_x, off_y,
@@ -1000,7 +1002,7 @@ gimp_brush_core_replace_canvas (GimpBrushCore *core,
off_x = (x < 0) ? -x : 0;
off_y = (y < 0) ? -y : 0;
- paint_mask = gimp_temp_buf_create_buffer ((GimpTempBuf *) brush_mask, FALSE);
+ paint_mask = gimp_temp_buf_create_buffer ((GimpTempBuf *) brush_mask);
gimp_paint_core_replace (paint_core, paint_mask,
GEGL_RECTANGLE (off_x, off_y,
@@ -1119,7 +1121,7 @@ gimp_brush_core_subsample_mask (GimpBrushCore *core,
for (j = 0; j < KERNEL_SUBSAMPLE + 1; j++)
if (core->subsample_brushes[i][j])
{
- gimp_temp_buf_free (core->subsample_brushes[i][j]);
+ gimp_temp_buf_unref (core->subsample_brushes[i][j]);
core->subsample_brushes[i][j] = NULL;
}
@@ -1206,7 +1208,7 @@ gimp_brush_core_pressurize_mask (GimpBrushCore *core,
return subsample_mask;
if (core->pressure_brush)
- gimp_temp_buf_free (core->pressure_brush);
+ gimp_temp_buf_unref (core->pressure_brush);
core->pressure_brush = gimp_temp_buf_new (brush_mask->width + 2,
brush_mask->height + 2,
@@ -1341,7 +1343,7 @@ gimp_brush_core_solidify_mask (GimpBrushCore *core,
for (j = 0; j < BRUSH_CORE_SOLID_SUBSAMPLE; j++)
if (core->solid_brushes[i][j])
{
- gimp_temp_buf_free (core->solid_brushes[i][j]);
+ gimp_temp_buf_unref (core->solid_brushes[i][j]);
core->solid_brushes[i][j] = NULL;
}
diff --git a/app/paint/gimpconvolve.c b/app/paint/gimpconvolve.c
index d0b7731..7fcb6bf 100644
--- a/app/paint/gimpconvolve.c
+++ b/app/paint/gimpconvolve.c
@@ -184,8 +184,8 @@ gimp_convolve_motion (GimpPaintCore *paint_core,
convolve_temp = gimp_temp_buf_new (gegl_buffer_get_width (paint_buffer),
gegl_buffer_get_height (paint_buffer),
gegl_buffer_get_format (paint_buffer));
-
- convolve_buffer = gimp_temp_buf_create_buffer (convolve_temp, TRUE);
+ convolve_buffer = gimp_temp_buf_create_buffer (convolve_temp);
+ gimp_temp_buf_unref (convolve_temp);
gegl_buffer_copy (gimp_drawable_get_buffer (drawable),
GEGL_RECTANGLE (paint_buffer_x,
diff --git a/app/paint/gimpheal.c b/app/paint/gimpheal.c
index 60cda95..ba1414c 100644
--- a/app/paint/gimpheal.c
+++ b/app/paint/gimpheal.c
@@ -539,7 +539,7 @@ gimp_heal_motion (GimpSourceCore *source_core,
paint_area_width,
paint_area_height));
- mask_buffer = gimp_temp_buf_create_buffer ((GimpTempBuf *) mask_buf, FALSE);
+ mask_buffer = gimp_temp_buf_create_buffer ((GimpTempBuf *) mask_buf);
gimp_heal (src_copy,
GEGL_RECTANGLE (0, 0,
diff --git a/app/paint/gimpink.c b/app/paint/gimpink.c
index 39a88fb..dd86d4f 100644
--- a/app/paint/gimpink.c
+++ b/app/paint/gimpink.c
@@ -231,7 +231,9 @@ gimp_ink_get_paint_buffer (GimpPaintCore *paint_core,
if (paint_core->paint_buffer)
g_object_unref (paint_core->paint_buffer);
- paint_core->paint_buffer = gimp_temp_buf_create_buffer (temp_buf, TRUE);
+ paint_core->paint_buffer = gimp_temp_buf_create_buffer (temp_buf);
+
+ gimp_temp_buf_unref (temp_buf);
return paint_core->paint_buffer;
}
diff --git a/app/paint/gimpsmudge.c b/app/paint/gimpsmudge.c
index cb818dc..309b56f 100644
--- a/app/paint/gimpsmudge.c
+++ b/app/paint/gimpsmudge.c
@@ -187,8 +187,8 @@ gimp_smudge_start (GimpPaintCore *paint_core,
/* Allocate the accumulation buffer */
accum_temp = gimp_temp_buf_new (accum_size, accum_size,
gimp_drawable_get_format (drawable));
-
- smudge->accum_buffer = gimp_temp_buf_create_buffer (accum_temp, TRUE);
+ smudge->accum_buffer = gimp_temp_buf_create_buffer (accum_temp);
+ gimp_temp_buf_unref (accum_temp);
/* adjust the x and y coordinates to the upper left corner of the
* accumulator
diff --git a/app/pdb/drawable-cmds.c b/app/pdb/drawable-cmds.c
index 67e148f..7137c57 100644
--- a/app/pdb/drawable-cmds.c
+++ b/app/pdb/drawable-cmds.c
@@ -752,7 +752,7 @@ drawable_thumbnail_invoker (GimpProcedure *procedure,
thumbnail_data = g_memdup (gimp_temp_buf_get_data (buf),
thumbnail_data_count);
- gimp_temp_buf_free (buf);
+ gimp_temp_buf_unref (buf);
}
else
success = FALSE;
@@ -832,7 +832,7 @@ drawable_sub_thumbnail_invoker (GimpProcedure *procedure,
thumbnail_data = g_memdup (gimp_temp_buf_get_data (buf),
thumbnail_data_count);
- gimp_temp_buf_free (buf);
+ gimp_temp_buf_unref (buf);
}
else
success = FALSE;
diff --git a/app/pdb/image-cmds.c b/app/pdb/image-cmds.c
index 3ce4c3c..1438b64 100644
--- a/app/pdb/image-cmds.c
+++ b/app/pdb/image-cmds.c
@@ -1719,7 +1719,7 @@ image_thumbnail_invoker (GimpProcedure *procedure,
thumbnail_data = g_memdup (gimp_temp_buf_get_data (buf),
thumbnail_data_count);
- gimp_temp_buf_free (buf);
+ gimp_temp_buf_unref (buf);
}
else
success = FALSE;
diff --git a/app/tools/gimpiscissorstool.c b/app/tools/gimpiscissorstool.c
index 6814a5f..e2a72c6 100644
--- a/app/tools/gimpiscissorstool.c
+++ b/app/tools/gimpiscissorstool.c
@@ -401,7 +401,7 @@ gimp_iscissors_tool_control (GimpTool *tool,
/* Reset the dp buffers */
if (iscissors->dp_buf)
{
- gimp_temp_buf_free (iscissors->dp_buf);
+ gimp_temp_buf_unref (iscissors->dp_buf);
iscissors->dp_buf = NULL;
}
break;
@@ -1336,7 +1336,7 @@ calculate_curve (GimpIscissorsTool *iscissors,
/* allocate the dynamic programming array */
if (iscissors->dp_buf)
- gimp_temp_buf_free (iscissors->dp_buf);
+ gimp_temp_buf_unref (iscissors->dp_buf);
iscissors->dp_buf = gimp_temp_buf_new (width, height,
babl_format ("Y u32"));
diff --git a/app/widgets/gimpviewrendererbrush.c b/app/widgets/gimpviewrendererbrush.c
index 7a84d62..467c960 100644
--- a/app/widgets/gimpviewrendererbrush.c
+++ b/app/widgets/gimpviewrendererbrush.c
@@ -114,7 +114,7 @@ gimp_view_renderer_brush_render (GimpViewRenderer *renderer,
GIMP_VIEW_BG_WHITE,
GIMP_VIEW_BG_WHITE);
- gimp_temp_buf_free (temp_buf);
+ gimp_temp_buf_unref (temp_buf);
if (GIMP_IS_BRUSH_PIPE (renderer->viewable))
{
@@ -131,7 +131,7 @@ gimp_view_renderer_brush_render (GimpViewRenderer *renderer,
GIMP_VIEW_BG_WHITE,
GIMP_VIEW_BG_WHITE);
- gimp_temp_buf_free (temp_buf);
+ gimp_temp_buf_unref (temp_buf);
}
static gboolean
@@ -176,7 +176,7 @@ gimp_view_renderer_brush_render_timeout (gpointer data)
GIMP_VIEW_BG_WHITE,
GIMP_VIEW_BG_WHITE);
- gimp_temp_buf_free (temp_buf);
+ gimp_temp_buf_unref (temp_buf);
gimp_view_renderer_update (renderer);
diff --git a/app/widgets/gimpviewrendererbuffer.c b/app/widgets/gimpviewrendererbuffer.c
index 33e6874..7ecf93b 100644
--- a/app/widgets/gimpviewrendererbuffer.c
+++ b/app/widgets/gimpviewrendererbuffer.c
@@ -91,7 +91,7 @@ gimp_view_renderer_buffer_render (GimpViewRenderer *renderer,
{
render_buf = gimp_temp_buf_scale (temp_buf, view_width, view_height);
- gimp_temp_buf_free (temp_buf);
+ gimp_temp_buf_unref (temp_buf);
}
}
else
@@ -105,7 +105,7 @@ gimp_view_renderer_buffer_render (GimpViewRenderer *renderer,
{
gimp_view_renderer_render_temp_buf_simple (renderer, render_buf);
- gimp_temp_buf_free (render_buf);
+ gimp_temp_buf_unref (render_buf);
}
else /* no preview available */
{
diff --git a/app/widgets/gimpviewrendererdrawable.c b/app/widgets/gimpviewrendererdrawable.c
index 1617483..97ccadf 100644
--- a/app/widgets/gimpviewrendererdrawable.c
+++ b/app/widgets/gimpviewrendererdrawable.c
@@ -186,7 +186,7 @@ gimp_view_renderer_drawable_render (GimpViewRenderer *renderer,
{
render_buf = gimp_temp_buf_scale (temp_buf,
view_width, view_height);
- gimp_temp_buf_free (temp_buf);
+ gimp_temp_buf_unref (temp_buf);
}
}
}
@@ -232,7 +232,7 @@ gimp_view_renderer_drawable_render (GimpViewRenderer *renderer,
gimp_view_renderer_render_temp_buf (renderer, render_buf, -1,
GIMP_VIEW_BG_CHECKS,
GIMP_VIEW_BG_CHECKS);
- gimp_temp_buf_free (render_buf);
+ gimp_temp_buf_unref (render_buf);
}
else
{
diff --git a/app/widgets/gimpviewrendererimage.c b/app/widgets/gimpviewrendererimage.c
index 33f68bc..a8ea7f5 100644
--- a/app/widgets/gimpviewrendererimage.c
+++ b/app/widgets/gimpviewrendererimage.c
@@ -108,7 +108,7 @@ gimp_view_renderer_image_render (GimpViewRenderer *renderer,
{
render_buf = gimp_temp_buf_scale (temp_buf,
view_width, view_height);
- gimp_temp_buf_free (temp_buf);
+ gimp_temp_buf_unref (temp_buf);
}
}
else
@@ -130,7 +130,7 @@ gimp_view_renderer_image_render (GimpViewRenderer *renderer,
temp_buf = gimp_temp_buf_scale (render_buf,
renderer->width, renderer->height);
- gimp_temp_buf_free (render_buf);
+ gimp_temp_buf_unref (render_buf);
render_buf = temp_buf;
}
@@ -148,7 +148,7 @@ gimp_view_renderer_image_render (GimpViewRenderer *renderer,
component_index,
GIMP_VIEW_BG_CHECKS,
GIMP_VIEW_BG_WHITE);
- gimp_temp_buf_free (render_buf);
+ gimp_temp_buf_unref (render_buf);
return;
}
diff --git a/tools/pdbgen/pdb/drawable.pdb b/tools/pdbgen/pdb/drawable.pdb
index 13400ff..ffe57a1 100644
--- a/tools/pdbgen/pdb/drawable.pdb
+++ b/tools/pdbgen/pdb/drawable.pdb
@@ -736,7 +736,7 @@ HELP
thumbnail_data = g_memdup (gimp_temp_buf_get_data (buf),
thumbnail_data_count);
- gimp_temp_buf_free (buf);
+ gimp_temp_buf_unref (buf);
}
else
success = FALSE;
@@ -817,7 +817,7 @@ HELP
thumbnail_data = g_memdup (gimp_temp_buf_get_data (buf),
thumbnail_data_count);
- gimp_temp_buf_free (buf);
+ gimp_temp_buf_unref (buf);
}
else
success = FALSE;
diff --git a/tools/pdbgen/pdb/image.pdb b/tools/pdbgen/pdb/image.pdb
index a999ccc..087cead 100644
--- a/tools/pdbgen/pdb/image.pdb
+++ b/tools/pdbgen/pdb/image.pdb
@@ -2867,7 +2867,7 @@ HELP
thumbnail_data = g_memdup (gimp_temp_buf_get_data (buf),
thumbnail_data_count);
- gimp_temp_buf_free (buf);
+ gimp_temp_buf_unref (buf);
}
else
success = FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]