Pressure sensitivity

Patrick Julien freak at codepimps.org
Fri Jan 23 14:52:21 CET 2004


On January 22, 2004 08:32 am, Boudewijn Rempt wrote:
> On Thursday 22 January 2004 14:28, Patrick Julien wrote:
> > > * Wiping the layer between paint operations or recreating it might be
> > > costly.
> >
> > Wiping it would be yes
>
> So deleting the temporary layer after blitting and creating a new one would
> be faster.

yes, well, it depends on how it's used of course.   Some minor improvements to 
the tile manager could really lower the burden of the caller however.

>
> > > * How costly is compositing only the dirty rect of the temporary
> > > layer? I mean, is bitBlting from a section of a layer onto another
> > > layer not very expensive?
> >
> > Well, yes and no, it's less costly that blitting the entire layer but
> > obviously more costly than not doing any work :)
>
> Well, it might have been more difficult to determine which tiles to blit
> instead of just looping through everything.

Again, this could really be helped by some minor improvements.   I think what 
you should be doing is creating you new temporary layer using the copy 
constructor.  By doing so, you get an exact duplicate, but it's actually 
quite fast since no actual copy of data is done, the tiles are now shared 
between the old and new layers but marked copy on write.

>
> > > * Memory consumption... Currently, if I paint a line along the edges of
> > > a large canvas, only the edge tiles will get dirtied and included in
> > > the undo list, I guess. But if I use a big overlay layer, and blt the
> > > dirty rect to the destination layer, all tiles will get dirtied. It
> > > might be possible to optimize this, but I don't look forward to that:
> > > that would be very complicated.
> >
> > Hmm, maybe not, I have to think about the implications of this, we might
> > cut this down if the tiles in the source layer don't exist, then
> > obviously we don't need to do anything.  However, this could have far
> > reaching side effects.
>
> But it would be an interesting improvement... I don't think this is
> something I should mess with myself -- I'll leave that to you :-).

Gee, thanks :)  screwing up is really my specialty :)



More information about the kimageshop mailing list