[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/2] font: Add font scaling feature to grub_font_draw_glyph()

From: Zhang Boyang
Subject: Re: [PATCH 1/2] font: Add font scaling feature to grub_font_draw_glyph()
Date: Tue, 31 May 2022 20:17:49 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1


In fact it is pretty "fast" because only the displayed glyphs are scaled. That's a very small subset of the whole font. It will be slower if we scale every glyph when loading the font. Also, the scale factor are hard to determine at font loading time, because the video driver may haven't been loaded at that time.

It is possible to cache the scaled glyphs, so only one scaling pass is needed for one glyph. But this will not change the computational complexity because the drawing algorithm itself is O(n) and scaling is also O(n). So I think we can optimize later if this simple-but-slow scaling code become performance bottleneck.

Best Regards,
Zhang Boyang

On 2022/5/31 19:36, Gerd Hoffmann wrote:

+      /* FIXME: Scale bitmap pixel by pixel is slow */

So how about doing the scaling when loading the font,
so you have to do it only once?

take care,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]