MCPcopy Create free account
hub / github.com/NazaraEngine/NazaraEngine / ClearGlyphCache

Method ClearGlyphCache

src/Nazara/Utility/Font.cpp:41–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39 }
40
41 void Font::ClearGlyphCache()
42 {
43 if (m_atlas)
44 {
45 if (m_atlas.unique())
46 m_atlas->Clear(); // Appellera OnAtlasCleared
47 else
48 {
49 // Au moins une autre police utilise cet atlas, on vire nos glyphes un par un
50 for (auto mapIt = m_glyphes.begin(); mapIt != m_glyphes.end(); ++mapIt)
51 {
52 GlyphMap& glyphMap = mapIt->second;
53 for (auto glyphIt = glyphMap.begin(); glyphIt != glyphMap.end(); ++glyphIt)
54 {
55 Glyph& glyph = glyphIt->second;
56 m_atlas->Free(&glyph.atlasRect, &glyph.layerIndex, 1);
57 }
58 }
59
60 // Destruction des glyphes mémorisés et notification
61 m_glyphes.clear();
62
63 OnFontGlyphCacheCleared(this);
64 }
65 }
66 }
67
68 void Font::ClearKerningCache()
69 {

Callers

nothing calls this directly

Calls 4

ClearMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
FreeMethod · 0.45

Tested by

no test coverage detected