]> Pileus Git - ~andy/gtk/commit
Cache GtkIconInfo
authorAlexander Larsson <alexl@redhat.com>
Mon, 26 Nov 2012 12:49:49 +0000 (13:49 +0100)
committerAlexander Larsson <alexl@redhat.com>
Fri, 30 Nov 2012 10:33:26 +0000 (11:33 +0100)
commit92e904a25710a00b8f1afb0e33a69680712d0c69
treedc8016b0ab6263e715d536d12f11b11937748a43
parente75860e466c51cb4ff5e2833a61185b1b54544e1
Cache GtkIconInfo

In order to avoid loading and keeping around the same icon multiple times
we keep a cache of all outstanding GtkIconInfo objects for a given theme.

Additionally we return to the app not the normal pixbuf from the info,
but rather a proxy copy of it sharing the same data, but no extra
reference. This allows us to track when the app is no longer using
the pixbuf, and we can thus ensure that the GtkIconInfo in the cache
stays around for at least as long as the pixbuf is alive.

When the app unrefs the pixbuf we put the Info on a short LRU list
to keep it alive a bit longer, in case the app needs it in a short
while.

https://bugzilla.gnome.org/show_bug.cgi?id=689081
gtk/gtkicontheme.c