Update cocoa.m to match new DisplayState code (Samuel Benson)
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>
Wed, 4 Mar 2009 19:25:22 +0000 (19:25 +0000)
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>
Wed, 4 Mar 2009 19:25:22 +0000 (19:25 +0000)
commit36665569d808c85b2fede7b4998db8e9e401f275
treebbe30ff8557f1e231ec986a63f97da4dc0dc91cc
parent31c2758df2bf797aac143a7b3cdaa589df6225bf
Update cocoa.m to match new DisplayState code (Samuel Benson)

Version 2 does as follows:

[1]: Corrects endianness on issues by using native BGR to RGB conversion
[2]: Uses DisplayState accessors for obtaining graphics context information,
     which
[3]: Removes now unused variables, and
[4]: Allows reading of varying color modes (32bit/24/16), and converting to
     native colorspace
[5]: Attempts to keep itself centered on screen (as opposed to bottom right,
     which immediately goes off screen after bios load) on context changes
    (window resizes)

Testing working on i386 (gentoo, Windows 2000) and PPC (debian) guests on PPC
and x86 Macs.

In regards to [4], Windows 2000 displays fine on quick tests, but on the lowest
setting I could test, 16bit color depth at 4bpp, colors are slightly off. I
used gentoo install-x86-minimal-2008.0 in framebuffer mode to test above
setting; the usual grey text is now blue, and Tux appears to be BGR shifted. I
do not know if previous code worked at such a low color setting.

Signed-off-by: Samuel Benson <qemu_ml@digitalescape.info>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6683 c046a42c-6fe2-441c-8c8c-71466251a162
cocoa.m