Changed the font VRAM usage calculation to actually only include texture data

This commit is contained in:
Leon Styhre 2024-08-01 10:58:15 +02:00
parent 7a3a8f8042
commit 82f6686cbf

View file

@ -591,16 +591,11 @@ std::shared_ptr<Font> Font::getFromTheme(const ThemeData::ThemeElement* elem,
size_t Font::getMemUsage() const
{
// TODO: Summarize actual textures properly instead.
size_t memUsage {0};
for (auto it = mTextures.cbegin(); it != mTextures.cend(); ++it)
memUsage += (*it)->textureSize.x * (*it)->textureSize.y * 4;
for (auto it = sFallbackFonts.cbegin(); it != sFallbackFonts.cend(); ++it)
memUsage += it->face->data.length;
memUsage += mFontFace->data.length;
return memUsage;
}