Module Name: src Committed By: macallan Date: Sat Apr 22 15:05:03 UTC 2017
Modified Files: src/sys/dev/rasops: rasops.c rasops.h Log Message: add RI_PREFER_ALPHA flag, for drivers that can draw such fonts by hardware To generate a diff of this commit: cvs rdiff -u -r1.74 -r1.75 src/sys/dev/rasops/rasops.c cvs rdiff -u -r1.31 -r1.32 src/sys/dev/rasops/rasops.h 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/rasops.c diff -u src/sys/dev/rasops/rasops.c:1.74 src/sys/dev/rasops/rasops.c:1.75 --- src/sys/dev/rasops/rasops.c:1.74 Thu Feb 23 12:16:30 2017 +++ src/sys/dev/rasops/rasops.c Sat Apr 22 15:05:02 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: rasops.c,v 1.74 2017/02/23 12:16:30 nonaka Exp $ */ +/* $NetBSD: rasops.c,v 1.75 2017/04/22 15:05:02 macallan Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rasops.c,v 1.74 2017/02/23 12:16:30 nonaka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rasops.c,v 1.75 2017/04/22 15:05:02 macallan Exp $"); #include "opt_rasops.h" #include "rasops_glue.h" @@ -208,7 +208,8 @@ rasops_init(struct rasops_info *ri, int flags = WSFONT_FIND_BESTWIDTH | WSFONT_FIND_BITMAP; if ((ri->ri_flg & RI_ENABLE_ALPHA) != 0) flags |= WSFONT_FIND_ALPHA; - + if ((ri->ri_flg & RI_PREFER_ALPHA) != 0) + flags |= WSFONT_PREFER_ALPHA; cookie = wsfont_find(NULL, ri->ri_width / wantcols, 0, @@ -376,14 +377,14 @@ rasops_reconfig(struct rasops_info *ri, if ((ri->ri_delta & 3) != 0) panic("rasops_init: ri_delta not aligned on 32-bit boundary"); #endif + ri->ri_origbits = ri->ri_bits; + ri->ri_hworigbits = ri->ri_hwbits; + /* Clear the entire display */ if ((ri->ri_flg & RI_CLEAR) != 0) memset(ri->ri_bits, 0, ri->ri_stride * ri->ri_height); /* Now centre our window if needs be */ - ri->ri_origbits = ri->ri_bits; - ri->ri_hworigbits = ri->ri_hwbits; - if ((ri->ri_flg & RI_CENTER) != 0) { ri->ri_bits += (((ri->ri_width * bpp >> 3) - ri->ri_emustride) >> 1) & ~3; @@ -1727,7 +1728,7 @@ rasops_make_box_chars_alpha(struct rasop } } } - + /* * Return a colour map appropriate for the given struct rasops_info in the * same form used by rasops_cmap[] Index: src/sys/dev/rasops/rasops.h diff -u src/sys/dev/rasops/rasops.h:1.31 src/sys/dev/rasops/rasops.h:1.32 --- src/sys/dev/rasops/rasops.h:1.31 Thu Apr 19 06:57:39 2012 +++ src/sys/dev/rasops/rasops.h Sat Apr 22 15:05:02 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: rasops.h,v 1.31 2012/04/19 06:57:39 macallan Exp $ */ +/* $NetBSD: rasops.h,v 1.32 2017/04/22 15:05:02 macallan Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -63,6 +63,11 @@ #define RI_ENABLE_ALPHA 0x1000 /* set this in order to use r3g3b2 'true' colour in 8 bit */ #define RI_8BIT_IS_RGB 0x2000 +/* + * drivers can set this to tell the font selection code that they'd rather + * use alpha fonts + */ +#define RI_PREFER_ALPHA 0x4000 struct rasops_info { /* These must be filled in by the caller */