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

[Xen-devel] [PATCH 3 of 13] remove bgr



Import "remove bgr" from qemu mainstream.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6335 
c046a42c-6fe2-441c-8c8c-71466251a162

Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>

---

diff --git a/hw/musicpal.c b/hw/musicpal.c
index d6bd9ec..44a5659 100644
--- a/hw/musicpal.c
+++ b/hw/musicpal.c
@@ -835,7 +835,7 @@ static void lcd_refresh(void *opaque)
         break;
     LCD_REFRESH(8, rgb_to_pixel8)
     LCD_REFRESH(16, rgb_to_pixel16)
-    LCD_REFRESH(32, (s->ds->bgr ? rgb_to_pixel32bgr : rgb_to_pixel32))
+    LCD_REFRESH(32, rgb_to_pixel32)
     default:
         cpu_abort(cpu_single_env, "unsupported colour depth %i\n",
                   ds_get_bits_per_pixel(s->ds));
diff --git a/hw/tcx.c b/hw/tcx.c
index de4fda0..dd3ac37 100644
--- a/hw/tcx.c
+++ b/hw/tcx.c
@@ -61,22 +61,13 @@ static void update_palette_entries(TCXState *s, int start, 
int end)
             s->palette[i] = rgb_to_pixel8(s->r[i], s->g[i], s->b[i]);
             break;
         case 15:
-            if (s->ds->bgr)
-                s->palette[i] = rgb_to_pixel15bgr(s->r[i], s->g[i], s->b[i]);
-            else
-                s->palette[i] = rgb_to_pixel15(s->r[i], s->g[i], s->b[i]);
+            s->palette[i] = rgb_to_pixel15(s->r[i], s->g[i], s->b[i]);
             break;
         case 16:
-            if (s->ds->bgr)
-                s->palette[i] = rgb_to_pixel16bgr(s->r[i], s->g[i], s->b[i]);
-            else
-                s->palette[i] = rgb_to_pixel16(s->r[i], s->g[i], s->b[i]);
+            s->palette[i] = rgb_to_pixel16(s->r[i], s->g[i], s->b[i]);
             break;
         case 32:
-            if (s->ds->bgr)
-                s->palette[i] = rgb_to_pixel32bgr(s->r[i], s->g[i], s->b[i]);
-            else
-                s->palette[i] = rgb_to_pixel32(s->r[i], s->g[i], s->b[i]);
+            s->palette[i] = rgb_to_pixel32(s->r[i], s->g[i], s->b[i]);
             break;
         }
     }
@@ -134,12 +125,11 @@ static inline void tcx24_draw_line32(TCXState *s1, 
uint8_t *d,
                                      const uint32_t *cplane,
                                      const uint32_t *s24)
 {
-    int x, bgr, r, g, b;
+    int x, r, g, b;
     uint8_t val, *p8;
     uint32_t *p = (uint32_t *)d;
     uint32_t dval;
 
-    bgr = s1->ds->bgr;
     for(x = 0; x < width; x++, s++, s24++) {
         if ((be32_to_cpu(*cplane++) & 0xff000000) == 0x03000000) {
             // 24-bit direct, BGR order
@@ -148,10 +138,7 @@ static inline void tcx24_draw_line32(TCXState *s1, uint8_t 
*d,
             b = *p8++;
             g = *p8++;
             r = *p8++;
-            if (bgr)
-                dval = rgb_to_pixel32bgr(r, g, b);
-            else
-                dval = rgb_to_pixel32(r, g, b);
+            dval = rgb_to_pixel32(r, g, b);
         } else {
             val = *s;
             dval = s1->palette[val];
diff --git a/hw/vga.c b/hw/vga.c
index dc43857..4826511 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -1173,10 +1173,7 @@ static inline int get_depth_index(DisplayState *s)
     case 16:
         return 2;
     case 32:
-        if (s->bgr)
-            return 4;
-        else
-            return 3;
+        return 3;
     }
 }
 
diff --git a/sdl.c b/sdl.c
index 7fdaeeb..5ad5413 100644
--- a/sdl.c
+++ b/sdl.c
@@ -52,6 +52,7 @@ static SDL_Cursor *sdl_cursor_normal;
 static SDL_Cursor *sdl_cursor_hidden;
 static int absolute_enabled = 0;
 static int opengl_enabled;
+static uint8_t bgr;
 
 static void sdl_colourdepth(DisplayState *ds, int depth);
 
@@ -119,7 +120,7 @@ static void opengl_setdata(DisplayState *ds, void *pixels)
             tex_type = GL_UNSIGNED_BYTE;
             break;
         case 32:
-            if (!ds->bgr) {
+            if (!bgr) {
                 tex_format = GL_BGRA;
                 tex_type = GL_UNSIGNED_BYTE;
             } else {
@@ -275,9 +276,9 @@ static void sdl_resize_shared(DisplayState *ds, int w, int 
h, int depth, int lin
     if (!ds->shared_buf) {
         ds->depth = screen->format->BitsPerPixel;
        if (screen->format->Bshift > screen->format->Rshift) {
-            ds->bgr = 1;
+            bgr = 1;
         } else {
-            ds->bgr = 0;
+            bgr = 0;
         }
         shared = NULL;
         ds->data = screen->pixels;

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.