moved call to gimp_item_get_image() out of the loop.

2006-11-04  Sven Neumann  <sven@gimp.org>

	* app/core/gimpimagemap.c (gimp_image_map_do): moved call to
	gimp_item_get_image() out of the loop.

	* app/base/pixel-region.c
	* app/core/gimpitem.c: formatting.
This commit is contained in:
Sven Neumann 2006-11-04 18:18:32 +00:00 committed by Sven Neumann
parent 14731a5a81
commit e98c83a523
4 changed files with 24 additions and 14 deletions

View File

@ -1,3 +1,11 @@
2006-11-04 Sven Neumann <sven@gimp.org>
* app/core/gimpimagemap.c (gimp_image_map_do): moved call to
gimp_item_get_image() out of the loop.
* app/base/pixel-region.c
* app/core/gimpitem.c: formatting.
2006-11-03 Sven Neumann <sven@gimp.org>
* modules/cdisplay_lcms.c: update the configuration dialog when

View File

@ -281,6 +281,7 @@ pixel_regions_register (gint num_regions,
va_start (ap, num_regions);
found = FALSE;
while (num_regions --)
{
PixelRegionHolder *PRH;
@ -302,10 +303,11 @@ pixel_regions_register (gint num_regions,
PRH->starty = PR->y;
PRH->PR->process_count = 0;
if (!found)
if (! found)
{
found = TRUE;
PRI->region_width = PR->w;
PRI->region_width = PR->w;
PRI->region_height = PR->h;
}
}
@ -502,8 +504,7 @@ pixel_regions_configure (PixelRegionIterator *PRI)
PRI->portion_width = get_portion_width (PRI);
PRI->portion_height = get_portion_height (PRI);
if (PRI->portion_width == 0 ||
PRI->portion_height == 0)
if (PRI->portion_width == 0 || PRI->portion_height == 0)
{
/* free the pixel regions list */
if (PRI->pixel_regions)

View File

@ -475,7 +475,8 @@ gimp_image_map_abort (GimpImageMap *image_map)
static gboolean
gimp_image_map_do (GimpImageMap *image_map)
{
gint i;
GimpImage *image;
gint i;
if (! gimp_item_is_attached (GIMP_ITEM (image_map->drawable)))
{
@ -484,19 +485,18 @@ gimp_image_map_do (GimpImageMap *image_map)
return FALSE;
}
image = gimp_item_get_image (GIMP_ITEM (image_map->drawable));
/* Process up to 16 tiles in one go. This reduces the overhead
* caused by updating the display while the imagemap is being
* applied and gives us a tiny speedup.
*/
for (i = 0; i < 16; i++)
{
GimpImage *image;
PixelRegion srcPR;
PixelRegion destPR;
gint x, y, w, h;
image = gimp_item_get_image (GIMP_ITEM (image_map->drawable));
x = image_map->destPR.x;
y = image_map->destPR.y;
w = image_map->destPR.w;
@ -515,6 +515,7 @@ gimp_image_map_do (GimpImageMap *image_map)
&image_map->srcPR,
&image_map->destPR);
pixel_region_init (&srcPR, image->shadow, x, y, w, h, FALSE);
gimp_drawable_apply_region (image_map->drawable, &srcPR,

View File

@ -671,7 +671,7 @@ gimp_item_translate (GimpItem *item,
g_return_if_fail (GIMP_IS_ITEM (item));
item_class = GIMP_ITEM_GET_CLASS (item);
image = gimp_item_get_image (item);
image = gimp_item_get_image (item);
if (! gimp_item_is_attached (item))
push_undo = FALSE;
@ -739,7 +739,7 @@ gimp_item_scale (GimpItem *item,
return;
item_class = GIMP_ITEM_GET_CLASS (item);
image = gimp_item_get_image (item);
image = gimp_item_get_image (item);
if (gimp_item_is_attached (item))
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_ITEM_SCALE,
@ -904,7 +904,7 @@ gimp_item_resize (GimpItem *item,
return;
item_class = GIMP_ITEM_GET_CLASS (item);
image = gimp_item_get_image (item);
image = gimp_item_get_image (item);
if (gimp_item_is_attached (item))
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_ITEM_RESIZE,
@ -931,7 +931,7 @@ gimp_item_flip (GimpItem *item,
g_return_if_fail (GIMP_IS_CONTEXT (context));
item_class = GIMP_ITEM_GET_CLASS (item);
image = gimp_item_get_image (item);
image = gimp_item_get_image (item);
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_TRANSFORM,
item_class->flip_desc);
@ -957,7 +957,7 @@ gimp_item_rotate (GimpItem *item,
g_return_if_fail (GIMP_IS_CONTEXT (context));
item_class = GIMP_ITEM_GET_CLASS (item);
image = gimp_item_get_image (item);
image = gimp_item_get_image (item);
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_TRANSFORM,
item_class->rotate_desc);
@ -989,7 +989,7 @@ gimp_item_transform (GimpItem *item,
g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress));
item_class = GIMP_ITEM_GET_CLASS (item);
image = gimp_item_get_image (item);
image = gimp_item_get_image (item);
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_TRANSFORM,
item_class->transform_desc);