qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [4936] Fix detection of 15 bit display depth


From: Blue Swirl
Subject: [Qemu-devel] [4936] Fix detection of 15 bit display depth
Date: Thu, 24 Jul 2008 11:25:31 +0000

Revision: 4936
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4936
Author:   blueswir1
Date:     2008-07-24 11:25:30 +0000 (Thu, 24 Jul 2008)

Log Message:
-----------
Fix detection of 15 bit display depth

Modified Paths:
--------------
    trunk/sdl.c

Modified: trunk/sdl.c
===================================================================
--- trunk/sdl.c 2008-07-23 20:01:27 UTC (rev 4935)
+++ trunk/sdl.c 2008-07-24 11:25:30 UTC (rev 4936)
@@ -89,6 +89,17 @@
     ds->data = screen->pixels;
     ds->linesize = screen->pitch;
     ds->depth = screen->format->BitsPerPixel;
+    /* SDL BitsPerPixel never indicates any values other than
+       multiples of 8, so we need to check for strange depths. */
+    if (ds->depth == 16) {
+        uint32_t mask;
+
+        mask = screen->format->Rmask;
+        mask |= screen->format->Gmask;
+        mask |= screen->format->Bmask;
+        if ((mask & 0x8000) == 0)
+            ds->depth = 15;
+    }
     if (ds->depth == 32 && screen->format->Rshift == 0) {
         ds->bgr = 1;
     } else {






reply via email to

[Prev in Thread] Current Thread [Next in Thread]