Pressure sensitivity
Patrick Julien
freak at codepimps.org
Thu Jan 22 14:28:55 CET 2004
On January 22, 2004 08:22 am, Boudewijn Rempt wrote:
> On Thursday 22 January 2004 14:13, Patrick Julien wrote:
> > This makes considerably more sense to me.
>
> It's something that needs investigation, because it also seems necessary
> for a a proper implementation of an anti-aliased brush. (There's some
> pretty scary code in the Gimp to implement this -- but our brush tool isn't
> nearly pretty enough now.
>
> However, there are several concerns with using one big temporary layer that
> worry me a bit:
>
> * Creating the layer might be costly, especially if big.
Nope, it isn't, tiles are created, but not their data, at least, not until you
touch them or give the constructor an initial value. This could even be
extended to not even create the tiles in the image's tile manager, only
create them when this specific tile is created.
> * Wiping the layer between paint operations or recreating it might be
> costly.
Wiping it would be yes
> * 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 :)
> * 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.
More information about the kimageshop
mailing list