ia64/xen-unstable

changeset 17813:adf05a812edb

ioemu: simplyfing vga_draw_text code
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Jun 09 15:05:18 2008 +0100 (2008-06-09)
parents 2197a263a300
children db466cd3412c
files tools/ioemu/hw/vga.c tools/ioemu/hw/vga_int.h
line diff
     1.1 --- a/tools/ioemu/hw/vga.c	Mon Jun 09 13:26:30 2008 +0100
     1.2 +++ b/tools/ioemu/hw/vga.c	Mon Jun 09 15:05:18 2008 +0100
     1.3 @@ -1065,8 +1065,6 @@ typedef unsigned int rgb_to_pixel_dup_fu
     1.4  
     1.5  static rgb_to_pixel_dup_func *rgb_to_pixel_dup_table[NB_DEPTHS];
     1.6  
     1.7 -static int old_depth = 0;
     1.8 -
     1.9  /* 
    1.10   * Text mode update 
    1.11   * Missing:
    1.12 @@ -1115,13 +1113,10 @@ static void vga_draw_text(VGAState *s, i
    1.13  
    1.14      s->last_scr_width = width * cw;
    1.15      s->last_scr_height = height * cheight;
    1.16 -    if (s->ds->dpy_resize_shared && old_depth) {
    1.17 -        dpy_resize_shared(s->ds, s->last_scr_width, s->last_scr_height, 0, s->last_scr_width * (s->ds->depth / 8), NULL);
    1.18 -        old_depth = 0;
    1.19 -        full_update = 1;
    1.20 -    } else if (width != s->last_width || height != s->last_height ||
    1.21 -        cw != s->last_cw || cheight != s->last_ch) {
    1.22 +    if (width != s->last_width || height != s->last_height ||
    1.23 +        cw != s->last_cw || cheight != s->last_ch || s->last_depth) {
    1.24          dpy_resize(s->ds, s->last_scr_width, s->last_scr_height);
    1.25 +        s->last_depth = 0;
    1.26          full_update = 1;
    1.27      }
    1.28      s->last_width = width;
    1.29 @@ -1532,14 +1527,14 @@ static void vga_draw_graphic(VGAState *s
    1.30          if (s->line_offset != s->last_line_offset || 
    1.31              disp_width != s->last_width ||
    1.32              height != s->last_height ||
    1.33 -            old_depth != depth) {
    1.34 +            s->last_depth != depth) {
    1.35              dpy_resize_shared(s->ds, disp_width, height, depth, s->line_offset, s->vram_ptr + (s->start_addr * 4));
    1.36              s->last_scr_width = disp_width;
    1.37              s->last_scr_height = height;
    1.38              s->last_width = disp_width;
    1.39              s->last_height = height;
    1.40              s->last_line_offset = s->line_offset;
    1.41 -            old_depth = depth;
    1.42 +            s->last_depth = depth;
    1.43              full_update = 1;
    1.44          } else if (s->ds->shared_buf && (full_update || s->ds->data != s->vram_ptr + (s->start_addr * 4)))
    1.45              s->ds->dpy_setdata(s->ds, s->vram_ptr + (s->start_addr * 4));
     2.1 --- a/tools/ioemu/hw/vga_int.h	Mon Jun 09 13:26:30 2008 +0100
     2.2 +++ b/tools/ioemu/hw/vga_int.h	Mon Jun 09 15:05:18 2008 +0100
     2.3 @@ -135,6 +135,7 @@
     2.4      uint8_t last_cw, last_ch;                                           \
     2.5      uint32_t last_width, last_height; /* in chars or pixels */          \
     2.6      uint32_t last_scr_width, last_scr_height; /* in pixels */           \
     2.7 +    uint32_t last_depth; /* in bits */                                  \
     2.8      uint8_t cursor_start, cursor_end;                                   \
     2.9      uint32_t cursor_offset;                                             \
    2.10      unsigned int (*rgb_to_pixel)(unsigned int r,                        \