Commit be87dfb5 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

pass a GdkGC to gdk_draw_rgb_image(), fixed dither offsets.

2002-01-30  Michael Natterer  <mitch@gimp.org>

	* libgimpwidgets/gimpcolorarea.c: pass a GdkGC to
	gdk_draw_rgb_image(), fixed dither offsets.

	* app/core/gimpobject.[ch]: new virtual function
	gimp_object_get_memsize().

	* app/base/temp-buf.[ch]
	* app/base/tile-manager.[ch]: added *_get_memsize() methods.

	* app/core/gimp.c
	* app/core/gimpbrush.c
	* app/core/gimpbrushpipe.c
	* app/core/gimpbuffer.c
	* app/core/gimpchannel.c
	* app/core/gimpcontainer.c
	* app/core/gimpcontext.c
	* app/core/gimpdata.c
	* app/core/gimpdatafactory.c
	* app/core/gimpdrawable.c
	* app/core/gimpgradient.c
	* app/core/gimpimage.c
	* app/core/gimplayer.c
	* app/core/gimplist.c
	* app/core/gimpmoduleinfo.c
	* app/core/gimppalette.c
	* app/core/gimpparasitelist.c
	* app/core/gimppattern.c
	* app/core/gimppreviewcache.[ch]
	* app/core/gimpundo.[ch]
	* app/core/gimpundostack.c
	* app/core/gimpviewable.c: added get_memsize() implementations.

	* app/widgets/gimppreview.c
	* app/core/gimpobject.[ch]: some #ifdef DEBUG_MEMSIZE code to
	test the new memsize stuff (middle click any preview to get
	it's viewable's memory footprint).
parent f0df9ed3
2002-01-30 Michael Natterer <mitch@gimp.org>
* libgimpwidgets/gimpcolorarea.c: pass a GdkGC to
gdk_draw_rgb_image(), fixed dither offsets.
* app/core/gimpobject.[ch]: new virtual function
gimp_object_get_memsize().
* app/base/temp-buf.[ch]
* app/base/tile-manager.[ch]: added *_get_memsize() methods.
* app/core/gimp.c
* app/core/gimpbrush.c
* app/core/gimpbrushpipe.c
* app/core/gimpbuffer.c
* app/core/gimpchannel.c
* app/core/gimpcontainer.c
* app/core/gimpcontext.c
* app/core/gimpdata.c
* app/core/gimpdatafactory.c
* app/core/gimpdrawable.c
* app/core/gimpgradient.c
* app/core/gimpimage.c
* app/core/gimplayer.c
* app/core/gimplist.c
* app/core/gimpmoduleinfo.c
* app/core/gimppalette.c
* app/core/gimpparasitelist.c
* app/core/gimppattern.c
* app/core/gimppreviewcache.[ch]
* app/core/gimpundo.[ch]
* app/core/gimpundostack.c
* app/core/gimpviewable.c: added get_memsize() implementations.
* app/widgets/gimppreview.c
* app/core/gimpobject.[ch]: some #ifdef DEBUG_MEMSIZE code to
test the new memsize stuff (middle click any preview to get
it's viewable's memory footprint).
2002-01-30 Sven Neumann <sven@gimp.org>
* plug-ins/FractalExplorer/Events.c
......
......@@ -493,22 +493,48 @@ temp_buf_data (TempBuf *temp_buf)
guchar *
temp_buf_data_clear (TempBuf *temp_buf)
{
g_return_val_if_fail (temp_buf != NULL, NULL);
if (temp_buf->swapped)
temp_buf_unswap (temp_buf);
memset (temp_buf->data, 0,
temp_buf->height * temp_buf->width * temp_buf->bytes);
return temp_buf->data;
}
gsize
temp_buf_get_memsize (TempBuf *temp_buf)
{
gsize memsize = 0;
g_return_val_if_fail (temp_buf != NULL, 0);
memsize += sizeof (TempBuf);
if (temp_buf->swapped)
{
memsize += strlen (temp_buf->filename) + 1;
}
else
{
memsize += (temp_buf->bytes *
temp_buf->width *
temp_buf->height);
}
return memsize;
}
/******************************************************************
* Mask buffer functions *
******************************************************************/
MaskBuf *
mask_buf_new (gint width,
mask_buf_new (gint width,
gint height)
{
static guchar empty = 0;
......@@ -525,7 +551,7 @@ mask_buf_free (MaskBuf *mask)
guchar *
mask_buf_data (MaskBuf *mask_buf)
{
return temp_buf_data ((TempBuf *) mask_buf);
return temp_buf_data ((TempBuf *) mask_buf);
}
guchar *
......@@ -562,11 +588,15 @@ mask_buf_data_clear (MaskBuf *mask_buf)
*/
/* a static counter for generating unique filenames */
/* a static counter for generating unique filenames
*/
static gint swap_index = 0;
/* a static pointer which keeps track of the last request for a swapped buffer */
static TempBuf * cached_in_memory = NULL;
/* a static pointer which keeps track of the last request for
* a swapped buffer
*/
static TempBuf *cached_in_memory = NULL;
static gchar *
......@@ -614,8 +644,10 @@ temp_buf_swap (TempBuf *buf)
cached_in_memory = buf;
}
/* For the case where there is no temp buf ready to be moved to disk, return */
if (!swap)
/* For the case where there is no temp buf ready
* to be moved to disk, return
*/
if (! swap)
return;
/* Get a unique filename for caching the data to a UNIX file */
......
......@@ -37,57 +37,61 @@ struct _TempBuf
/* The temp buffer functions */
TempBuf * temp_buf_new (gint width,
gint height,
gint bytes,
gint x,
gint y,
guchar *col);
TempBuf * temp_buf_new_check (gint width,
gint height,
GimpCheckType check_type,
GimpCheckSize check_size);
TempBuf * temp_buf_copy (TempBuf *src,
TempBuf *dest);
TempBuf * temp_buf_resize (TempBuf *buf,
gint bytes,
gint x,
gint y,
gint width,
gint height);
TempBuf * temp_buf_scale (TempBuf *buf,
gint width,
gint height);
TempBuf * temp_buf_copy_area (TempBuf *src,
TempBuf *dest,
gint x,
gint y,
gint width,
gint height,
gint dest_x,
gint dest_y);
void temp_buf_free (TempBuf *buf);
guchar * temp_buf_data (TempBuf *buf);
guchar * temp_buf_data_clear (TempBuf *buf);
TempBuf * temp_buf_new (gint width,
gint height,
gint bytes,
gint x,
gint y,
guchar *col);
TempBuf * temp_buf_new_check (gint width,
gint height,
GimpCheckType check_type,
GimpCheckSize check_size);
TempBuf * temp_buf_copy (TempBuf *src,
TempBuf *dest);
TempBuf * temp_buf_resize (TempBuf *buf,
gint bytes,
gint x,
gint y,
gint width,
gint height);
TempBuf * temp_buf_scale (TempBuf *buf,
gint width,
gint height);
TempBuf * temp_buf_copy_area (TempBuf *src,
TempBuf *dest,
gint x,
gint y,
gint width,
gint height,
gint dest_x,
gint dest_y);
void temp_buf_free (TempBuf *buf);
guchar * temp_buf_data (TempBuf *buf);
guchar * temp_buf_data_clear (TempBuf *buf);
gsize temp_buf_get_memsize (TempBuf *buf);
/* The mask buffer functions */
MaskBuf * mask_buf_new (gint width,
gint height);
void mask_buf_free (MaskBuf *mask_buf);
guchar * mask_buf_data (MaskBuf *mask_buf);
guchar * mask_buf_data_clear (MaskBuf *mask_buf);
MaskBuf * mask_buf_new (gint width,
gint height);
void mask_buf_free (MaskBuf *mask_buf);
guchar * mask_buf_data (MaskBuf *mask_buf);
guchar * mask_buf_data_clear (MaskBuf *mask_buf);
/* The disk caching functions */
void temp_buf_swap (TempBuf *buf);
void temp_buf_unswap (TempBuf *buf);
void temp_buf_swap_free (TempBuf *buf);
void temp_buf_swap (TempBuf *buf);
void temp_buf_unswap (TempBuf *buf);
void temp_buf_swap_free (TempBuf *buf);
/* Called by app_procs:exit() to free up the cached undo buffer */
void swapping_free (void);
void swapping_free (void);
#endif /* __TEMP_BUF_H__ */
......@@ -586,6 +586,21 @@ tile_manager_set_offsets (TileManager *tm,
tm->y = y;
}
gsize
tile_manager_get_memsize (const TileManager *tm)
{
gsize memsize = 0;
g_return_val_if_fail (tm != NULL, 0);
memsize += (sizeof (TileManager) +
tm->ntile_rows *
tm->ntile_cols *
(sizeof (Tile) + tm->bpp * TILE_WIDTH * TILE_HEIGHT)); /* FIXME */
return memsize;
}
void
tile_manager_get_tile_coordinates (TileManager *tm,
Tile *tile,
......
......@@ -122,6 +122,8 @@ void tile_manager_set_offsets (TileManager *tm,
gint x,
gint y);
gsize tile_manager_get_memsize (const TileManager *tm);
void tile_manager_get_tile_coordinates (TileManager *tm,
Tile *tile,
gint *x,
......
......@@ -56,11 +56,13 @@
#include "libgimp/gimpintl.h"
static void gimp_class_init (GimpClass *klass);
static void gimp_init (Gimp *gimp);
static void gimp_class_init (GimpClass *klass);
static void gimp_init (Gimp *gimp);
static void gimp_dispose (GObject *object);
static void gimp_finalize (GObject *object);
static void gimp_dispose (GObject *object);
static void gimp_finalize (GObject *object);
static gsize gimp_get_memsize (GimpObject *object);
static GimpObjectClass *parent_class = NULL;
......@@ -97,14 +99,18 @@ gimp_get_type (void)
static void
gimp_class_init (GimpClass *klass)
{
GObjectClass *object_class;
GObjectClass *object_class;
GimpObjectClass *gimp_object_class;
object_class = G_OBJECT_CLASS (klass);
object_class = G_OBJECT_CLASS (klass);
gimp_object_class = GIMP_OBJECT_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
object_class->dispose = gimp_dispose;
object_class->finalize = gimp_finalize;
object_class->dispose = gimp_dispose;
object_class->finalize = gimp_finalize;
gimp_object_class->get_memsize = gimp_get_memsize;
}
static void
......@@ -317,6 +323,53 @@ gimp_finalize (GObject *object)
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static gsize
gimp_get_memsize (GimpObject *object)
{
Gimp *gimp;
gsize memsize = 0;
gimp = GIMP (object);
memsize += g_list_length (gimp->user_units) * sizeof (GList); /* FIXME */
memsize += (gimp_object_get_memsize (GIMP_OBJECT (gimp->parasites)) +
gimp_object_get_memsize (GIMP_OBJECT (gimp->modules)));
memsize += (g_hash_table_size (gimp->image_table) *
3 * sizeof (gpointer)); /* FIXME */
memsize += (g_hash_table_size (gimp->drawable_table) *
3 * sizeof (gpointer)); /* FIXME */
memsize += (gimp_object_get_memsize (GIMP_OBJECT (gimp->global_buffer)) +
gimp_object_get_memsize (GIMP_OBJECT (gimp->named_buffers)) +
gimp_object_get_memsize (GIMP_OBJECT (gimp->brush_factory)) +
gimp_object_get_memsize (GIMP_OBJECT (gimp->pattern_factory)) +
gimp_object_get_memsize (GIMP_OBJECT (gimp->gradient_factory)) +
gimp_object_get_memsize (GIMP_OBJECT (gimp->palette_factory)));
memsize += (g_hash_table_size (gimp->procedural_ht) *
3 * sizeof (gpointer)); /* FIXME */
memsize += g_slist_length (gimp->load_procs) * sizeof (GSList); /* FIXME */
memsize += g_slist_length (gimp->save_procs) * sizeof (GSList); /* FIXME */
memsize += (gimp_object_get_memsize (GIMP_OBJECT (gimp->tool_info_list)) +
gimp_object_get_memsize (GIMP_OBJECT (gimp->standard_tool_info)) +
gimp_object_get_memsize (GIMP_OBJECT (gimp->documents)));
memsize += g_list_length (gimp->image_base_type_names) * sizeof (GList); /* FIXME */
memsize += g_list_length (gimp->fill_type_names) * sizeof (GList); /* FIXME */
memsize += g_list_length (gimp->context_list) * sizeof (GList);
memsize += (gimp_object_get_memsize (GIMP_OBJECT (gimp->standard_context)) +
gimp_object_get_memsize (GIMP_OBJECT (gimp->default_context)) +
gimp_object_get_memsize (GIMP_OBJECT (gimp->user_context)));
return memsize = GIMP_OBJECT_CLASS (parent_class)->get_memsize (object);
}
Gimp *
gimp_new (gboolean be_verbose,
gboolean no_data,
......
......@@ -67,6 +67,8 @@ static void gimp_brush_init (GimpBrush *brush);
static void gimp_brush_finalize (GObject *object);
static gsize gimp_brush_get_memsize (GimpObject *object);
static TempBuf * gimp_brush_get_new_preview (GimpViewable *viewable,
gint width,
gint height);
......@@ -117,12 +119,14 @@ static void
gimp_brush_class_init (GimpBrushClass *klass)
{
GObjectClass *object_class;
GimpObjectClass *gimp_object_class;
GimpViewableClass *viewable_class;
GimpDataClass *data_class;
object_class = G_OBJECT_CLASS (klass);
viewable_class = GIMP_VIEWABLE_CLASS (klass);
data_class = GIMP_DATA_CLASS (klass);
object_class = G_OBJECT_CLASS (klass);
gimp_object_class = GIMP_OBJECT_CLASS (klass);
viewable_class = GIMP_VIEWABLE_CLASS (klass);
data_class = GIMP_DATA_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
......@@ -137,6 +141,8 @@ gimp_brush_class_init (GimpBrushClass *klass)
object_class->finalize = gimp_brush_finalize;
gimp_object_class->get_memsize = gimp_brush_get_memsize;
viewable_class->get_new_preview = gimp_brush_get_new_preview;
data_class->get_extension = gimp_brush_get_extension;
......@@ -180,6 +186,23 @@ gimp_brush_finalize (GObject *object)
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static gsize
gimp_brush_get_memsize (GimpObject *object)
{
GimpBrush *brush;
gsize memsize = 0;
brush = GIMP_BRUSH (object);
if (brush->mask)
memsize += temp_buf_get_memsize (brush->mask);
if (brush->pixmap)
memsize += temp_buf_get_memsize (brush->pixmap);
return memsize + GIMP_OBJECT_CLASS (parent_class)->get_memsize (object);
}
static TempBuf *
gimp_brush_get_new_preview (GimpViewable *viewable,
gint width,
......
......@@ -67,6 +67,8 @@ static void gimp_brush_init (GimpBrush *brush);
static void gimp_brush_finalize (GObject *object);
static gsize gimp_brush_get_memsize (GimpObject *object);
static TempBuf * gimp_brush_get_new_preview (GimpViewable *viewable,
gint width,
gint height);
......@@ -117,12 +119,14 @@ static void
gimp_brush_class_init (GimpBrushClass *klass)
{
GObjectClass *object_class;
GimpObjectClass *gimp_object_class;
GimpViewableClass *viewable_class;
GimpDataClass *data_class;
object_class = G_OBJECT_CLASS (klass);
viewable_class = GIMP_VIEWABLE_CLASS (klass);
data_class = GIMP_DATA_CLASS (klass);
object_class = G_OBJECT_CLASS (klass);
gimp_object_class = GIMP_OBJECT_CLASS (klass);
viewable_class = GIMP_VIEWABLE_CLASS (klass);
data_class = GIMP_DATA_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
......@@ -137,6 +141,8 @@ gimp_brush_class_init (GimpBrushClass *klass)
object_class->finalize = gimp_brush_finalize;
gimp_object_class->get_memsize = gimp_brush_get_memsize;
viewable_class->get_new_preview = gimp_brush_get_new_preview;
data_class->get_extension = gimp_brush_get_extension;
......@@ -180,6 +186,23 @@ gimp_brush_finalize (GObject *object)
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static gsize
gimp_brush_get_memsize (GimpObject *object)
{
GimpBrush *brush;
gsize memsize = 0;
brush = GIMP_BRUSH (object);
if (brush->mask)
memsize += temp_buf_get_memsize (brush->mask);
if (brush->pixmap)
memsize += temp_buf_get_memsize (brush->pixmap);
return memsize + GIMP_OBJECT_CLASS (parent_class)->get_memsize (object);
}
static TempBuf *
gimp_brush_get_new_preview (GimpViewable *viewable,
gint width,
......
......@@ -59,6 +59,8 @@ static void gimp_brush_pipe_init (GimpBrushPipe *pipe);
static void gimp_brush_pipe_finalize (GObject *object);
static gsize gimp_brush_pipe_get_memsize (GimpObject *object);
static GimpBrush * gimp_brush_pipe_select_brush (GimpBrush *brush,
GimpCoords *last_coords,
GimpCoords *cur_coords);
......@@ -101,18 +103,22 @@ gimp_brush_pipe_get_type (void)
static void
gimp_brush_pipe_class_init (GimpBrushPipeClass *klass)
{
GObjectClass *object_class;
GimpBrushClass *brush_class;
GObjectClass *object_class;
GimpObjectClass *gimp_object_class;
GimpBrushClass *brush_class;
object_class = G_OBJECT_CLASS (klass);
brush_class = GIMP_BRUSH_CLASS (klass);
object_class = G_OBJECT_CLASS (klass);
gimp_object_class = GIMP_OBJECT_CLASS (klass);
brush_class = GIMP_BRUSH_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
object_class->finalize = gimp_brush_pipe_finalize;
object_class->finalize = gimp_brush_pipe_finalize;
gimp_object_class->get_memsize = gimp_brush_pipe_get_memsize;
brush_class->select_brush = gimp_brush_pipe_select_brush;
brush_class->want_null_motion = gimp_brush_pipe_want_null_motion;
brush_class->select_brush = gimp_brush_pipe_select_brush;
brush_class->want_null_motion = gimp_brush_pipe_want_null_motion;
}
static void
......@@ -177,6 +183,27 @@ gimp_brush_pipe_finalize (GObject *object)
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static gsize
gimp_brush_pipe_get_memsize (GimpObject *object)
{
GimpBrushPipe *pipe;
gsize memsize = 0;
gint i;
pipe = GIMP_BRUSH_PIPE (object);
memsize += pipe->dimension * (sizeof (gint) /* rank */ +
sizeof (gint) /* stride */ +
sizeof (PipeSelectModes));
for (i = 0; i < pipe->nbrushes; i++)
{
memsize += gimp_object_get_memsize (GIMP_OBJECT (pipe->brushes[i]));
}
return memsize + GIMP_OBJECT_CLASS (parent_class)->get_memsize (object);
}
static GimpBrush *
gimp_brush_pipe_select_brush (GimpBrush *brush,
GimpCoords *last_coords,
......
......@@ -59,6 +59,8 @@ static void gimp_brush_pipe_init (GimpBrushPipe *pipe);
static void gimp_brush_pipe_finalize (GObject *object);
static gsize gimp_brush_pipe_get_memsize (GimpObject *object);
static GimpBrush * gimp_brush_pipe_select_brush (GimpBrush *brush,
GimpCoords *last_coords,
GimpCoords *cur_coords);
......@@ -101,18 +103,22 @@ gimp_brush_pipe_get_type (void)
static void
gimp_brush_pipe_class_init (GimpBrushPipeClass *klass)
{
GObjectClass *object_class;
GimpBrushClass *brush_class;
GObjectClass *object_class;
GimpObjectClass *gimp_object_class;
GimpBrushClass *brush_class;
object_class = G_OBJECT_CLASS (klass);
brush_class = GIMP_BRUSH_CLASS (klass);
object_class = G_OBJECT_CLASS (klass);
gimp_object_class = GIMP_OBJECT_CLASS (klass);
brush_class = GIMP_BRUSH_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
object_class->finalize = gimp_brush_pipe_finalize;
object_class->finalize = gimp_brush_pipe_finalize;
gimp_object_class->get_memsize = gimp_brush_pipe_get_memsize;
brush_class->select_brush = gimp_brush_pipe_select_brush;
brush_class->want_null_motion = gimp_brush_pipe_want_null_motion;
brush_class->select_brush = gimp_brush_pipe_select_brush;
brush_class->want_null_motion = gimp_brush_pipe_want_null_motion;
}
static void
......@@ -177,6 +183,27 @@ gimp_brush_pipe_finalize (GObject *object)
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static gsize
gimp_brush_pipe_get_memsize (GimpObject *object)
{
GimpBrushPipe *pipe;
gsize memsize = 0;
gint i;
pipe = GIMP_BRUSH_PIPE (object);
memsize += pipe->dimension * (sizeof (gint) /* rank */ +
sizeof (gint) /* stride */ +
sizeof (PipeSelectModes));
for (i = 0; i < pipe->nbrushes; i++)
{
memsize += gimp_object_get_memsize (GIMP_OBJECT (pipe->brushes[i]));
}
return memsize + GIMP_OBJECT_CLASS (parent_class)->get_memsize (object);
}
static GimpBrush *
gimp_brush_pipe_select_brush (GimpBrush *brush,
GimpCoords *last_coords,
......
......@@ -38,6 +38,8 @@ static void gimp_buffer_init (GimpBuffer *buffer);
static void gimp_buffer_finalize (GObject *object);
static gsize gimp_buffer_get_memsize (GimpObject *object);
static TempBuf * gimp_buffer_get_new_preview (GimpViewable *viewable,
gint width,
gint height);
......@@ -78,15 +80,19 @@ static void
gimp_buffer_class_init (GimpBufferClass *klass)
{
GObjectClass *object_class;
GimpObjectClass *gimp_object_class;
GimpViewableClass *viewable_class;
object_class = G_OBJECT_CLASS (klass);
viewable_class = GIMP_VIEWABLE_CLASS (klass);
object_class = G_OBJECT_CLASS (klass);
gimp_object_class = GIMP_OBJECT_CLASS (klass);
viewable_class = GIMP_VIEWABLE_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
object_class->finalize = gimp_buffer_finalize;
gimp_object_class->get_memsize = gimp_buffer_get_memsize;
viewable_class->get_new_preview = gimp_buffer_get_new_preview;
}
......@@ -112,6 +118,20 @@ gimp_buffer_finalize (GObject *object)
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static gsize
gimp_buffer_get_memsize (GimpObject *object)
{
GimpBuffer *buffer;
gsize memsize = 0;
buffer = GIMP_BUFFER (object);
if (buffer->tiles)
memsize += tile_manager_get_memsize (buffer->tiles);
return memsize + GIMP_OBJECT_CLASS (parent_class)->get_memsize (object);
}
static TempBuf *
gimp_buffer_get_new_preview (GimpViewable *viewable,
gint width,
......
......@@ -50,10 +50,12 @@
#include "libgimp/gimpintl.h"
static void gimp_channel_class_init (GimpChannelClass *klass);
static void gimp_channel_init (GimpChannel *channel);
static void gimp_channel_class_init (GimpChannelClass *klass);
static void gimp_channel_init (GimpChannel *channel);
static void gimp_channel_finalize (GObject *object);
static void gimp_channel_finalize (GObject *object);
static gsize gimp_channel_get_memsize (GimpObject *object);
static GimpDrawableClass * parent_class = NULL;
......@@ -90,13 +92,17 @@ gimp_channel_get_type (void)
static void
gimp_channel_class_init (GimpChannelClass *klass)
{
GObjectClass *object_class;
GObjectClass *object_class;
GimpObjectClass *gimp_object_class;
object_class = G_OBJECT_CLASS (klass);
object_class = G_OBJECT_CLASS (klass);
gimp_object_class = GIMP_OBJECT_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
object_class->finalize = gimp_channel_finalize;
object_class->finalize = gimp_channel_finalize;
gimp_object_class->get_memsize = gimp_channel_get_memsize;
}
static void
......@@ -144,6 +150,20 @@ gimp_channel_finalize (GObject *object)
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static gsize
gimp_channel_get_memsize (GimpObject *object)
{
GimpChannel *channel;
gsize memsize = 0;
channel = GIMP_CHANNEL (object);
memsize += channel->num_segs_in * sizeof (BoundSeg);
memsize += channel->num_segs_out * sizeof (BoundSeg);
return memsize + GIMP_OBJECT_CLASS (parent_class)->get_memsize (object);
}
static void
gimp_channel_validate (TileManager *tm,
Tile *tile)
......
......@@ -50,10 +50,12 @@
#include "libgimp/gimpintl.h"
static void gimp_channel_class_init (GimpChannelClass *klass);
static void gimp_channel_init (GimpChannel *channel);
static void gimp_channel_class_init (GimpChannelClass *klass);
static void