forked from len0rd/rockbox
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
This commit is contained in:
parent
84c7d6133b
commit
c23ce62829
4 changed files with 123 additions and 13 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue