#8822 NORM Not Tri: Create an mmap'able icon cache
Zarro Boogs per Child
bugtracker at laptop.org
Mon Oct 13 06:06:17 EDT 2008
#8822: Create an mmap'able icon cache
-----------------------------+----------------------------------------------
Reporter: benzea | Owner: marco
Type: defect | Status: new
Priority: normal | Milestone: Not Triaged
Component: sugar-toolkit | Version: not specified
Resolution: | Keywords:
Next_action: never set | Verified: 0
Blockedby: | Blocking:
-----------------------------+----------------------------------------------
Comment(by benzea):
I'll attach a preliminary patche. The code needs some cleanup, but it is
able to cache and return the masks (no normal image cache yet). The lookup
in the cache file is filename based, and there are two classes:
SugarIconCache:
* lookup_icon(filename, size)
* new(cache_filename)
SugarIconCacheBuilder:
* add_icon(filename, size)
* write(cache_filename)
There is currently also a public method render_masks, that returns the
same data as a lookup in the IconCache would.
The write happens atomically, and SugarIconCache will recheck after 5
minutes, whether the cache has been updated, and reloads it if it did
change.
--
Ticket URL: <http://dev.laptop.org/ticket/8822#comment:1>
One Laptop Per Child <http://laptop.org/>
OLPC bug tracking system
More information about the Bugs
mailing list