Heh, hostility is fun, right? I am not a C programmer,
please pay attention. I have used colorkey, but that is not
a straightforward way to increase speed. Since it involves
a check on each pixel, some images may not benefit (and in
fact will lower performance) if there isn't much
transparency. Wheras a 'blit' on matched pixel format
surfaces can be a simple memory copy operation, depending on
the platform.
To illustrate a use case for an "unsafe blit":Â In tile map
drawing, you will be doing potentially hundreds of blit
operations. Since tile placement is very straightforward,
you can be sure there will be no out-of-bounds blitting.Â
You can enforce pixel formats when the surfaces are loaded.Â
So, format checks are only needed when surfaces are loaded,
not every time there is a blit operation. (Also, this is
just one potential scenario, please don't elaborate on
different way to render a tile-based map, just stick to the
topic: "unsafe/fast blit")
As is, the 'blit' operation removes several chances for error,
especially for people who don't care to convert surfaces or
set clipping regions, but it does so at a performance cost.
It could be as simple as making the following function available
to pygame, perhaps in some inconspicuous place, not a part of
the surface class...in order to discourage abuse:Â