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

[Xen-changelog] [xen-unstable] ioemu: simplyfing vga_draw_text code



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1213020318 -3600
# Node ID adf05a812edb5a9b4479cb8991102f7fa9c15e2f
# Parent  2197a263a300b3b83509bd3276d762db119fce65
ioemu: simplyfing vga_draw_text code
Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
---
 tools/ioemu/hw/vga.c     |   15 +++++----------
 tools/ioemu/hw/vga_int.h |    1 +
 2 files changed, 6 insertions(+), 10 deletions(-)

diff -r 2197a263a300 -r adf05a812edb tools/ioemu/hw/vga.c
--- a/tools/ioemu/hw/vga.c      Mon Jun 09 13:26:30 2008 +0100
+++ b/tools/ioemu/hw/vga.c      Mon Jun 09 15:05:18 2008 +0100
@@ -1065,8 +1065,6 @@ typedef unsigned int rgb_to_pixel_dup_fu
 
 static rgb_to_pixel_dup_func *rgb_to_pixel_dup_table[NB_DEPTHS];
 
-static int old_depth = 0;
-
 /* 
  * Text mode update 
  * Missing:
@@ -1115,13 +1113,10 @@ static void vga_draw_text(VGAState *s, i
 
     s->last_scr_width = width * cw;
     s->last_scr_height = height * cheight;
-    if (s->ds->dpy_resize_shared && old_depth) {
-        dpy_resize_shared(s->ds, s->last_scr_width, s->last_scr_height, 0, 
s->last_scr_width * (s->ds->depth / 8), NULL);
-        old_depth = 0;
-        full_update = 1;
-    } else if (width != s->last_width || height != s->last_height ||
-        cw != s->last_cw || cheight != s->last_ch) {
+    if (width != s->last_width || height != s->last_height ||
+        cw != s->last_cw || cheight != s->last_ch || s->last_depth) {
         dpy_resize(s->ds, s->last_scr_width, s->last_scr_height);
+        s->last_depth = 0;
         full_update = 1;
     }
     s->last_width = width;
@@ -1532,14 +1527,14 @@ static void vga_draw_graphic(VGAState *s
         if (s->line_offset != s->last_line_offset || 
             disp_width != s->last_width ||
             height != s->last_height ||
-            old_depth != depth) {
+            s->last_depth != depth) {
             dpy_resize_shared(s->ds, disp_width, height, depth, 
s->line_offset, s->vram_ptr + (s->start_addr * 4));
             s->last_scr_width = disp_width;
             s->last_scr_height = height;
             s->last_width = disp_width;
             s->last_height = height;
             s->last_line_offset = s->line_offset;
-            old_depth = depth;
+            s->last_depth = depth;
             full_update = 1;
         } else if (s->ds->shared_buf && (full_update || s->ds->data != 
s->vram_ptr + (s->start_addr * 4)))
             s->ds->dpy_setdata(s->ds, s->vram_ptr + (s->start_addr * 4));
diff -r 2197a263a300 -r adf05a812edb tools/ioemu/hw/vga_int.h
--- a/tools/ioemu/hw/vga_int.h  Mon Jun 09 13:26:30 2008 +0100
+++ b/tools/ioemu/hw/vga_int.h  Mon Jun 09 15:05:18 2008 +0100
@@ -135,6 +135,7 @@
     uint8_t last_cw, last_ch;                                           \
     uint32_t last_width, last_height; /* in chars or pixels */          \
     uint32_t last_scr_width, last_scr_height; /* in pixels */           \
+    uint32_t last_depth; /* in bits */                                  \
     uint8_t cursor_start, cursor_end;                                   \
     uint32_t cursor_offset;                                             \
     unsigned int (*rgb_to_pixel)(unsigned int r,                        \

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


 


Rackspace

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