CalcTextSize*() functions which are often speed bottleneck for large contents are about 25% faster.

Caching character advance contiguously, pulled inline, no int->float
conversion.
This commit is contained in:
ocornut
2015-02-11 12:10:45 +00:00
parent ca2de0b89b
commit 1da8a52ce7
2 changed files with 20 additions and 16 deletions

View File

@ -910,6 +910,7 @@ struct ImFont
};
ImFontAtlas* ContainerAtlas; // What we has been loaded into
ImVector<Glyph> Glyphs;
ImVector<float> IndexXAdvance; // Glyphs->XAdvance directly indexable (for CalcTextSize functions which are often bottleneck in large UI)
ImVector<int> IndexLookup; // Index glyphs by Unicode code-point
const Glyph* FallbackGlyph; // == FindGlyph(FontFallbackChar)