Speeding up gradients

Boudewijn Rempt boud at valdyas.org
Sun Feb 12 15:09:53 CET 2006


Bug http://bugs.kde.org/show_bug.cgi?id=120223 notes that our gradient code is 
a bit on the slow side. I've been looking at it today with valgrind, and the 
lcms conversions are killing us here. Because gradients are defined in 8 bit 
rgb, it makes little sense to do the conversion for every pixel.

I've tried to come up with a fix, using QImage or a plain array of Q_UINT8, 
convert that data to an 8 bit rgba colorspace and then bitblt it. I've had 
some success: creating gradients is now a lot faster. However, the gradients 
aren't correct anymore.

There are two problems: from top left to bottom right there's a clean break, 
and gradients are painted twice, once below and once above that line. And 
antialiasing creates cool artefacts.

But I'm stumped now, and have to go to visit friends anyway, so I'm attaching 
the patch... It must be something really stupid...
-- 
Boudewijn Rempt 
http://www.valdyas.org/fading/index.cgi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gradient.diff
Type: text/x-diff
Size: 6045 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kimageshop/attachments/20060212/d0d22153/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kimageshop/attachments/20060212/d0d22153/attachment.pgp 


More information about the kimageshop mailing list