Thinking about large files.

Bart Coppens kde at bartcoppens.be
Mon Jun 20 01:01:25 CEST 2005


On Monday 20 June 2005 00:44, Casper Boemann wrote:
> Great work
Thanks :-)

> but looking at the output it seems like it says it's ok to swab the tiles
> that are currently being displayed. Is that correct?
Well, I reference count the tiles: when an iterator is constructed on the 
tile, it adds one, and when it is destructed, it subtracts one. If the 
reference count is 0, it is ok to swap the tile. (Well, mostly. The internal 
usage of pixelPtr functions don't do this yet, but afaik that's not really 
bad).
The tiles that are currently displayed, are normally just taken from a 
rendered pixmap, so that shouldn't be a problem. And when it swaps, it swaps 
the tiles that are the least recently used (it's not the fastest way, but at 
the moment it suffices).

> Are there some kind of priority involved in when swabing is done and to
> what tiles?
I thought of adding a lower priority to the tiles that were going in a 
memento, so that they would be swapped before the actual tiles. I didn't 
implement this because it would make the basic design a bit harder, but I 
don't think it would be a big problem to add this afterwards.

> Oh and the name KisTileManager seems a bit close to KisTiledDataManager.
> Perhabs KisTileSwabMgr or something would be better?
Ah yes, I couldn't think of a good name for it, and KisTileManager was the 
best I found. But KisTileSwapManager seems indeed finer, I'll have a look at 
renaming it :-)

Bart Coppens


More information about the kimageshop mailing list