Module Name: src
Committed By: macallan
Date: Tue Oct 23 15:12:59 UTC 2012
Modified Files:
src/sys/dev/rasops: rasops32.c
Log Message:
make anti-aliased character drawing work on hardware where stride != width *
bytes per pixel
To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/rasops/rasops32.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/rasops/rasops32.c
diff -u src/sys/dev/rasops/rasops32.c:1.24 src/sys/dev/rasops/rasops32.c:1.25
--- src/sys/dev/rasops/rasops32.c:1.24 Wed Jan 4 17:01:52 2012
+++ src/sys/dev/rasops/rasops32.c Tue Oct 23 15:12:59 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: rasops32.c,v 1.24 2012/01/04 17:01:52 macallan Exp $ */
+/* $NetBSD: rasops32.c,v 1.25 2012/10/23 15:12:59 macallan Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rasops32.c,v 1.24 2012/01/04 17:01:52 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rasops32.c,v 1.25 2012/10/23 15:12:59 macallan Exp $");
#include "opt_rasops.h"
@@ -166,6 +166,7 @@ rasops32_putchar_aa(void *cookie, int ro
struct rasops_info *ri = (struct rasops_info *)cookie;
struct wsdisplay_font *font = PICK_FONT(ri, uc);
int32_t *dp, *rp, *hp, *hrp;
+ uint8_t *rrp;
u_char *fr;
int x, y, r, g, b, aval;
int r1, g1, b1, r0, g0, b0;
@@ -185,7 +186,8 @@ rasops32_putchar_aa(void *cookie, int ro
if (!CHAR_IN_FONT(uc, font))
return;
- rp = (int32_t *)(ri->ri_bits + row*ri->ri_yscale + col*ri->ri_xscale);
+ rrp = (ri->ri_bits + row*ri->ri_yscale + col*ri->ri_xscale);
+ rp = (int32_t *)rrp;
if (ri->ri_hwbits)
hrp = (int32_t *)(ri->ri_hwbits + row*ri->ri_yscale +
col*ri->ri_xscale);
@@ -223,7 +225,7 @@ rasops32_putchar_aa(void *cookie, int ro
b1 = clr[1] & 0xff;
for (y = 0; y < height; y++) {
- dp = rp + ri->ri_width * y;
+ dp = (uint32_t *)(rrp + ri->ri_stride * y);
for (x = 0; x < width; x++) {
aval = *fr;
if (aval == 0) {