From 8927bcfd339510deedb89ff274ea9cd1d00a2668 Mon Sep 17 00:00:00 2001 From: aliguori Date: Thu, 15 Jan 2009 22:07:16 +0000 Subject: remove bgr (Stefano Stabellini) Do not handle bgr host displays in the backends. Right now a bgr flag exists so that sdl can set it, if the SDL_Surface is bgr. Afterwards the graphic device (e.g. vga.c) does the needed conversion. With this patch series is sdl that is responsible for rendering the format provided by the graphic device that must provide a DisplaySurface (ds->surface) in 16 or 32 bpp, rgb. Afterwards sdl creates a SDL_Surface from the given DisplaySurface and blits it into the main SDL_Surface using SDL_BlitSurface. Everything is handled by sdl transparently, because SDL_BlitSurface is perfectly capable of handling bgr displays by itself. Signed-off-by: Stefano Stabellini Signed-off-by: Anthony Liguori git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6335 c046a42c-6fe2-441c-8c8c-71466251a162 --- hw/tcx.c | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) (limited to 'hw/tcx.c') diff --git a/hw/tcx.c b/hw/tcx.c index 004685bc2b..4d9f527a2f 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]; -- cgit v1.2.3