removed unused function tile_mark_valid().
2007-06-20 Sven Neumann <sven@gimp.org> * app/base/tile.[ch]: removed unused function tile_mark_valid(). * app/base/tile-manager.[ch]: removed unused public API and cleaned up internals used for invalidating tiles. svn path=/trunk/; revision=22806
This commit is contained in:

committed by
Sven Neumann

parent
9c8b7e133e
commit
923b06bd0e
@ -1,3 +1,10 @@
|
||||
2007-06-20 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/base/tile.[ch]: removed unused function tile_mark_valid().
|
||||
|
||||
* app/base/tile-manager.[ch]: removed unused public API and cleaned
|
||||
up internals used for invalidating tiles.
|
||||
|
||||
2007-06-20 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/base/tile-private.h (struct _Tile): removed unused field
|
||||
|
@ -287,62 +287,11 @@ tile_manager_validate (TileManager *tm,
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
tile_manager_invalidate_tiles (TileManager *tm,
|
||||
Tile *toplevel_tile)
|
||||
static void
|
||||
tile_manager_invalidate_tile (TileManager *tm,
|
||||
gint tile_num)
|
||||
{
|
||||
gdouble x, y;
|
||||
gint row, col;
|
||||
|
||||
g_return_if_fail (tm != NULL);
|
||||
g_return_if_fail (toplevel_tile != NULL);
|
||||
|
||||
col = toplevel_tile->tlink->tile_num % tm->ntile_cols;
|
||||
row = toplevel_tile->tlink->tile_num / tm->ntile_cols;
|
||||
|
||||
x = (col * TILE_WIDTH + toplevel_tile->ewidth / 2.0) / (gdouble) tm->width;
|
||||
y = (row * TILE_HEIGHT + toplevel_tile->eheight / 2.0) / (gdouble) tm->height;
|
||||
|
||||
if (tm->tiles)
|
||||
{
|
||||
gint num;
|
||||
|
||||
col = x * tm->width / TILE_WIDTH;
|
||||
row = y * tm->height / TILE_HEIGHT;
|
||||
|
||||
num = row * tm->ntile_cols + col;
|
||||
|
||||
tile_invalidate (&tm->tiles[num], tm, num);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
tile_invalidate_tile (Tile **tile_ptr,
|
||||
TileManager *tm,
|
||||
gint xpixel,
|
||||
gint ypixel)
|
||||
{
|
||||
gint num;
|
||||
|
||||
g_return_if_fail (tile_ptr != NULL);
|
||||
g_return_if_fail (tm != NULL);
|
||||
|
||||
num = tile_manager_get_tile_num (tm, xpixel, ypixel);
|
||||
if (num < 0)
|
||||
return;
|
||||
|
||||
tile_invalidate (tile_ptr, tm, num);
|
||||
}
|
||||
|
||||
void
|
||||
tile_invalidate (Tile **tile_ptr,
|
||||
TileManager *tm,
|
||||
gint tile_num)
|
||||
{
|
||||
Tile *tile = *tile_ptr;
|
||||
|
||||
g_return_if_fail (tile_ptr != NULL);
|
||||
g_return_if_fail (tm != NULL);
|
||||
Tile *tile = tm->tiles[tile_num];
|
||||
|
||||
if (! tile->valid)
|
||||
return;
|
||||
@ -369,7 +318,7 @@ tile_invalidate (Tile **tile_ptr,
|
||||
tile_detach (tile, tm, tile_num);
|
||||
|
||||
tile_attach (new, tm, tile_num);
|
||||
tile = *tile_ptr = new;
|
||||
tile = new;
|
||||
}
|
||||
|
||||
if (tile->listhead)
|
||||
@ -392,6 +341,19 @@ tile_invalidate (Tile **tile_ptr,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
tile_manager_invalidate_pixel (TileManager *tm,
|
||||
gint xpixel,
|
||||
gint ypixel)
|
||||
{
|
||||
gint num = tile_manager_get_tile_num (tm, xpixel, ypixel);
|
||||
|
||||
if (num < 0)
|
||||
return;
|
||||
|
||||
tile_manager_invalidate_tile (tm, num);
|
||||
}
|
||||
|
||||
void
|
||||
tile_manager_map_tile (TileManager *tm,
|
||||
gint xpixel,
|
||||
@ -523,10 +485,7 @@ tile_manager_invalidate_area (TileManager *tm,
|
||||
for (i = y; i < (y + h); i += (TILE_HEIGHT - (i % TILE_HEIGHT)))
|
||||
for (j = x; j < (x + w); j += (TILE_WIDTH - (j % TILE_WIDTH)))
|
||||
{
|
||||
Tile *tile = tile_manager_get_tile (tm, j, i, FALSE, FALSE);
|
||||
|
||||
if (tile != NULL)
|
||||
tile_invalidate_tile (&tile, tm, j, i);
|
||||
tile_manager_invalidate_pixel (tm, j, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -81,20 +81,6 @@ void tile_manager_map (TileManager *tm,
|
||||
void tile_manager_validate (TileManager *tm,
|
||||
Tile *tile);
|
||||
|
||||
void tile_invalidate (Tile **tile_ptr,
|
||||
TileManager *tm,
|
||||
gint tile_num);
|
||||
void tile_invalidate_tile (Tile **tile_ptr,
|
||||
TileManager *tm,
|
||||
gint xpixel,
|
||||
gint ypixel);
|
||||
|
||||
/* Given a toplevel tile, this procedure will invalidate
|
||||
* (set the dirty bit) for this toplevel tile.
|
||||
*/
|
||||
void tile_manager_invalidate_tiles (TileManager *tm,
|
||||
Tile *toplevel_tile);
|
||||
|
||||
void tile_manager_invalidate_area (TileManager *tm,
|
||||
gint x,
|
||||
gint y,
|
||||
|
@ -308,12 +308,6 @@ tile_is_valid (Tile *tile)
|
||||
return tile->valid;
|
||||
}
|
||||
|
||||
void
|
||||
tile_mark_valid (Tile *tile)
|
||||
{
|
||||
tile->valid = TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
tile_attach (Tile *tile,
|
||||
void *tm,
|
||||
|
@ -71,8 +71,6 @@ gint tile_bpp (Tile *tile);
|
||||
|
||||
gboolean tile_is_valid (Tile *tile);
|
||||
|
||||
void tile_mark_valid (Tile *tile);
|
||||
|
||||
TileRowHint tile_get_rowhint (Tile *tile,
|
||||
gint yoff);
|
||||
void tile_set_rowhint (Tile *tile,
|
||||
|
Reference in New Issue
Block a user