]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Fix handling of wide characters in gfxterm.
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Thu, 12 Jan 2012 21:16:07 +0000 (22:16 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Thu, 12 Jan 2012 21:16:07 +0000 (22:16 +0100)
* grub-core/term/gfxterm.c (grub_colored_char): Remove width and index.
(clear_char): Likewise.
(paint_char): Skip code == NULL chars.
(grub_gfxterm_putchar): Set code = NULL on "shadowed" positions.

ChangeLog
grub-core/term/gfxterm.c

index 76dea17a9617ac11a4b36a7cc5639b98e80e10c2..6aa1a8a59748c771116e580c0215ec963ef7d04b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2012-01-12  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       Fix handling of wide characters in gfxterm.
+
+       * grub-core/term/gfxterm.c (grub_colored_char): Remove width and index.
+       (clear_char): Likewise.
+       (paint_char): Skip code == NULL chars.
+       (grub_gfxterm_putchar): Set code = NULL on "shadowed" positions.
+
 2012-01-12  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/normal/charset.c: Move comment to right place.
index 0eee6410556addadc9f36d2499fae644fde13553..5ecd7c5b5ec4f24bc75530b7f88c928858539714 100644 (file)
@@ -54,12 +54,6 @@ struct grub_colored_char
   /* Color values.  */
   grub_video_color_t fg_color;
   grub_video_color_t bg_color;
-
-  /* The width of this character minus one.  */
-  unsigned char width;
-
-  /* The column index of this character.  */
-  unsigned char index;
 };
 
 struct grub_virtual_screen
@@ -187,8 +181,6 @@ clear_char (struct grub_colored_char *c)
     grub_errno = GRUB_ERR_NONE;
   c->fg_color = virtual_screen.fg_color;
   c->bg_color = virtual_screen.bg_color;
-  c->width = 0;
-  c->index = 0;
 }
 
 static void
@@ -621,7 +613,8 @@ paint_char (unsigned cx, unsigned cy)
   p = (virtual_screen.text_buffer
        + cx + (cy * virtual_screen.columns));
 
-  p -= p->index;
+  if (!p->code)
+    return;
 
   /* Get glyph for character.  */
   glyph = grub_font_construct_glyph (virtual_screen.font, p->code);
@@ -885,8 +878,6 @@ grub_gfxterm_putchar (struct grub_term_output *term,
        grub_errno = GRUB_ERR_NONE;
       p->fg_color = virtual_screen.fg_color;
       p->bg_color = virtual_screen.bg_color;
-      p->width = char_width - 1;
-      p->index = 0;
 
       /* If we have large glyph, add fixup info.  */
       if (char_width > 1)
@@ -898,11 +889,7 @@ grub_gfxterm_putchar (struct grub_term_output *term,
                 * virtual_screen.rows; i++)
             {
              grub_free (p[i].code);
-              p[i].code = grub_unicode_glyph_from_code (' ');
-             if (!p[i].code)
-               grub_errno = GRUB_ERR_NONE;
-              p[i].width = char_width - 1;
-              p[i].index = i;
+              p[i].code = NULL;
             }
         }