Tiles optimisation

Casper Boemann cbr at boemann.dk
Sun Mar 20 01:11:21 CET 2005


On Saturday 19 March 2005 15:25, Boudewijn Rempt wrote:
> I was reading through the autolayer doc and read:
>
> As there is no way for us to know which pixel have true tiles and which
> have the default, we would write to all the pixels within the extent, which
> would automatically create ALL the tiles inside the extent.
>
> Would it be a possible and useful optimization to add some logic in the
> tile manager (i.e., transparent to the rest of Krita) that does the
> following:
>
> if write to a not-yet-created tile
>  if pixel value == default pixel
>   skip creation of tile & write
>
> ?

Not directly no, because the iterators don't know if any and what is being 
written. They only deliver a pointer to the data.

But some sort of garbage-collector could check if tiles consists of purely 
default values and convert the tile back into a default tile. That 
garbage-collector would need to run occasionally.


> Of course, the two extra if's may well negate any advantage this scheme may
> have except for saving some memory.
The garbage-collector could quite easy take a little piece at a time.


> By the way, when messing about with filters, I noticed that a simple filter
> action can easily double the width of a tile extent beyond the image size.
> I've added some checks to make filters only filter within the visible range
> of the image to prevent that, but that's no solution especially if other
> operations also make paint device extents grow without bounds. Maybe we can
> add some tightening here.
I've seen this remark now a couple of times. I think it may be a bug. Can you 
give me a reproducable example.

-- 
best regards / venlig hilsen
Casper Boemann


More information about the kimageshop mailing list