diff options
| author | Thomas Martitz <kugel@rockbox.org> | 2014-01-15 13:37:40 +0100 |
|---|---|---|
| committer | Thomas Martitz <kugel@rockbox.org> | 2014-01-15 23:37:39 +0100 |
| commit | c23ce62829d98c2dc78f1fd8a8810cefd0f10402 (patch) | |
| tree | c96a73b513350dabc3d33df2df376d86daa6cac9 /firmware/font_cache.c | |
| parent | 84c7d6133bf8a43688f1ac56d774fb94b1d3eed5 (diff) | |
| download | rockbox-c23ce62829d98c2dc78f1fd8a8810cefd0f10402.zip rockbox-c23ce62829d98c2dc78f1fd8a8810cefd0f10402.tar.gz rockbox-c23ce62829d98c2dc78f1fd8a8810cefd0f10402.tar.bz2 rockbox-c23ce62829d98c2dc78f1fd8a8810cefd0f10402.tar.xz | |
fonts: Do not unload completely on USB.
The font engine can now perform cache lookups even if the font file is
closed, if the font was disabled with the new font_disable_all() function.
It is highly probable that the lookup succeeds but in the cache-miss case
a blank, full-width glyph will be returned.
Change-Id: I3c97e747d2a0ba30c7b495c6118c9f029d265b56
Diffstat (limited to 'firmware/font_cache.c')
| -rw-r--r-- | firmware/font_cache.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/firmware/font_cache.c b/firmware/font_cache.c index 4604d15..0b03eda 100644 --- a/firmware/font_cache.c +++ b/firmware/font_cache.c @@ -125,6 +125,7 @@ static int search(struct font_cache* fcache, struct font_cache_entry* font_cache_get( struct font_cache* fcache, unsigned short char_code, + bool cache_only, void (*callback) (struct font_cache_entry* p, void *callback_data), void *callback_data) { @@ -166,6 +167,8 @@ struct font_cache_entry* font_cache_get( } /* not found */ + if (cache_only) + return NULL; /* find index to replace */ short lru_handle_to_replace = fcache->_lru._head; |