Annotation of 43BSDTahoe/new/X/libqvss/ddxfill.c, revision 1.1.1.1

1.1       root        1: /* fill.c      Perform a simple raster operation a section of the screen
                      2:  *
                      3:  *     PixFill         Do a function on the screen
                      4:  *     StippleFill     Fill rectangle with a stipple pattern
                      5:  *
                      6:  *     Modification History
                      7:  *
                      8:  *     Carver 8510.25 Removed error checking in calls to copyrmsk
                      9:  *                    and copybmsk.  No errors are ever return.
                     10:  *
                     11:  */
                     12: 
                     13: #include "ddxqvss.h"
                     14: #include "qvss.h"
                     15: #include "vstagbl.h"
                     16: 
                     17: extern BITMAP pbm;
                     18: 
                     19: /*ARGSUSED*/
                     20: PixFill (srcpix, xymask, dstx, dsty, width, height, clips, clipcount,
                     21:         func, zmask)
                     22:        int srcpix, dstx, dsty, width, height, clipcount, zmask;
                     23:        register BITMAP *xymask;
                     24:        register int func;
                     25:        CLIP *clips;
                     26: {
                     27:        int constant = srcpix & 1;
                     28: 
                     29:        if (!(zmask & 1)) {
                     30:            return;
                     31:        }
                     32:        if (xymask == 0)
                     33:          {
                     34:          copyrmsk (VSTA$K_SRC_CONST, constant, 0, 0, 0, 0,
                     35:                          width, height, (short *) pbm.data,
                     36:                          pbm.width, pbm.height, dstx, dsty, func,
                     37:                          clipcount, clips);
                     38:          return;
                     39:          }
                     40: 
                     41:        copybmsk (VSTA$K_SRC_CONST, constant, 0, 0, 0, 0,
                     42:                        (short *) xymask->data, xymask->width, 
                     43:                        xymask->height, 0, 0, width, height, 
                     44:                        (short *) pbm.data,
                     45:                        pbm.width, pbm.height, dstx, dsty, func,
                     46:                        clipcount, clips);
                     47:        return;
                     48: }
                     49: 
                     50: extern int errno;
                     51: #include <errno.h>
                     52: 
                     53: int StippleFill (srcpix, xoff, yoff, stipmask, dstx, dsty, width, height,
                     54:        clips, clipcount, func, zmask)
                     55:        int srcpix;             /* source pixel */
                     56:        int xoff, yoff;         /* stipple origin */
                     57:        BITMAP *stipmask;       /* stipple mask */
                     58:        int dstx, dsty;         /* destination */
                     59:        int width, height;
                     60:        CLIP *clips;            /* clipping rectangles */
                     61:        int clipcount;
                     62:        int func;               /* GX display function */
                     63:        int zmask;              /* plane mask */
                     64: {
                     65:        static char funcmap[16][2] = {
                     66:                {GXandInverted, GXandInverted}, /* GXclear */
                     67:                {GXandInverted, GXnoop},        /* GXand */
                     68:                {GXandInverted, GXxor},         /* GXandReverse */
                     69:                {GXandInverted, GXor},          /* GXcopy */
                     70:                {GXnoop,        GXandInverted}, /* GXandInverted */
                     71:                {GXnoop,        GXnoop},        /* GXnoop */
                     72:                {GXnoop,        GXxor},         /* GXxor */
                     73:                {GXnoop,        GXor},          /* GXor */
                     74:                {GXxor,         GXandInverted}, /* GXnor */
                     75:                {GXxor,         GXnoop},        /* GXequiv */
                     76:                {GXxor,         GXxor},         /* GXinvert */
                     77:                {GXxor,         GXor},          /* GXorReverse */
                     78:                {GXor,          GXandInverted}, /* GXcopyInverted */
                     79:                {GXor,          GXnoop},        /* GXorInverted */
                     80:                {GXor,          GXxor},         /* GXnand */
                     81:                {GXor,          GXor}           /* GXset */
                     82:        };
                     83:        int newfunc = funcmap [func][srcpix & 1];
                     84:                
                     85:        if (!(zmask & 1)) {
                     86:            return (1);
                     87:        }
                     88:        if ((stipmask->width != 16) || (stipmask->height != 16)) {
                     89:                errno = EINVAL;
                     90:                return (0);
                     91:        }
                     92:        copyrmsk (VSTA$K_SRC_HT_BITMAP, (short *)stipmask->data, 
                     93:                stipmask->width, stipmask->height, xoff, yoff,
                     94:                width, height,
                     95:                (short *)pbm.data, pbm.width, pbm.height,
                     96:                dstx, dsty, newfunc, clipcount, clips);
                     97:        return (1);
                     98: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.