inline tile_manager_get_tile_num().

2005-05-09  Sven Neumann  <sven@gimp.org>

	* app/base/tile-manager.c: inline tile_manager_get_tile_num().

	* app/display/gimpdisplayshell-render.c (render_image_tile_fault):
	reverted one of the changes I did here earlier.
This commit is contained in:
Sven Neumann 2005-05-08 23:30:54 +00:00 committed by Sven Neumann
parent 4b582207f1
commit 3bb2f79984
3 changed files with 20 additions and 22 deletions

View File

@ -1,3 +1,10 @@
2005-05-09 Sven Neumann <sven@gimp.org>
* app/base/tile-manager.c: inline tile_manager_get_tile_num().
* app/display/gimpdisplayshell-render.c (render_image_tile_fault):
reverted one of the changes I did here earlier.
2005-05-08 Sven Neumann <sven@gimp.org>
* app/dialogs/layer-options-dialog.c (layer_options_dialog_new):

View File

@ -32,9 +32,17 @@
#include "tile-swap.h"
static gint tile_manager_get_tile_num (TileManager *tm,
static inline gint
tile_manager_get_tile_num (TileManager *tm,
gint xpixel,
gint ypixel);
gint ypixel)
{
if ((xpixel < 0) || (xpixel >= tm->width) ||
(ypixel < 0) || (ypixel >= tm->height))
return -1;
return (ypixel / TILE_HEIGHT) * tm->ntile_cols + (xpixel / TILE_WIDTH);
}
TileManager *
@ -116,7 +124,6 @@ tile_manager_unref (TileManager *tm)
}
}
void
tile_manager_set_validate_proc (TileManager *tm,
TileValidateProc proc)
@ -331,7 +338,6 @@ tile_manager_invalidate_tiles (TileManager *tm,
}
}
void
tile_invalidate_tile (Tile **tile_ptr,
TileManager *tm,
@ -350,7 +356,6 @@ tile_invalidate_tile (Tile **tile_ptr,
tile_invalidate (tile_ptr, tm, tile_num);
}
void
tile_invalidate (Tile **tile_ptr,
TileManager *tm,
@ -404,7 +409,6 @@ leave:
TILE_MUTEX_UNLOCK (tile);
}
void
tile_manager_map_tile (TileManager *tm,
gint xpixel,
@ -522,18 +526,6 @@ tile_manager_map (TileManager *tm,
#endif
}
static gint
tile_manager_get_tile_num (TileManager *tm,
gint xpixel,
gint ypixel)
{
if ((xpixel < 0) || (xpixel >= tm->width) ||
(ypixel < 0) || (ypixel >= tm->height))
return -1;
return (ypixel / TILE_HEIGHT) * tm->ntile_cols + (xpixel / TILE_WIDTH);
}
void
tile_manager_set_user_data (TileManager *tm,
gpointer user_data)
@ -665,7 +657,6 @@ tile_manager_get_tile_coordinates (TileManager *tm,
*y = TILE_HEIGHT * (tl->tile_num / tm->ntile_cols);
}
void
tile_manager_map_over_tile (TileManager *tm,
Tile *tile,

View File

@ -973,8 +973,8 @@ render_image_tile_fault (RenderInfo *info)
tile = tile_manager_get_tile (info->src_tiles,
x, info->src_y, TRUE, FALSE);
g_return_val_if_fail (tile != NULL, tile_buf);
if (!tile)
return tile_buf;
src = tile_data_pointer (tile,
x % TILE_WIDTH,