On Jan 12, 2015, at 10:11 AM, Paolo Bonzini wrote: > > > On 12/01/2015 15:51, Programmingkid wrote: >>>>>> + /* Determines the pixel format of the frame buffer */ + >>>>>> if (surface->format == PIXMAN_b8g8r8x8) { + >>>>>> bitmap_info = kCGBitmapByteOrder32Big | >>>>>> kCGImageAlphaNoneSkipFirst; + } >>>> >>>> That certainly goes into the right direction. >> Thank you. >> >>>> PIXMAN_* is native endian though, so I expect this will work on >>>> the intel macos host you are testing on but will fail on powerpc >>>> macos hosts. >> Unfortunately there appears to be no way to know. The last PowerPC >> Macs came out over 9 years ago. There probably isn't anyone on the >> list who uses one. > > I have one, though it does not have enough memory to run Mac OS X > guests. In any case, pixman clearly says that b8g8r8x8 is BGRA in > host-endianness, so not the same as kCGBitmapByteOrder32Big. > > So your patch just needs something like this in ui/cocoa.m: > > #ifdef HOST_WORDS_BIGENDIAN > #define PIXMAN_BE_b8g8r8x8 PIXMAN_b8g8r8x8 > #else > #define PIXMAN_BE_b8g8r8x8 PIXMAN_x8r8g8b8 > #endif > > so that you can replace PIXMAN_b8g8r8x8 with PIXMAN_BE_x8r8g8b8 in your > test. (You'll also need a matching "else" that restores > kCGBitmapByteOrder32Little---if only for clarity: assuming little-endian > in the initializer is ugly). > > Paolo It doesn't look like my color patch is needed anymore. This repo fixes all color problems - without touching a line of code in cocoa.m! git://git.kraxel.org/qemu branch rebase/console-wip