
bulia byak wrote:
Last night, with the help of Carl Worth, the issue of cairo/inkscape not working on mac was more or less clarified. Here's how I understand it.
When drawing into a memory buffer, cairo uses a fixed byte order of the R, G, B, A bytes regardless of the platform.
Inkscape and GDK (which is used by Inkscape for drawing to screen), however, both use system-dependent byte order, i.e. the order of R, G, B, A is determined by the hardware and is different on PC and Mac platforms.
This might cause a problem with a patch I just wrote, as it assumes the alpha channel is the last byte (when using premultiplied alpha, otherwise it doesn't matter), and I imagine there might other places too which assume something about this order. So it might be a good idea to do a thorough overhaul of the code anyway, to make sure everyone is on the same page.
BTW, I would appreciate any pointers on how to properly test for this case without having to do something like cast an array of four bytes to a 32bit integer.