Re: [AD] Some questions

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


Sven Sandberg wrote:


There is probably a very small overhead with bmp_write_line(). But note that you only need to call bmp_write_line() once per scanline. So if you are drawing one scanline at a time then the overhead is negligible. AFAIK Allegro never makes a special case for pure memory bitmaps in order to use line[] instead of bmp_write_line().

I tried making a special case for memory bitmaps in FBlend, by jumping accross the call to bmp_write_line and reading line[] directly (this should be an easily predictable jump, so the overhead is quite small). However, I have not been able to measure any speed difference in between that code and simply calling bmp_write_line.

I think Allegro would benefit more from a region locking mechanism, so that the calls only need to made once "per region" instead of once per scan line. Of course, you can always use a region of height 1 to simulate the old behavior if needed. I've put up something like that for the Allegro 5 API, but I think 4.2 would benefit from having it too.




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