|
From: | Vincent Caron |
Subject: | Re: [ngl-devel] nglFontLayout perfs |
Date: | Tue, 27 Jan 2004 15:56:13 +0100 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 |
Sebastien Metrot wrote:
Going from nglFont1 to nglFont have been quite a perf hit for nui. Maybe we are not using it correctly and you could advise us after a quick look at the code?
nuiLabel code looks alright. Maybe it would be simpler if the layout was actually a non-dynamic member, but you could not change the font in a single lifecycle of the widget. Maybe we could add font switching in nglFontLayout (I remember I had one good reason not to do it, but forgot it :)).
Otherwise, there is something really odd in nglFontBase : the FreeType cache is set to 2KB! nglFontLayout::GetMetrics _will_ be slow as hell since it will rasterize glyphs everytime. I must have postponed this problem and set an horrible number to make sure it would not be forgotten. Rats, missed.
I really don't know what number will do. Will depends on the target. I'll put a good megabyte and wait for complaints about heavy memory usage by nglFontBase. It's only a limit, it will eat less if you require less (growing buffer).
Fix commited.
[Prev in Thread] | Current Thread | [Next in Thread] |