[Mono-winforms-list] libgdiplus/System.Drawing patch: nativesupport for indexed Bitmaps

Jonathan Gilbert 2a5gjx302@sneakemail.com
Mon, 07 Mar 2005 18:18:36 -0500

At 12:01 AM 08/03/2005 +0100, Jordi Mas wrote:
>El dl 07 de 03 del 2005 a les 14:22 -0500, en/na kangaroo va escriure:
>> Do we have new testcases for these patches?
>> jordi,
>> 	If you could hold off on the commit for a day or two while I have time 
>> to test the new functions on PPC for endianess it would be appreciated.
>There are some test cases Test/System.Drawing.Imaging in. But, there are
>no cases for the new code. If Jonathan can provide then it will be cool,
>if not, I'll write them. 

The winforms/endian test happens to cover most of the new code, and my new
winforms/lockbits (attached to the original e-mail as a tarball) covers the
rest. The only issues left are endianness: The only real concern I have is
with the code that forces the opacity. It assumes that it can just "|
0xFF000000", but if Cairo's CAIRO_FORMAT_ARGB doesn't track the platform
then that will end up turning all the pixels red or somesuch. If that
happens, the fix is relatively easy, something like this:

# define OPAQUE (0x000000FF)
# define OPAQUE (0xFF000000)
#endif /* WORDS_BIGENDIAN */

Then, the places where 0xFF000000 is hardwired in the code would be changed
to use the OPAQUE macro.

Jonathan Gilbert