mirror of
https://gitlab.gnome.org/GNOME/gimp
synced 2024-10-21 03:52:33 +00:00
app/base/tile-cache.c app/base/tile-manager.c app/base/tile-private.h
2006-09-07 Sven Neumann <sven@gimp.org> * app/base/tile-cache.c * app/base/tile-manager.c * app/base/tile-private.h * app/base/tile.c: removed tile locking macros that were only used for the threaded tile swapper.
This commit is contained in:
parent
fb13701060
commit
79931072c8
|
@ -1,3 +1,11 @@
|
|||
2006-09-07 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/base/tile-cache.c
|
||||
* app/base/tile-manager.c
|
||||
* app/base/tile-private.h
|
||||
* app/base/tile.c: removed tile locking macros that were only used
|
||||
for the threaded tile swapper.
|
||||
|
||||
2006-09-07 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/paint/gimpsourcecore.[ch] (gimp_source_core_motion): pass
|
||||
|
|
|
@ -266,8 +266,6 @@ tile_cache_zorch_next (void)
|
|||
else
|
||||
return FALSE;
|
||||
|
||||
TILE_MUTEX_LOCK (tile);
|
||||
|
||||
tile_cache_flush_internal (tile);
|
||||
|
||||
if (tile->dirty || tile->swap_offset == -1)
|
||||
|
@ -279,14 +277,11 @@ tile_cache_zorch_next (void)
|
|||
{
|
||||
g_free (tile->data);
|
||||
tile->data = NULL;
|
||||
TILE_MUTEX_UNLOCK (tile);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* unable to swap out tile for some reason */
|
||||
TILE_MUTEX_UNLOCK (tile);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -96,10 +96,7 @@ tile_manager_unref (TileManager *tm)
|
|||
gint i;
|
||||
|
||||
for (i = 0; i < ntiles; i++)
|
||||
{
|
||||
TILE_MUTEX_LOCK (tm->tiles[i]);
|
||||
tile_detach (tm->tiles[i], tm, i);
|
||||
}
|
||||
tile_detach (tm->tiles[i], tm, i);
|
||||
|
||||
g_free (tm->tiles);
|
||||
}
|
||||
|
@ -198,8 +195,6 @@ tile_manager_get (TileManager *tm,
|
|||
|
||||
if (wantread)
|
||||
{
|
||||
TILE_MUTEX_LOCK (*tile_ptr);
|
||||
|
||||
if (wantwrite)
|
||||
{
|
||||
if ((*tile_ptr)->share_count > 1)
|
||||
|
@ -234,8 +229,6 @@ tile_manager_get (TileManager *tm,
|
|||
|
||||
tile_detach (*tile_ptr, tm, tile_num);
|
||||
|
||||
TILE_MUTEX_LOCK (new);
|
||||
|
||||
tile_attach (new, tm, tile_num);
|
||||
*tile_ptr = new;
|
||||
}
|
||||
|
@ -252,8 +245,6 @@ tile_manager_get (TileManager *tm,
|
|||
}
|
||||
#endif
|
||||
|
||||
TILE_MUTEX_UNLOCK (*tile_ptr);
|
||||
|
||||
tile_lock (*tile_ptr);
|
||||
}
|
||||
|
||||
|
@ -350,10 +341,8 @@ tile_invalidate (Tile **tile_ptr,
|
|||
g_return_if_fail (tile_ptr != NULL);
|
||||
g_return_if_fail (tm != NULL);
|
||||
|
||||
TILE_MUTEX_LOCK (tile);
|
||||
|
||||
if (! tile->valid)
|
||||
goto leave;
|
||||
return;
|
||||
|
||||
if (G_UNLIKELY (tile->share_count > 1))
|
||||
{
|
||||
|
@ -370,8 +359,6 @@ tile_invalidate (Tile **tile_ptr,
|
|||
|
||||
tile_detach (tile, tm, tile_num);
|
||||
|
||||
TILE_MUTEX_LOCK (new);
|
||||
|
||||
tile_attach (new, tm, tile_num);
|
||||
tile = *tile_ptr = new;
|
||||
}
|
||||
|
@ -394,9 +381,6 @@ tile_invalidate (Tile **tile_ptr,
|
|||
*/
|
||||
tile_swap_delete (tile);
|
||||
}
|
||||
|
||||
leave:
|
||||
TILE_MUTEX_UNLOCK (tile);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -492,8 +476,6 @@ tile_manager_map (TileManager *tm,
|
|||
if (G_UNLIKELY (! srctile->valid))
|
||||
g_warning("%s: srctile not validated yet! please report", G_GNUC_FUNCTION);
|
||||
|
||||
TILE_MUTEX_LOCK (*tile_ptr);
|
||||
|
||||
if (G_UNLIKELY ((*tile_ptr)->ewidth != srctile->ewidth ||
|
||||
(*tile_ptr)->eheight != srctile->eheight ||
|
||||
(*tile_ptr)->bpp != srctile->bpp))
|
||||
|
@ -508,8 +490,6 @@ tile_manager_map (TileManager *tm,
|
|||
g_printerr (">");
|
||||
#endif
|
||||
|
||||
TILE_MUTEX_LOCK (srctile);
|
||||
|
||||
#ifdef DEBUG_TILE_MANAGER
|
||||
g_printerr (" [src:%p tm:%p tn:%d] ", srctile, tm, tile_num);
|
||||
#endif
|
||||
|
@ -517,8 +497,6 @@ tile_manager_map (TileManager *tm,
|
|||
tile_attach (srctile, tm, tile_num);
|
||||
*tile_ptr = srctile;
|
||||
|
||||
TILE_MUTEX_UNLOCK (srctile);
|
||||
|
||||
#ifdef DEBUG_TILE_MANAGER
|
||||
g_printerr ("}\n");
|
||||
#endif
|
||||
|
|
|
@ -82,8 +82,4 @@ struct _Tile
|
|||
};
|
||||
|
||||
|
||||
#define TILE_MUTEX_LOCK(tile) /* nothing */
|
||||
#define TILE_MUTEX_UNLOCK(tile) /* nothing */
|
||||
|
||||
|
||||
#endif /* __TILE_PRIVATE_H__ */
|
||||
|
|
|
@ -124,8 +124,6 @@ tile_lock (Tile *tile)
|
|||
|
||||
/* Increment this tile's reference count.
|
||||
*/
|
||||
|
||||
TILE_MUTEX_LOCK (tile);
|
||||
tile->ref_count++;
|
||||
|
||||
if (tile->ref_count == 1)
|
||||
|
@ -143,8 +141,6 @@ tile_lock (Tile *tile)
|
|||
tile_swap_in (tile);
|
||||
}
|
||||
|
||||
TILE_MUTEX_UNLOCK (tile);
|
||||
|
||||
/* Call 'tile_manager_validate' if the tile was invalid.
|
||||
*/
|
||||
if (! tile->valid)
|
||||
|
@ -162,8 +158,6 @@ tile_release (Tile *tile,
|
|||
*/
|
||||
tile_ref_count--;
|
||||
|
||||
TILE_MUTEX_LOCK (tile);
|
||||
|
||||
/* Decrement this tile's reference count.
|
||||
*/
|
||||
tile->ref_count--;
|
||||
|
@ -202,8 +196,6 @@ tile_release (Tile *tile,
|
|||
tile_cache_insert (tile);
|
||||
}
|
||||
}
|
||||
|
||||
TILE_MUTEX_UNLOCK (tile);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -256,8 +248,6 @@ tile_destroy (Tile *tile)
|
|||
if (tile->listhead)
|
||||
tile_cache_flush (tile);
|
||||
|
||||
TILE_MUTEX_UNLOCK (tile);
|
||||
|
||||
g_free (tile);
|
||||
|
||||
tile_count--;
|
||||
|
@ -303,11 +293,7 @@ tile_is_valid (Tile *tile)
|
|||
void
|
||||
tile_mark_valid (Tile *tile)
|
||||
{
|
||||
TILE_MUTEX_LOCK (tile);
|
||||
|
||||
tile->valid = TRUE;
|
||||
|
||||
TILE_MUTEX_UNLOCK (tile);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -375,11 +361,7 @@ tile_detach (Tile *tile,
|
|||
tile->share_count--;
|
||||
|
||||
if (tile->share_count == 0 && tile->ref_count == 0)
|
||||
{
|
||||
tile_destroy (tile);
|
||||
return;
|
||||
}
|
||||
TILE_MUTEX_UNLOCK (tile);
|
||||
tile_destroy (tile);
|
||||
}
|
||||
|
||||
gpointer
|
||||
|
@ -387,7 +369,7 @@ tile_data_pointer (Tile *tile,
|
|||
gint xoff,
|
||||
gint yoff)
|
||||
{
|
||||
gint offset = yoff * tile->ewidth + xoff;
|
||||
gsize offset = yoff * tile->ewidth + xoff;
|
||||
|
||||
return (gpointer) (tile->data + offset * tile->bpp);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue