Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/rasops add RI_PREFER_ALPHA flag, for drivers that ca...



details:   https://anonhg.NetBSD.org/src/rev/4957c09a27ca
branches:  trunk
changeset: 823420:4957c09a27ca
user:      macallan <macallan%NetBSD.org@localhost>
date:      Sat Apr 22 15:05:02 2017 +0000

description:
add RI_PREFER_ALPHA flag, for drivers that can draw such fonts by hardware

diffstat:

 sys/dev/rasops/rasops.c |  15 ++++++++-------
 sys/dev/rasops/rasops.h |   7 ++++++-
 2 files changed, 14 insertions(+), 8 deletions(-)

diffs (76 lines):

diff -r d17905e5ba37 -r 4957c09a27ca sys/dev/rasops/rasops.c
--- a/sys/dev/rasops/rasops.c   Sat Apr 22 14:19:36 2017 +0000
+++ b/sys/dev/rasops/rasops.c   Sat Apr 22 15:05:02 2017 +0000
@@ -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 @@
                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 @@
        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 @@
                }
        }
 }
-
+ 
 /*
  * Return a colour map appropriate for the given struct rasops_info in the
  * same form used by rasops_cmap[]
diff -r d17905e5ba37 -r 4957c09a27ca sys/dev/rasops/rasops.h
--- a/sys/dev/rasops/rasops.h   Sat Apr 22 14:19:36 2017 +0000
+++ b/sys/dev/rasops/rasops.h   Sat Apr 22 15:05:02 2017 +0000
@@ -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 */



Home | Main Index | Thread Index | Old Index