~ubuntu-branches/ubuntu/edgy/xorg-server/edgy-updates

« back to all changes in this revision

Viewing changes to ilbm/ilbmhrzvert.c

  • Committer: Bazaar Package Importer
  • Author(s): Rodrigo Parra Novo
  • Date: 2006-07-25 20:06:28 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20060725200628-gjmmd9gxfxdc4ejs
Tags: 1:1.1.1-0ubuntu1
* New Upstream version
* Changed Build-Depends from mesa-swrast-source to mesa-swx11-source,
  following Debian package nomenclature
* Re-did 12_security_policy_in_etc.diff for 1.1.1
* Dropped 15_security_allocate_local.diff (applied upstream)
* Dropped 16_SECURITY_setuid.diff (applied upstream)
* Dropped 000_ubuntu_fix_read_kernel_mapping.patch (applied upstream)
* Dropped 002_ubuntu_fix_for_certain_intel_chipsets.patch (applied upstream)
* Updated versioned Build-Depends on mesa-swx11-source to version
  6.5.0.cvs.20060725-0ubuntu1
* Added arrayobj.c, arrayobj.h, bitset.h & rbadaptors.h to
  GL/symlink-mesa.sh (linked from mesa-swx11-source)
* Added arrayobj.c to default build target on GL/mesa/main

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $XFree86$ */
2
 
/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
3
 
/***********************************************************
4
 
 
5
 
Copyright (c) 1987  X Consortium
6
 
 
7
 
Permission is hereby granted, free of charge, to any person obtaining a copy
8
 
of this software and associated documentation files (the "Software"), to deal
9
 
in the Software without restriction, including without limitation the rights
10
 
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
 
copies of the Software, and to permit persons to whom the Software is
12
 
furnished to do so, subject to the following conditions:
13
 
 
14
 
The above copyright notice and this permission notice shall be included in
15
 
all copies or substantial portions of the Software.
16
 
 
17
 
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
 
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
 
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
20
 
X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21
 
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22
 
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
 
 
24
 
Except as contained in this notice, the name of the X Consortium shall not be
25
 
used in advertising or otherwise to promote the sale, use or other dealings
26
 
in this Software without prior written authorization from the X Consortium.
27
 
 
28
 
 
29
 
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
30
 
 
31
 
                        All Rights Reserved
32
 
 
33
 
Permission to use, copy, modify, and distribute this software and its
34
 
documentation for any purpose and without fee is hereby granted,
35
 
provided that the above copyright notice appear in all copies and that
36
 
both that copyright notice and this permission notice appear in
37
 
supporting documentation, and that the name of Digital not be
38
 
used in advertising or publicity pertaining to distribution of the
39
 
software without specific, written prior permission.
40
 
 
41
 
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
42
 
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
43
 
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
44
 
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
45
 
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
46
 
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
47
 
SOFTWARE.
48
 
 
49
 
******************************************************************/
50
 
/* $XConsortium: ilbmhrzvert.c,v 1.15 94/04/17 20:28:24 dpw Exp $ */
51
 
 
52
 
/* Modified jun 95 by Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be)
53
 
   to use interleaved bitplanes instead of normal bitplanes */
54
 
 
55
 
#ifdef HAVE_DIX_CONFIG_H
56
 
#include <dix-config.h>
57
 
#endif
58
 
 
59
 
#include <X11/X.h>
60
 
 
61
 
#include "gc.h"
62
 
#include "window.h"
63
 
#include "pixmap.h"
64
 
#include "region.h"
65
 
 
66
 
#include "ilbm.h"
67
 
#include "maskbits.h"
68
 
 
69
 
/* horizontal solid line
70
 
   abs(len) > 1
71
 
*/
72
 
ilbmHorzS(pbase, nlwidth, auxDst, depthDst, x1, y1, len, rrops)
73
 
PixelType *pbase;               /* pointer to base of bitmap */
74
 
register int nlwidth;           /* width in longwords of bitmap */
75
 
int auxDst;
76
 
int depthDst;
77
 
int x1;                                         /* initial point */
78
 
int y1;
79
 
int len;                                /* length of line */
80
 
register unsigned char *rrops;
81
 
{
82
 
        register PixelType *addrl;
83
 
        register PixelType startmask;
84
 
        register PixelType endmask;
85
 
        register int nlmiddle;
86
 
        register int d;
87
 
        int saveNLmiddle;
88
 
 
89
 
        /* force the line to go left to right
90
 
           but don't draw the last point
91
 
        */
92
 
        if (len < 0) {
93
 
                x1 += len;
94
 
                x1 += 1;
95
 
                len = -len;
96
 
        }
97
 
 
98
 
        /* all bits inside same longword */
99
 
        if ( ((x1 & PIM) + len) < PPW) {
100
 
                maskpartialbits(x1, len, startmask);
101
 
 
102
 
                for (d = 0; d < depthDst; d++) {
103
 
                        addrl = ilbmScanline(pbase, x1, y1, auxDst);
104
 
                        pbase += nlwidth;       /* @@@ NEXT PLANE @@@ */
105
 
 
106
 
                        switch (rrops[d]) {
107
 
                                case RROP_BLACK:
108
 
                                        *addrl &= ~startmask;
109
 
                                        break;
110
 
                                case RROP_WHITE:
111
 
                                        *addrl |= startmask;
112
 
                                        break;
113
 
                                case RROP_INVERT:
114
 
                                        *addrl ^= startmask;
115
 
                                        break;
116
 
                                case RROP_NOP:
117
 
                                        break;
118
 
                        } /* switch */
119
 
                } /* for (d = ...) */
120
 
        } else {
121
 
                maskbits(x1, len, startmask, endmask, nlmiddle);
122
 
                saveNLmiddle = nlmiddle;
123
 
 
124
 
                for (d = 0; d < depthDst; d++) {
125
 
                        addrl = ilbmScanline(pbase, x1, y1, auxDst);
126
 
                        pbase += nlwidth;       /* @@@ NEXT PLANE @@@ */
127
 
                        nlmiddle = saveNLmiddle;
128
 
 
129
 
                        switch (rrops[d]) {
130
 
                                case RROP_BLACK:
131
 
                                        if (startmask)
132
 
                                                *addrl++ &= ~startmask;
133
 
                                        Duff (nlmiddle, *addrl++ = 0x0);
134
 
                                        if (endmask)
135
 
                                                *addrl &= ~endmask;
136
 
                                        break;
137
 
 
138
 
                                case RROP_WHITE:
139
 
                                        if (startmask)
140
 
                                                *addrl++ |= startmask;
141
 
                                        Duff (nlmiddle, *addrl++ = ~0);
142
 
                                        if (endmask)
143
 
                                                *addrl |= endmask;
144
 
                                        break;
145
 
 
146
 
                                case RROP_INVERT:
147
 
                                        if (startmask)
148
 
                                                *addrl++ ^= startmask;
149
 
                                        Duff (nlmiddle, *addrl++ ^= ~0);
150
 
                                        if (endmask)
151
 
                                                *addrl ^= endmask;
152
 
                                        break;
153
 
 
154
 
                                case RROP_NOP:
155
 
                                        break;
156
 
                        } /* switch */
157
 
                } /* for (d = ... ) */
158
 
        }
159
 
}
160
 
 
161
 
/* vertical solid line
162
 
   this uses do loops because pcc (Ultrix 1.2, bsd 4.2) generates
163
 
   better code.  sigh.  we know that len will never be 0 or 1, so
164
 
   it's OK to use it.
165
 
*/
166
 
 
167
 
ilbmVertS(pbase, nlwidth, auxDst, depthDst, x1, y1, len, rrops)
168
 
PixelType *pbase;               /* pointer to base of bitmap */
169
 
register int nlwidth;           /* width in longwords of bitmap */
170
 
int auxDst;
171
 
int depthDst;
172
 
int x1, y1;                             /* initial point */
173
 
register int len;               /* length of line */
174
 
unsigned char *rrops;
175
 
{
176
 
        register PixelType *addrl;
177
 
        register PixelType bitmask;
178
 
        int saveLen;
179
 
        int d;
180
 
 
181
 
        if (len < 0) {
182
 
                auxDst = -auxDst;
183
 
                len = -len;
184
 
        }
185
 
 
186
 
        saveLen = len;
187
 
 
188
 
        for (d = 0; d < depthDst; d++) {
189
 
                addrl = ilbmScanline(pbase, x1, y1, auxDst);
190
 
                pbase += nlwidth;       /* @@@ NEXT PLANE @@@ */
191
 
                len = saveLen;
192
 
 
193
 
                switch (rrops[d]) {
194
 
                        case RROP_BLACK:
195
 
                                bitmask = rmask[x1 & PIM];
196
 
                                Duff(len, *addrl &= bitmask; ilbmScanlineInc(addrl, auxDst) );
197
 
                                break;
198
 
 
199
 
                        case RROP_WHITE:
200
 
                                bitmask = mask[x1 & PIM];
201
 
                                Duff(len, *addrl |= bitmask; ilbmScanlineInc(addrl, auxDst) );
202
 
                                break;
203
 
 
204
 
                        case RROP_INVERT:
205
 
                                bitmask = mask[x1 & PIM];
206
 
                                Duff(len, *addrl ^= bitmask; ilbmScanlineInc(addrl, auxDst) );
207
 
                                break;
208
 
 
209
 
                        case RROP_NOP:
210
 
                                break;
211
 
                } /* switch */
212
 
        } /* for (d = ...) */
213
 
}