Patch: don't save tiles that are equal to the default tile

Boudewijn Rempt boud at valdyas.org
Tue Mar 16 15:29:11 CET 2010


On Tuesday 16 March 2010, Dmitry Kazakov wrote:
> On Tue, Mar 16, 2010 at 4:33 PM, Boudewijn Rempt <boud at valdyas.org> wrote:
> > On Tue, 16 Mar 2010, Dmitry Kazakov wrote:
> > > I don't think we need this.
> > > 
> > > KisTileHashTableIterator returns the number of non-default tiles, or
> > 
> > (more
> > 
> > > precisely) the number of preallocated tiles. After you fixed the
> > > extents bug, these terms coincide. So this check is superfluous.
> > 
> > Isn't it so that within a rectangle of allocated tiles there can be
> > unallocated, default pixel, tiles?
> 
> What do you mean? Which rectangle? extents?

I meant like this

#####
#  ##
#####

the two tiles inside the block of allocated tiles are not allocated; I was 
wondering whether cyrille's patch would make sure those don't get saved as 
full tiles, or whether that already happens.


> If they are unallocated, they are not returned by the iterator. If they are
> allocated, but empty (store default value), this is some subtle bug of the
> calling code, i guess. This can happen if we use non-const iterator for
> reading, or if we just direct copy data from empty device, but this is
> quite rare case, i think.


-- 
Boudewijn Rempt | http://www.valdyas.org


More information about the kimageshop mailing list