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)
commit9794f74f9c1dd0fbef30ded9e5c14c28a6fa579b
treebbe30ff8557f1e231ec986a63f97da4dc0dc91cc
parente53bd70384bba43059a562e0d96b070fbbcce49e
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