[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: [patch] shade sorted column in KListView
From:       Martin Koller <m.koller () surfeu ! at>
Date:       2004-12-07 21:42:54
Message-ID: 200412072242.55269.m.koller () surfeu ! at
[Download RAW message or body]


On Tuesday 07 December 2004 22:19, Alexander Neundorf wrote:
> Am I right that backGroundColor() is called for every cell of the listview
> ? How about the performance impact ?
> It adds at one function call to each paintCell() everywhere in KDE where a
> KListView is used. How expensive are the color conversions ? hsv(), dark(),
> light() ?

In fact the new function does nearly the same as the other backgroundColor() 
which was used before in paintCell.

The calculation for the different color is only triggered for the cells in the 
sorted column (which are currently visible).

The dark() and light() calculations are rather inexpensive, as they only do a 
multiplication/division.
Also some mult/divs in hsv().
I did not see a performance loss. 

> Could this be calculated once when the colors are set and the 
> results stored so that they are only reused in paintCell() ?

Could be done, but I really don't think this is necessary here.

-- 
Best regards/Schöne Grüße

Martin    ()  ascii ribbon campaign - against html mail 
          /\                        - against microsoft attachments

       Some operating systems are called 'user friendly',
             Linux however is 'expert friendly'.

[Attachment #3 (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic