When iterating over pixels in the source and/or destination image, the software renderer increments by a variable. It does the equivalent of
dest += image.pixelStride;
This has turned out to cause a performance hit, because previously it would increment by a constant. For example:
PixelRGB* dest;
//...
dest++;
What we need is to take classes like EdgeTableFillers::SolidColour and make specialized versions of those classes which are specific to a given pixelStride (3 or 4). This can be done with inheritance to minimize duplicated code.
In order to call these new classes we would want to introduce a conditional at the higher level:
template <class Iterator, class DestPixelType>
void renderSolidFill (Iterator& iter, const Image::BitmapData& destData, const PixelARGB& fillColour, const bool replaceContents, DestPixelType*) {
if (replaceContents)
{
if (destData.pixelStride==3) {
EdgeTableFillers::SolidColour3 <DestPixelType, true> r (destData, fillColour);
iter.iterate (r);
else if (destData.pixelStride==4) {
EdgeTableFillers::SolidColour4 <DestPixelType, true> r (destData, fillColour);
iter.iterate (r);
}
else {
EdgeTableFillers::SolidColour <DestPixelType, true> r (destData, fillColour);
iter.iterate (r);
}
}
//...