From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: xen-devel <xen-devel@lists.xensource.com>
Subject: [PATCH 3 of 13] remove bgr
Date: Mon, 2 Mar 2009 17:13:20 +0000 [thread overview]
Message-ID: <49AC13B0.6070708@eu.citrix.com> (raw)
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@eu.citrix.com>
---
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;
reply other threads:[~2009-03-02 17:13 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49AC13B0.6070708@eu.citrix.com \
--to=stefano.stabellini@eu.citrix.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.