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 cookie for wsfont to rasops_info.



details:   https://anonhg.NetBSD.org/src/rev/d02eff97022d
branches:  trunk
changeset: 472401:d02eff97022d
user:      ad <ad%NetBSD.org@localhost>
date:      Thu Apr 29 02:49:40 1999 +0000

description:
Add cookie for wsfont to rasops_info.

diffstat:

 sys/dev/rasops/rasops.c |  14 +++++++++++---
 sys/dev/rasops/rasops.h |  13 ++++++++++---
 2 files changed, 21 insertions(+), 6 deletions(-)

diffs (84 lines):

diff -r 0eb4f919f950 -r d02eff97022d sys/dev/rasops/rasops.c
--- a/sys/dev/rasops/rasops.c   Thu Apr 29 02:42:43 1999 +0000
+++ b/sys/dev/rasops/rasops.c   Thu Apr 29 02:49:40 1999 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: rasops.c,v 1.4 1999/04/26 04:27:47 ad Exp $ */
+/*      $NetBSD: rasops.c,v 1.5 1999/04/29 02:49:40 ad Exp $ */
 
 /*
  * Copyright (c) 1999 Andy Doran <ad%NetBSD.org@localhost>
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rasops.c,v 1.4 1999/04/26 04:27:47 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rasops.c,v 1.5 1999/04/29 02:49:40 ad Exp $");
 
 #include "rasops_glue.h"
 
@@ -120,6 +120,8 @@
                        printf("rasops_init: couldn't lock font\n");
                        return (-1);
                }
+               
+               ri->ri_wsfcookie = cookie;
        }
 #endif
        
@@ -218,7 +220,13 @@
                ri->ri_bits += ((ri->ri_stride - ri->ri_emustride) >> 1) & ~3;
                ri->ri_bits += ((ri->ri_height - ri->ri_emuheight) >> 1) * 
                    ri->ri_stride;
-       }
+               
+               ri->ri_yorigin = (int)(ri->ri_bits - ri->ri_origbits) 
+                  / ri->ri_stride;
+               ri->ri_xorigin = (((int)(ri->ri_bits - ri->ri_origbits) 
+                  % ri->ri_stride) * bpp) >> 3;
+       } else
+               ri->ri_xorigin = ri->ri_yorigin = 0;
 
        /*      
         * Fill in defaults for operations set.  XXX this nukes private
diff -r 0eb4f919f950 -r d02eff97022d sys/dev/rasops/rasops.h
--- a/sys/dev/rasops/rasops.h   Thu Apr 29 02:42:43 1999 +0000
+++ b/sys/dev/rasops/rasops.h   Thu Apr 29 02:49:40 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rasops.h,v 1.4 1999/04/26 04:27:47 ad Exp $ */
+/*     $NetBSD: rasops.h,v 1.5 1999/04/29 02:49:40 ad Exp $ */
 
 /*
  * Copyright (c) 1999 Andy Doran <ad%NetBSD.org@localhost>
@@ -41,8 +41,12 @@
        int     ri_height;      /* height (pels) */
        int     ri_stride;      /* stride in bytes */
 
-       /* These can optionally be left empty */
+       /* 
+        * These can optionally be left empty. If you fill ri_font,
+        * but aren't using wsfont, set ri_wsfcookie to -1.
+        */
        struct  wsdisplay_font *ri_font;
+       int     ri_wsfcookie;
        void    *ri_priv;       /* driver private data */
        u_char  ri_forcemono;   /* force monochrome operation */
        u_char  ri_swab;        /* swap bytes for 15/16/32 bit depths? */
@@ -74,6 +78,8 @@
        int     ri_xscale;      /* fontwidth * pelbytes */
        int     ri_yscale;      /* fontheight * stride */
        u_char  *ri_origbits;   /* where screen bits actually start */
+       int     ri_xorigin;     /* where ri_bits begins (x) */
+       int     ri_yorigin;     /* where ri_bits begins (y) */
        
        /* For 15, 16, 24, 32 bits */
        int32_t ri_devcmap[16]; /* device colormap (WSCOL_*) */
@@ -105,7 +111,8 @@
  * rasops_init() takes care of rasops_setfont(). You only need to use this
  * when you want to switch fonts later on. The integer parameters to both
  * are the same. Before calling rasops_setfont(), set ri.ri_font. This
- * should happen at _splhigh_.
+ * should happen at _splhigh_. If (ri_wsfcookie >= 0), you must call
+ * wsfont_unlock() on it first.
  */
 
 /* rasops.c */



Home | Main Index | Thread Index | Old Index