Commit 56b5909c authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

add "GimpImageType type" parameter because there are only a few calls to

2008-11-03  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpdrawable.[ch] (gimp_drawable_set_tiles): add
	"GimpImageType type" parameter because there are only a few calls
	to this function which (can easily pass the current type); however
	most calls to gimp_drawable_set_tiles_full() were just using the
	function because of the type argument and passed in the item's
	current offsets (which means peeking into the item struct or using
	temp variables).

	* app/core/gimpdrawable-offset.c (gimp_drawable_offset)
	* app/text/gimptextlayer.c (gimp_text_layer_render)
	* app/tools/gimptransformtool.c (gimp_transform_tool_doit): pass
	the type to set_tiles().

	* app/core/gimpchannel.c (gimp_channel_convert)
	* app/core/gimpimage-convert.c (gimp_image_convert)
	* app/core/gimplayer.c (gimp_layer_convert,add_alpha,flatten):
	change calls to set_tiles_full() into set_tiles() because the
	offset doesn't change.


svn path=/trunk/; revision=27535
parent 847de4dd
2008-11-03 Michael Natterer <mitch@gimp.org>
* app/core/gimpdrawable.[ch] (gimp_drawable_set_tiles): add
"GimpImageType type" parameter because there are only a few calls
to this function which (can easily pass the current type); however
most calls to gimp_drawable_set_tiles_full() were just using the
function because of the type argument and passed in the item's
current offsets (which means peeking into the item struct or using
temp variables).
* app/core/gimpdrawable-offset.c (gimp_drawable_offset)
* app/text/gimptextlayer.c (gimp_text_layer_render)
* app/tools/gimptransformtool.c (gimp_transform_tool_doit): pass
the type to set_tiles().
* app/core/gimpchannel.c (gimp_channel_convert)
* app/core/gimpimage-convert.c (gimp_image_convert)
* app/core/gimplayer.c (gimp_layer_convert,add_alpha,flatten):
change calls to set_tiles_full() into set_tiles() because the
offset doesn't change.
2008-11-03 Michael Natterer <mitch@gimp.org> 2008-11-03 Michael Natterer <mitch@gimp.org>
Bug 559015 – Move tool gives bad information about px moved Bug 559015 – Move tool gives bad information about px moved
......
...@@ -437,10 +437,8 @@ gimp_channel_convert (GimpItem *item, ...@@ -437,10 +437,8 @@ gimp_channel_convert (GimpItem *item,
gimp_drawable_convert_grayscale (drawable, new_tiles, old_base_type); gimp_drawable_convert_grayscale (drawable, new_tiles, old_base_type);
gimp_drawable_set_tiles_full (drawable, FALSE, NULL, gimp_drawable_set_tiles (drawable, FALSE, NULL,
new_tiles, new_type, new_tiles, new_type);
item->offset_x,
item->offset_y);
tile_manager_unref (new_tiles); tile_manager_unref (new_tiles);
} }
......
...@@ -313,6 +313,7 @@ gimp_drawable_offset (GimpDrawable *drawable, ...@@ -313,6 +313,7 @@ gimp_drawable_offset (GimpDrawable *drawable,
} }
gimp_drawable_set_tiles (drawable, gimp_item_is_attached (item), gimp_drawable_set_tiles (drawable, gimp_item_is_attached (item),
_("Offset Drawable"), new_tiles); _("Offset Drawable"), new_tiles,
gimp_drawable_type (drawable));
tile_manager_unref (new_tiles); tile_manager_unref (new_tiles);
} }
...@@ -1047,7 +1047,8 @@ void ...@@ -1047,7 +1047,8 @@ void
gimp_drawable_set_tiles (GimpDrawable *drawable, gimp_drawable_set_tiles (GimpDrawable *drawable,
gboolean push_undo, gboolean push_undo,
const gchar *undo_desc, const gchar *undo_desc,
TileManager *tiles) TileManager *tiles,
GimpImageType type)
{ {
gint offset_x, offset_y; gint offset_x, offset_y;
...@@ -1059,8 +1060,7 @@ gimp_drawable_set_tiles (GimpDrawable *drawable, ...@@ -1059,8 +1060,7 @@ gimp_drawable_set_tiles (GimpDrawable *drawable,
gimp_item_get_offset (GIMP_ITEM (drawable), &offset_x, &offset_y); gimp_item_get_offset (GIMP_ITEM (drawable), &offset_x, &offset_y);
gimp_drawable_set_tiles_full (drawable, push_undo, undo_desc, tiles, gimp_drawable_set_tiles_full (drawable, push_undo, undo_desc, tiles, type,
gimp_drawable_type (drawable),
offset_x, offset_y); offset_x, offset_y);
} }
......
...@@ -163,7 +163,8 @@ TileManager * gimp_drawable_get_tiles (GimpDrawable *drawable); ...@@ -163,7 +163,8 @@ TileManager * gimp_drawable_get_tiles (GimpDrawable *drawable);
void gimp_drawable_set_tiles (GimpDrawable *drawable, void gimp_drawable_set_tiles (GimpDrawable *drawable,
gboolean push_undo, gboolean push_undo,
const gchar *undo_desc, const gchar *undo_desc,
TileManager *tiles); TileManager *tiles,
GimpImageType type);
void gimp_drawable_set_tiles_full (GimpDrawable *drawable, void gimp_drawable_set_tiles_full (GimpDrawable *drawable,
gboolean push_undo, gboolean push_undo,
const gchar *undo_desc, const gchar *undo_desc,
......
...@@ -990,10 +990,8 @@ gimp_image_convert (GimpImage *image, ...@@ -990,10 +990,8 @@ gimp_image_convert (GimpImage *image,
break; break;
} }
gimp_drawable_set_tiles_full (GIMP_DRAWABLE (layer), TRUE, NULL, gimp_drawable_set_tiles (GIMP_DRAWABLE (layer), TRUE, NULL,
new_tiles, new_layer_type, new_tiles, new_layer_type);
GIMP_ITEM (layer)->offset_x,
GIMP_ITEM (layer)->offset_y);
tile_manager_unref (new_tiles); tile_manager_unref (new_tiles);
} }
......
...@@ -676,10 +676,8 @@ gimp_layer_convert (GimpItem *item, ...@@ -676,10 +676,8 @@ gimp_layer_convert (GimpItem *item,
break; break;
} }
gimp_drawable_set_tiles_full (drawable, FALSE, NULL, gimp_drawable_set_tiles (drawable, FALSE, NULL,
new_tiles, new_type, new_tiles, new_type);
GIMP_ITEM (layer)->offset_x,
GIMP_ITEM (layer)->offset_y);
tile_manager_unref (new_tiles); tile_manager_unref (new_tiles);
} }
...@@ -1745,12 +1743,10 @@ gimp_layer_add_alpha (GimpLayer *layer) ...@@ -1745,12 +1743,10 @@ gimp_layer_add_alpha (GimpLayer *layer)
add_alpha_region (&srcPR, &destPR); add_alpha_region (&srcPR, &destPR);
/* Set the new tiles */ /* Set the new tiles */
gimp_drawable_set_tiles_full (GIMP_DRAWABLE (layer), gimp_drawable_set_tiles (GIMP_DRAWABLE (layer),
gimp_item_is_attached (GIMP_ITEM (layer)), gimp_item_is_attached (GIMP_ITEM (layer)),
_("Add Alpha Channel"), _("Add Alpha Channel"),
new_tiles, new_type, new_tiles, new_type);
item->offset_x,
item->offset_y);
tile_manager_unref (new_tiles); tile_manager_unref (new_tiles);
} }
...@@ -1799,12 +1795,10 @@ gimp_layer_flatten (GimpLayer *layer, ...@@ -1799,12 +1795,10 @@ gimp_layer_flatten (GimpLayer *layer,
flatten_region (&srcPR, &destPR, bg); flatten_region (&srcPR, &destPR, bg);
/* Set the new tiles */ /* Set the new tiles */
gimp_drawable_set_tiles_full (GIMP_DRAWABLE (layer), gimp_drawable_set_tiles (GIMP_DRAWABLE (layer),
gimp_item_is_attached (GIMP_ITEM (layer)), gimp_item_is_attached (GIMP_ITEM (layer)),
_("Remove Alpha Channel"), _("Remove Alpha Channel"),
new_tiles, new_type, new_tiles, new_type);
item->offset_x,
item->offset_y);
tile_manager_unref (new_tiles); tile_manager_unref (new_tiles);
} }
......
...@@ -560,7 +560,8 @@ gimp_text_layer_render (GimpTextLayer *layer) ...@@ -560,7 +560,8 @@ gimp_text_layer_render (GimpTextLayer *layer)
TileManager *new_tiles = tile_manager_new (width, height, TileManager *new_tiles = tile_manager_new (width, height,
drawable->bytes); drawable->bytes);
gimp_drawable_set_tiles (drawable, FALSE, NULL, new_tiles); gimp_drawable_set_tiles (drawable, FALSE, NULL, new_tiles,
gimp_drawable_type (drawable));
tile_manager_unref (new_tiles); tile_manager_unref (new_tiles);
......
...@@ -1261,7 +1261,8 @@ gimp_transform_tool_doit (GimpTransformTool *tr_tool, ...@@ -1261,7 +1261,8 @@ gimp_transform_tool_doit (GimpTransformTool *tr_tool,
gimp_channel_push_undo (GIMP_CHANNEL (active_item), NULL); gimp_channel_push_undo (GIMP_CHANNEL (active_item), NULL);
gimp_drawable_set_tiles (GIMP_DRAWABLE (active_item), gimp_drawable_set_tiles (GIMP_DRAWABLE (active_item),
FALSE, NULL, new_tiles); FALSE, NULL, new_tiles,
gimp_drawable_type (GIMP_DRAWABLE (active_item)));
tile_manager_unref (new_tiles); tile_manager_unref (new_tiles);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment