QRegion

Boudewijn Rempt boud at valdyas.org
Mon Jun 4 21:07:41 CEST 2007


On Monday 04 June 2007, Cyrille Berger wrote:
> On Monday 04 June 2007, Boudewijn Rempt wrote:
> > Where does the use of QRegion show up?
>
> When painting, it takes 40% of the painting time (and 30% of the remaining
> is taken by QMutex). I haven't looked at how faster/slower the projection
> happen.
>
> As for QRegion, I haven't look at how it works, but considering the time
> spend I wouldn't be surprised if it isn't trying to do the merging of each
> QRect one after an other. Ah there doesn't seem to be a way to have our own
> list of rect and then add them all together :/ It sounds like an
> interesting algorithmic problem :)

It uses internally some X11 stuff that's meant for optimizing screen updates. 
Yes, having a class that collects rects, computes the smallest set of the 
biggests possible rects is an interesting problem.

Personally, I'd rather spend time on creating such a class than trying to find 
out how to make Krita work with just dirty rects again -- that leads to 
having to recomposite the union of all dirty rects and locking all of krita 
while doing that. Not so bad for images with only one layer, but really bad 
for realistic images.

If I profile, btw, I get lots and lots and lots of hits for exactBounds() -- 
we really need to figure out how to stop running four iterators to find the 
exact bounds of a paintdevice.

-- 
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: 189 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/kimageshop/attachments/20070604/38081591/attachment.pgp 


More information about the kimageshop mailing list