Re: Icon scaling

On Sat, 2004-03-27 at 22:45, Soeren Sandmann wrote:
> Currently the list view spends a lot of time scaling down icons that
> have a greater nominal size than base size. 
> Every time the list model is asked for an icon, and it finds out that
> that icon is too large, it scales it down. This means that every
> expose of the list view results in a lot icons getting scaled down
> which is showing up on profiles.
> This patch adds the ability to cache these scaled icons. 
> (It also adds a hash table to stop warnings from being displayed more
> than once, but that's not really related).

You want something like 
eel_debug_call_at_shutdown_with_data ((GFreeFunc)g_hash_table_destroy, warned);
in the warning code. That helps us track down other leaks when needed.

Are many icons already at the right size? Maybe we should in
get_icon_from_cache do something like:

if (hash lookup failed && force_nominal) 
  lookup hash for !force_nominal and see if size fits
  if so, use that icon
  possibly register it as force_nominal for faster lookups later

Otherwise the patch looks good.

 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's a leather-clad amnesiac cyborg whom everyone believes is mad. She's a 
mistrustful impetuous wrestler with the power to bend men's minds. They fight 

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]