Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/rasops Fix corruption of background-colored white sp...



details:   https://anonhg.NetBSD.org/src/rev/d70ed1f02d7f
branches:  trunk
changeset: 458040:d70ed1f02d7f
user:      rin <rin%NetBSD.org@localhost>
date:      Sun Jul 28 02:51:38 2019 +0000

description:
Fix corruption of background-colored white space and underline when
font width is 8 or 16 on 2bpp screen.

diffstat:

 sys/dev/rasops/rasops2.c |  20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)

diffs (62 lines):

diff -r 92a466fa46f9 -r d70ed1f02d7f sys/dev/rasops/rasops2.c
--- a/sys/dev/rasops/rasops2.c  Sun Jul 28 02:45:52 2019 +0000
+++ b/sys/dev/rasops/rasops2.c  Sun Jul 28 02:51:38 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rasops2.c,v 1.23 2019/07/25 03:02:44 rin Exp $ */
+/*     $NetBSD: rasops2.c,v 1.24 2019/07/28 02:51:38 rin Exp $ */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rasops2.c,v 1.23 2019/07/25 03:02:44 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rasops2.c,v 1.24 2019/07/28 02:51:38 rin Exp $");
 
 #include "opt_rasops.h"
 
@@ -291,7 +291,7 @@
 
        if (uc == ' ') {
                while (height--) {
-                       *(uint16_t *)rp = stamp[0];
+                       rp[0] = rp[1] = stamp[0];
                        rp += rs;
                }
        } else {
@@ -307,8 +307,10 @@
        }
 
        /* Do underline */
-       if ((attr & WSATTR_UNDERLINE) != 0)
-               *(uint16_t *)(rp - (ri->ri_stride << 1)) = stamp[15];
+       if ((attr & WSATTR_UNDERLINE) != 0) {
+               rp -= ri->ri_stride << 1;
+               rp[0] = rp[1] = stamp[15];
+       }
 
        stamp_mutex--;
 }
@@ -420,7 +422,7 @@
 
        if (uc == ' ') {
                while (height--) {
-                       *(uint32_t *)rp = stamp[0];
+                       rp[0] = rp[1] = rp[2] = rp[3] = stamp[0];
                        rp += rs;
                }
        } else {
@@ -438,8 +440,10 @@
        }
 
        /* Do underline */
-       if ((attr & WSATTR_UNDERLINE) != 0)
-               *(uint32_t *)(rp - (ri->ri_stride << 1)) = stamp[15];
+       if ((attr & WSATTR_UNDERLINE) != 0) {
+               rp -= ri->ri_stride << 1;
+               rp[0] = rp[1] = stamp[15];
+       }
 
        stamp_mutex--;
 }



Home | Main Index | Thread Index | Old Index