Preload entire font file if the font file isn't efficiently seekable, which should fix very slow startup times on Android.

This commit is contained in:
elasota
2020-11-30 18:43:17 -05:00
parent f0b1d6fff9
commit 6851025147
10 changed files with 136 additions and 44 deletions

View File

@@ -11,6 +11,7 @@
#include "Externs.h"
#include "Environ.h"
#include "FontFamily.h"
#include "FontManager.h"
#include "GpApplicationName.h"
#include "GpRenderedFontMetrics.h"
#include "IGpMutex.h"
@@ -672,7 +673,6 @@ void PreloadFonts()
PortabilityLayer::MemoryManager *mm = PortabilityLayer::MemoryManager::GetInstance();
const int numFontSpecs = sizeof(specs) / sizeof(specs[0]);
int queuedSpecs = 0;
@@ -714,6 +714,8 @@ void PreloadFonts()
StepLoadScreenRing();
Delay(1, nullptr);
}
PortabilityLayer::FontManager::GetInstance()->PurgeCache();
}
struct PreloadAATableSpec