KisTileMediator

Boudewijn Rempt boud at valdyas.org
Wed Aug 11 19:30:58 CEST 2004


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.

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. Same with the tile's dirty flag.

-- 
Boudewijn Rempt | http://www.valdyas.org/fading/index.cgi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kimageshop/attachments/20040811/bfe0e67f/attachment.pgp


More information about the kimageshop mailing list