mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-31 04:25:40 +00:00
Changed the font VRAM usage calculation to actually only include texture data
This commit is contained in:
parent
7a3a8f8042
commit
82f6686cbf
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue