Re: [AD] grab_font_from_bitmap speedup patch

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Sun, 2007-02-04 at 12:15 +0100, Evert Glebbeek wrote:
> See http://www.allegro.cc/forums/thread/589885 for background information.
> Essentially, the current implementation scans the entire bitmap for the 
> presence of an alpha channel for each character in the font - which can 
> slow things down pretty badly.
> The attached patch (untested) only does the scan once for each call to 
> grab_font_from_bitmap.
> 

We use "color" spelling (c.f. bitmap_color_depth) so please also use it
for variable names :)

I'm also not very happy about the global variable, as it makes it non
thread safe (and grabbing two fonts from two threads is probably as
(un-)likely as grabbing them from system bitmaps..). So I would prefer
to make it a function parameter to font_find_character instead.

-- 
Elias Pschernig





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/