[gimp/soc-2010-cage] app: remove member GimpDrawable::has_alpha
- From: Michael Muré <mmure src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/soc-2010-cage] app: remove member GimpDrawable::has_alpha
- Date: Wed, 30 Jun 2010 22:07:22 +0000 (UTC)
commit 53fdfdc4b8d72871f99ca53560992fd70c197f3d
Author: Michael Natterer <mitch gimp org>
Date: Tue Jun 8 10:10:04 2010 +0200
app: remove member GimpDrawable::has_alpha
because it is always the same as GIMP_IMAGE_TYPE_HAS_ALPHA(drawable->type),
so simply use that instead.
app/core/gimpdrawable.c | 19 ++++++++-----------
app/core/gimpdrawable.h | 1 -
app/text/gimptextlayer-xcf.c | 5 ++---
3 files changed, 10 insertions(+), 15 deletions(-)
---
diff --git a/app/core/gimpdrawable.c b/app/core/gimpdrawable.c
index 9a770c2..63dc019 100644
--- a/app/core/gimpdrawable.c
+++ b/app/core/gimpdrawable.c
@@ -254,13 +254,12 @@ gimp_drawable_class_init (GimpDrawableClass *klass)
static void
gimp_drawable_init (GimpDrawable *drawable)
{
- drawable->private = G_TYPE_INSTANCE_GET_PRIVATE (drawable,
- GIMP_TYPE_DRAWABLE,
- GimpDrawablePrivate);
+ drawable->private = G_TYPE_INSTANCE_GET_PRIVATE (drawable,
+ GIMP_TYPE_DRAWABLE,
+ GimpDrawablePrivate);
- drawable->bytes = 0;
- drawable->type = -1;
- drawable->has_alpha = FALSE;
+ drawable->bytes = 0;
+ drawable->type = -1;
}
/* sorry for the evil casts */
@@ -832,7 +831,6 @@ gimp_drawable_real_set_tiles (GimpDrawable *drawable,
drawable->private->tiles = tiles;
drawable->type = type;
drawable->bytes = tile_manager_bpp (tiles);
- drawable->has_alpha = GIMP_IMAGE_TYPE_HAS_ALPHA (type);
gimp_item_set_offset (item, offset_x, offset_y);
gimp_item_set_size (item,
@@ -1207,9 +1205,8 @@ gimp_drawable_configure (GimpDrawable *drawable,
gimp_item_configure (GIMP_ITEM (drawable), image,
offset_x, offset_y, width, height, name);
- drawable->type = type;
- drawable->bytes = GIMP_IMAGE_TYPE_BYTES (type);
- drawable->has_alpha = GIMP_IMAGE_TYPE_HAS_ALPHA (type);
+ drawable->type = type;
+ drawable->bytes = GIMP_IMAGE_TYPE_BYTES (type);
if (drawable->private->tiles)
tile_manager_unref (drawable->private->tiles);
@@ -1861,7 +1858,7 @@ gimp_drawable_has_alpha (const GimpDrawable *drawable)
{
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
- return drawable->has_alpha;
+ return GIMP_IMAGE_TYPE_HAS_ALPHA (gimp_drawable_type (drawable));
}
GimpImageType
diff --git a/app/core/gimpdrawable.h b/app/core/gimpdrawable.h
index caeed82..faf1a69 100644
--- a/app/core/gimpdrawable.h
+++ b/app/core/gimpdrawable.h
@@ -39,7 +39,6 @@ struct _GimpDrawable
gint bytes; /* bytes per pixel */
GimpImageType type; /* type of drawable */
- gboolean has_alpha; /* drawable has alpha */
GimpDrawablePrivate *private;
};
diff --git a/app/text/gimptextlayer-xcf.c b/app/text/gimptextlayer-xcf.c
index 63934f4..77c6ca7 100644
--- a/app/text/gimptextlayer-xcf.c
+++ b/app/text/gimptextlayer-xcf.c
@@ -221,9 +221,8 @@ gimp_text_layer_from_layer (GimpLayer *layer,
drawable->private->tiles = gimp_drawable_get_tiles (GIMP_DRAWABLE (layer));
GIMP_DRAWABLE (layer)->private->tiles = NULL;
- drawable->bytes = gimp_drawable_bytes (GIMP_DRAWABLE (layer));
- drawable->type = gimp_drawable_type (GIMP_DRAWABLE (layer));
- drawable->has_alpha = gimp_drawable_has_alpha (GIMP_DRAWABLE (layer));
+ drawable->bytes = gimp_drawable_bytes (GIMP_DRAWABLE (layer));
+ drawable->type = gimp_drawable_type (GIMP_DRAWABLE (layer));
gimp_layer_set_opacity (GIMP_LAYER (text_layer),
gimp_layer_get_opacity (layer), FALSE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]