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

« back to all changes in this revision

Viewing changes to ilbm/ilbmpolypnt.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: xc/programs/Xserver/ilbm/ilbmpolypnt.c,v 3.0 1996/08/18 01:54:07 dawes Exp $ */
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: ilbmpolypnt.c,v 5.6 94/04/17 20:28:30 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
 
#include <X11/Xprotostr.h>
61
 
#include "pixmapstr.h"
62
 
#include "gcstruct.h"
63
 
#include "windowstr.h"
64
 
#include "miscstruct.h"
65
 
#include "regionstr.h"
66
 
#include "scrnintstr.h"
67
 
 
68
 
#include "ilbm.h"
69
 
#include "maskbits.h"
70
 
 
71
 
void
72
 
ilbmPolyPoint(pDrawable, pGC, mode, npt, pptInit)
73
 
        register DrawablePtr pDrawable;
74
 
        GCPtr pGC;
75
 
        int mode;                               /* Origin or Previous */
76
 
        int npt;
77
 
        xPoint *pptInit;
78
 
{
79
 
 
80
 
        register BoxPtr pbox;
81
 
        register int nbox;
82
 
        register int d;
83
 
 
84
 
        register PixelType *addrl;
85
 
        PixelType *pBase;
86
 
        PixelType *pBaseSave;
87
 
        int nlwidth;
88
 
        int auxDst;
89
 
        int depthDst;
90
 
 
91
 
        int nptTmp;
92
 
        register xPoint *ppt;
93
 
 
94
 
        register int x;
95
 
        register int y;
96
 
        register unsigned char *rrops;
97
 
        ilbmPrivGC *pGCPriv;
98
 
 
99
 
        pGCPriv = (ilbmPrivGC *) pGC->devPrivates[ilbmGCPrivateIndex].ptr;
100
 
 
101
 
        ilbmGetPixelWidthAuxDepthAndPointer(pDrawable, nlwidth, auxDst, depthDst,
102
 
                                                                                                        pBaseSave);
103
 
 
104
 
        rrops = pGCPriv->rrops;
105
 
        if ((mode == CoordModePrevious) && (npt > 1))
106
 
                for (ppt = pptInit + 1, nptTmp = npt - 1; --nptTmp >= 0; ppt++) {
107
 
                        ppt->x += (ppt-1)->x;
108
 
                        ppt->y += (ppt-1)->y;
109
 
                }
110
 
 
111
 
        nbox = REGION_NUM_RECTS(pGC->pCompositeClip);
112
 
        pbox = REGION_RECTS(pGC->pCompositeClip);
113
 
        for (; --nbox >= 0; pbox++)
114
 
                for (d = 0, pBase = pBaseSave; d < depthDst; d++, pBase += nlwidth) {   /* @@@ NEXT PLANE @@@ */
115
 
                        addrl = pBase;
116
 
 
117
 
                        switch (rrops[d]) {
118
 
                                case RROP_BLACK:
119
 
                                        for (ppt = pptInit, nptTmp = npt; --nptTmp >= 0; ppt++) {
120
 
                                                x = ppt->x + pDrawable->x;
121
 
                                                y = ppt->y + pDrawable->y;
122
 
                                                if ((x >= pbox->x1) && (x < pbox->x2) &&
123
 
                                                        (y >= pbox->y1) && (y < pbox->y2))
124
 
                                                        *ilbmScanline(addrl, x, y, auxDst) &= rmask[x & PIM];
125
 
                                        }
126
 
                                        break;
127
 
 
128
 
                                case RROP_WHITE:
129
 
                                        for (ppt = pptInit, nptTmp = npt; --nptTmp >= 0; ppt++) {
130
 
                                                x = ppt->x + pDrawable->x;
131
 
                                                y = ppt->y + pDrawable->y;
132
 
                                                if ((x >= pbox->x1) && (x < pbox->x2) &&
133
 
                                                        (y >= pbox->y1) && (y < pbox->y2))
134
 
                                                        *ilbmScanline(addrl, x, y, auxDst) |= mask[x & PIM];
135
 
                                        }
136
 
                                        break;
137
 
 
138
 
                                case RROP_INVERT:
139
 
                                        for (ppt = pptInit, nptTmp = npt; --nptTmp >= 0; ppt++) {
140
 
                                                x = ppt->x + pDrawable->x;
141
 
                                                y = ppt->y + pDrawable->y;
142
 
                                                if ((x >= pbox->x1) && (x < pbox->x2) &&
143
 
                                                        (y >= pbox->y1) && (y < pbox->y2))
144
 
                                                        *ilbmScanline(addrl, x, y, auxDst) ^= mask[x & PIM];
145
 
                                        }
146
 
                                        break;
147
 
 
148
 
                                case RROP_NOP:
149
 
                                        break;
150
 
                        } /* switch */
151
 
                } /* for (d = ...) */
152
 
}