[PATCH] Cache returned KIconLoader pixmaps in 4.5.2

Michael Pyne mpyne at purinchu.net
Mon Sep 13 03:57:18 BST 2010


On Monday, September 13, 2010 00:20:40 Matthias Fuchs wrote:
> Works really great now. I have a question though:
> 
> When running my small test program the icon gets cached and then reused,
> though if I run the test again -- i.e. start the program again -- it gets
> also cached again and then reused, but shouldn't it still be in the cache
> from running the program the first time?
> Or does the cache gets cleaned up very fast?

Define "cache". There are two:

1. A process-shared cache, but the catch is that the data must still be 
decoded from PNG (which is how both QImage and QPixmap stream it to storage).
2. A process-local pixmap cache. This essentially stores references to the 
QPixmap that had been read from cache 1 so that it is easy to refer to in the 
future. These pixmaps are already in either X server or GPU memory which is 
why they're much faster.

Cache 1 was always working. All this does is utilize Cache 2 in addition in a 
more sane matter. But since Cache 2 is process-local, every time the 
application exits, you should expect items in it to go away.

Regards,
 - Michael Pyne
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20100912/cde5bb7d/attachment.sig>


More information about the kde-core-devel mailing list