KisTileMediator

Casper Boemann cbr at boemann.dk
Wed Aug 11 23:23:10 CEST 2004


On Wednesday 11 August 2004 19:30, Boudewijn Rempt wrote:
> I noticed that Adrian was hacking a bit on KisTileMediator. This class
> contains references to every tile in existence and is only used to
> determine the x,y coordinates of a given tile in the rendering stack:
>
>
> void KisTileMgr::tileCoord(const KisTileSP& tile, QPoint& coord)
> {
> 	Q_INT32 tilenum = m_mediator -> tileNum(tile, this);
>
> 	if (tilenum == TILE_NOT_ATTACHED)
> 		return;
>
> 	coord.setX(TILE_WIDTH * (tilenum % m_ntileCols));
> 	coord.setY(TILE_HEIGHT * (tilenum / m_ntileCols));
> }
>
> I'm wondering whether we really need this. It's a relatively expensive way
> of discovering the x,y of a given tile, I feel.

we sure don't need it, especially since tiles are never again public 
knowledge.

> In other news: I'm removing the validate() calls that were originally
> intended to signal the tile manager to load tiles from disk back into
> memory. I feel that in any case the tile manager clients shouldn't have to
> worry their pretty little heads about virtual memory management, and
> besides, it isn't used for anything useful at present.
yes,yes yes

> Same with the tile's 
> dirty flag.
and yes :-)

-- 
best regards
Casper Boemann


More information about the kimageshop mailing list