Fix unwanted cache clearing
This commit is contained in:
@@ -24,6 +24,8 @@ void FontCacheManager::clearCache() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void FontCacheManager::prewarmCache(int fontId, const char* utf8Text, uint8_t styleMask) {
|
void FontCacheManager::prewarmCache(int fontId, const char* utf8Text, uint8_t styleMask) {
|
||||||
|
clearCache();
|
||||||
|
|
||||||
// SD card font prewarm path: prewarm all requested styles in one call
|
// SD card font prewarm path: prewarm all requested styles in one call
|
||||||
auto sdIt = sdCardFonts_.find(fontId);
|
auto sdIt = sdCardFonts_.find(fontId);
|
||||||
if (sdIt != sdCardFonts_.end()) {
|
if (sdIt != sdCardFonts_.end()) {
|
||||||
@@ -51,11 +53,8 @@ void FontCacheManager::prewarmCache(int fontId, const char* utf8Text, uint8_t st
|
|||||||
if (!data || !data->groups) continue;
|
if (!data || !data->groups) continue;
|
||||||
int missed = fontDecompressor_->prewarmCache(data, utf8Text);
|
int missed = fontDecompressor_->prewarmCache(data, utf8Text);
|
||||||
if (missed < 0) {
|
if (missed < 0) {
|
||||||
LOG_DBG("FCM", "prewarmCache: Cache slots full! Clearing and retrying slot allocation.");
|
LOG_DBG("FCM", "prewarmCache: Decompressor slots full during style %d!", i);
|
||||||
clearCache();
|
} else if (missed > 0) {
|
||||||
missed = fontDecompressor_->prewarmCache(data, utf8Text);
|
|
||||||
}
|
|
||||||
if (missed > 0) {
|
|
||||||
LOG_DBG("FCM", "prewarmCache: %d glyph(s) not cached for style %d", missed, i);
|
LOG_DBG("FCM", "prewarmCache: %d glyph(s) not cached for style %d", missed, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user