app: get rid of some unused internal API.
I noticed this yesterday, especially through gimp_image_get_active_array() and gimp_image_get_visible_array() which are looping through MAX_CHANNELS, hence assuming the passed components arrays are of sufficient size. I could have just added some comment to document that we must be careful when calling this, but this is currently completely unused code. So I prefer to just clean it out. If we need something like this in the future, we can just do it better.
This commit is contained in:
parent
bfec7079f0
commit
4f69cd039c
6 changed files with 0 additions and 87 deletions
|
|
@ -142,8 +142,6 @@ static void gimp_channel_convert_type (GimpDrawable *drawable,
|
|||
gboolean push_undo,
|
||||
GimpProgress *progress);
|
||||
static void gimp_channel_invalidate_boundary (GimpDrawable *drawable);
|
||||
static void gimp_channel_get_active_components (GimpDrawable *drawable,
|
||||
gboolean *active);
|
||||
|
||||
static void gimp_channel_set_buffer (GimpDrawable *drawable,
|
||||
gboolean push_undo,
|
||||
|
|
@ -274,7 +272,6 @@ gimp_channel_class_init (GimpChannelClass *klass)
|
|||
|
||||
drawable_class->convert_type = gimp_channel_convert_type;
|
||||
drawable_class->invalidate_boundary = gimp_channel_invalidate_boundary;
|
||||
drawable_class->get_active_components = gimp_channel_get_active_components;
|
||||
drawable_class->set_buffer = gimp_channel_set_buffer;
|
||||
|
||||
klass->boundary = gimp_channel_real_boundary;
|
||||
|
|
@ -943,15 +940,6 @@ gimp_channel_invalidate_boundary (GimpDrawable *drawable)
|
|||
channel->bounds_known = FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_channel_get_active_components (GimpDrawable *drawable,
|
||||
gboolean *active)
|
||||
{
|
||||
/* Make sure that the alpha channel is not valid. */
|
||||
active[GRAY] = TRUE;
|
||||
active[ALPHA_G] = FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_channel_set_buffer (GimpDrawable *drawable,
|
||||
gboolean push_undo,
|
||||
|
|
|
|||
|
|
@ -323,7 +323,6 @@ gimp_drawable_class_init (GimpDrawableClass *klass)
|
|||
klass->estimate_memsize = gimp_drawable_real_estimate_memsize;
|
||||
klass->update_all = gimp_drawable_real_update_all;
|
||||
klass->invalidate_boundary = NULL;
|
||||
klass->get_active_components = NULL;
|
||||
klass->get_active_mask = gimp_drawable_real_get_active_mask;
|
||||
klass->supports_alpha = gimp_drawable_real_supports_alpha;
|
||||
klass->convert_type = gimp_drawable_real_convert_type;
|
||||
|
|
@ -1364,21 +1363,6 @@ gimp_drawable_invalidate_boundary (GimpDrawable *drawable)
|
|||
drawable_class->invalidate_boundary (drawable);
|
||||
}
|
||||
|
||||
void
|
||||
gimp_drawable_get_active_components (GimpDrawable *drawable,
|
||||
gboolean *active)
|
||||
{
|
||||
GimpDrawableClass *drawable_class;
|
||||
|
||||
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
|
||||
g_return_if_fail (active != NULL);
|
||||
|
||||
drawable_class = GIMP_DRAWABLE_GET_CLASS (drawable);
|
||||
|
||||
if (drawable_class->get_active_components)
|
||||
drawable_class->get_active_components (drawable, active);
|
||||
}
|
||||
|
||||
GimpComponentMask
|
||||
gimp_drawable_get_active_mask (GimpDrawable *drawable)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -60,8 +60,6 @@ struct _GimpDrawableClass
|
|||
gint height);
|
||||
void (* update_all) (GimpDrawable *drawable);
|
||||
void (* invalidate_boundary) (GimpDrawable *drawable);
|
||||
void (* get_active_components) (GimpDrawable *drawable,
|
||||
gboolean *active);
|
||||
GimpComponentMask (* get_active_mask) (GimpDrawable *drawable);
|
||||
gboolean (* supports_alpha) (GimpDrawable *drawable);
|
||||
void (* convert_type) (GimpDrawable *drawable,
|
||||
|
|
@ -135,8 +133,6 @@ void gimp_drawable_update_all (GimpDrawable *drawa
|
|||
void gimp_drawable_filters_changed (GimpDrawable *drawable);
|
||||
|
||||
void gimp_drawable_invalidate_boundary (GimpDrawable *drawable);
|
||||
void gimp_drawable_get_active_components (GimpDrawable *drawable,
|
||||
gboolean *active);
|
||||
GimpComponentMask gimp_drawable_get_active_mask (GimpDrawable *drawable);
|
||||
|
||||
gboolean gimp_drawable_supports_alpha (GimpDrawable *drawable);
|
||||
|
|
|
|||
|
|
@ -3694,22 +3694,6 @@ gimp_image_get_component_active (GimpImage *image,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_image_get_active_array (GimpImage *image,
|
||||
gboolean *components)
|
||||
{
|
||||
GimpImagePrivate *private;
|
||||
gint i;
|
||||
|
||||
g_return_if_fail (GIMP_IS_IMAGE (image));
|
||||
g_return_if_fail (components != NULL);
|
||||
|
||||
private = GIMP_IMAGE_GET_PRIVATE (image);
|
||||
|
||||
for (i = 0; i < MAX_CHANNELS; i++)
|
||||
components[i] = private->active[i];
|
||||
}
|
||||
|
||||
GimpComponentMask
|
||||
gimp_image_get_active_mask (GimpImage *image)
|
||||
{
|
||||
|
|
@ -3794,22 +3778,6 @@ gimp_image_get_component_visible (GimpImage *image,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_image_get_visible_array (GimpImage *image,
|
||||
gboolean *components)
|
||||
{
|
||||
GimpImagePrivate *private;
|
||||
gint i;
|
||||
|
||||
g_return_if_fail (GIMP_IS_IMAGE (image));
|
||||
g_return_if_fail (components != NULL);
|
||||
|
||||
private = GIMP_IMAGE_GET_PRIVATE (image);
|
||||
|
||||
for (i = 0; i < MAX_CHANNELS; i++)
|
||||
components[i] = private->visible[i];
|
||||
}
|
||||
|
||||
GimpComponentMask
|
||||
gimp_image_get_visible_mask (GimpImage *image)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -237,8 +237,6 @@ void gimp_image_set_component_active (GimpImage *image,
|
|||
gboolean active);
|
||||
gboolean gimp_image_get_component_active (GimpImage *image,
|
||||
GimpChannelType type);
|
||||
void gimp_image_get_active_array (GimpImage *image,
|
||||
gboolean *components);
|
||||
GimpComponentMask gimp_image_get_active_mask (GimpImage *image);
|
||||
|
||||
void gimp_image_set_component_visible (GimpImage *image,
|
||||
|
|
@ -246,8 +244,6 @@ void gimp_image_set_component_visible (GimpImage *image,
|
|||
gboolean visible);
|
||||
gboolean gimp_image_get_component_visible (GimpImage *image,
|
||||
GimpChannelType type);
|
||||
void gimp_image_get_visible_array (GimpImage *image,
|
||||
gboolean *components);
|
||||
GimpComponentMask gimp_image_get_visible_mask (GimpImage *image);
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -194,8 +194,6 @@ static void gimp_layer_convert_type (GimpDrawable *drawable,
|
|||
gboolean push_undo,
|
||||
GimpProgress *progress);
|
||||
static void gimp_layer_invalidate_boundary (GimpDrawable *drawable);
|
||||
static void gimp_layer_get_active_components (GimpDrawable *drawable,
|
||||
gboolean *active);
|
||||
static GimpComponentMask
|
||||
gimp_layer_get_active_mask (GimpDrawable *drawable);
|
||||
static void gimp_layer_set_buffer (GimpDrawable *drawable,
|
||||
|
|
@ -448,7 +446,6 @@ gimp_layer_class_init (GimpLayerClass *klass)
|
|||
drawable_class->supports_alpha = gimp_layer_supports_alpha;
|
||||
drawable_class->convert_type = gimp_layer_convert_type;
|
||||
drawable_class->invalidate_boundary = gimp_layer_invalidate_boundary;
|
||||
drawable_class->get_active_components = gimp_layer_get_active_components;
|
||||
drawable_class->get_active_mask = gimp_layer_get_active_mask;
|
||||
drawable_class->set_buffer = gimp_layer_set_buffer;
|
||||
drawable_class->get_bounding_box = gimp_layer_get_bounding_box;
|
||||
|
|
@ -1511,22 +1508,6 @@ gimp_layer_invalidate_boundary (GimpDrawable *drawable)
|
|||
floating_sel_invalidate (layer);
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_layer_get_active_components (GimpDrawable *drawable,
|
||||
gboolean *active)
|
||||
{
|
||||
GimpLayer *layer = GIMP_LAYER (drawable);
|
||||
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
|
||||
const Babl *format = gimp_drawable_get_format (drawable);
|
||||
|
||||
/* first copy the image active channels */
|
||||
gimp_image_get_active_array (image, active);
|
||||
|
||||
if (gimp_drawable_has_alpha (drawable) &&
|
||||
gimp_layer_is_alpha_locked (layer, NULL))
|
||||
active[babl_format_get_n_components (format) - 1] = FALSE;
|
||||
}
|
||||
|
||||
static GimpComponentMask
|
||||
gimp_layer_get_active_mask (GimpDrawable *drawable)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue