Remove channelmap or prove it works for big-endian
rsvg_filter_render() takes a
channelmap parameter. The only caller passes
I think this parameter was added some time during the transition from libart to Cairo. We use
CAIRO_FORMAT_ARGB32 everywhere, and in it each pixel is platform-endian 0xaarrggbb premultiplied.
So, we have:
/* On little endian */ guchar *pixel = <some pointer>; guchar a = pixel; guchar r = pixel; guchar g = pixel; guchar b = pixel; /* On big endian */ guchar *pixel = <some pointer>; guchar a = pixel; guchar r = pixel; guchar g = pixel; guchar b = pixel;
I think the
"2103" that is being passed is supposed to be able to extract r/g/b/a channels, in that order, from each 32-bit value in Cairo's encoding. But wouldn't that only work for little-endian machines? Does the channelmap value being used even work on big-endian machines?
Tasks for this bug:
Check that filters can extract r/g/b/a correctly on big-endian machines.
Make sure that in fact every function uses the channelmap; some may be poking at bits directly.
Remove the channelmap as an argument into rsvg-filter's entry point, and handle it inside rsvg-filter completely.