Optimization for the duplicate paintop

Boudewijn Rempt boud at valdyas.org
Tue May 30 08:10:22 CEST 2006


On Monday 29 May 2006 23:39, Cyrille Berger wrote:
> Hello,
> I was working on optimizing the duplicate paintop, so with the help of
> Boudewijn I was able to cut the computation time by half.
>
> But after that first optimization, 80% of the time is spend in
> bltSelection, and more specificaly in
> KisSelection::isTotallyUnselected(QRect r), and I was wondering if changing
> the following line :
> QRect sr = selectedExactRect();
>
> by
>  QRect sr = selectedRect();
>
> was acceptable ? (it considerably increase the speed of the duplicate tool,
> but might have drawback).

The drawback is that the rect then is aligned with tile boundaries -- which 
means that it is larger than the rect really is. This may not matter too much 
in this particular case. It means that more pixels are considered for 
compositing, and then discarded, but that may well be less costly than my 
(stupid, simple-minded, straightforward, unoptimized) algorith for 
calculating the exact rect.

We use extactRect in many places, though, and optimizing it would be a great 
idea.

-- 
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: 191 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kimageshop/attachments/20060530/f83a7cd6/attachment.pgp 


More information about the kimageshop mailing list