Alpha epilog (was: Bug in Alpha blitting?)

Okay… I’ve done some coding… some testing… some
benchmarking (at least on my box), and this is what I
came up with.

First, I stopped diffing against the 1.1.2 tarball, and
moved instead to CVS. This is primarily because one of
the first changes in the 1.1.3 CVS logs mentions
increasing alpha-blit speed by 100%.

Second, I added a bit more benchmarking code to testalpha.c.
This is only about 7 lines of code, but testalpha now
outputs benchmarks of million-pixels/sec as well as
ms/blit… This should compensate some for blits that are
cropped to the window.

Third, I got rid of the ~180 line bohemouth. Its speed was
comparable to the 9 lines of code I wrote that did the exact
same thing without a hint of the 33% speed increase I
expected from it.

I added support for >= 8 bit alpha channels, as I had done
before… This came at no speed penalty.

I benchmarked the current CVS code against the my new
more-accurate code and found mine was 10%-20% slower.
I left both methods in the SDL_blit.h file, with mine
off by default (in a blitter, speed seems more important
than accuracy).

I have marked this message as an epilog, hoping that it
concludes my little excursion into blitter-hacking. All
told this patch is about 60 lines… I hope it helps
someone. I chalked up experience points if nothing else.
Although I’m (for all intents and purposes) done with this
patch, I’m still open to comments, questions, suggestions,
criticizim, name-calling or what have you.

Enjoy,

-Loren


Great news! Get free KNXmail here!
http://www.knx1070.com
-------------- next part --------------
A non-text attachment was scrubbed…
Name: cvs-alpha-blit.patch
Type: application/octet-stream
Size: 50 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20000505/3bb66772/attachment.obj