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

« back to all changes in this revision

Viewing changes to ilbm/ilbmbstore.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
 
/* $XConsortium: ilbmbstore.c,v 5.7 94/04/17 20:28:18 dpw Exp $ */
3
 
/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
4
 
/*
5
 
 
6
 
Copyright (c) 1987  X Consortium
7
 
 
8
 
Permission is hereby granted, free of charge, to any person obtaining
9
 
a copy of this software and associated documentation files (the
10
 
"Software"), to deal in the Software without restriction, including
11
 
without limitation the rights to use, copy, modify, merge, publish,
12
 
distribute, sublicense, and/or sell copies of the Software, and to
13
 
permit persons to whom the Software is furnished to do so, subject to
14
 
the following conditions:
15
 
 
16
 
The above copyright notice and this permission notice shall be included
17
 
in all copies or substantial portions of the Software.
18
 
 
19
 
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20
 
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21
 
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
22
 
IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
23
 
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24
 
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25
 
OTHER DEALINGS IN THE SOFTWARE.
26
 
 
27
 
Except as contained in this notice, the name of the X Consortium shall
28
 
not be used in advertising or otherwise to promote the sale, use or
29
 
other dealings in this Software without prior written authorization
30
 
from the X Consortium.
31
 
 
32
 
*/
33
 
 
34
 
/* Modified jun 95 by Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be)
35
 
   to use interleaved bitplanes instead of normal bitplanes */
36
 
 
37
 
#ifdef HAVE_DIX_CONFIG_H
38
 
#include <dix-config.h>
39
 
#endif
40
 
 
41
 
#include        "ilbm.h"
42
 
#include        <X11/X.h>
43
 
#include        "mibstore.h"
44
 
#include        "regionstr.h"
45
 
#include        "scrnintstr.h"
46
 
#include        "pixmapstr.h"
47
 
#include        "windowstr.h"
48
 
 
49
 
/*-
50
 
 *-----------------------------------------------------------------------
51
 
 * ilbmSaveAreas --
52
 
 *              Function called by miSaveAreas to actually fetch the areas to be
53
 
 *              saved into the backing pixmap. This is very simple to do, since
54
 
 *              ilbmDoBitblt is designed for this very thing. The region to save is
55
 
 *              already destination-relative and we're given the offset to the
56
 
 *              window origin, so we have only to create an array of points of the
57
 
 *              u.l. corners of the boxes in the region translated to the screen
58
 
 *              coordinate system and fetch the screen pixmap out of its devPrivate
59
 
 *              field....
60
 
 *
61
 
 * Results:
62
 
 *              None.
63
 
 *
64
 
 * Side Effects:
65
 
 *              Data are copied from the screen into the pixmap.
66
 
 *
67
 
 *-----------------------------------------------------------------------
68
 
 */
69
 
void
70
 
ilbmSaveAreas(pPixmap, prgnSave, xorg, yorg, pWin)
71
 
        PixmapPtr                               pPixmap;                /* Backing pixmap */
72
 
        RegionPtr                               prgnSave;               /* Region to save (pixmap-relative) */
73
 
        int                                                     xorg;                                   /* X origin of region */
74
 
        int                                                     yorg;                                   /* Y origin of region */
75
 
        WindowPtr                               pWin;
76
 
{
77
 
        register DDXPointPtr pPt;
78
 
        DDXPointPtr                             pPtsInit;
79
 
        register BoxPtr         pBox;
80
 
        register int            numRects;
81
 
 
82
 
        numRects = REGION_NUM_RECTS(prgnSave);
83
 
        pPtsInit = (DDXPointPtr)ALLOCATE_LOCAL(numRects * sizeof(DDXPointRec));
84
 
        if (!pPtsInit)
85
 
                return;
86
 
 
87
 
        pBox = REGION_RECTS(prgnSave);
88
 
        pPt = pPtsInit;
89
 
        while (numRects--) {
90
 
                pPt->x = pBox->x1 + xorg;
91
 
                pPt->y = pBox->y1 + yorg;
92
 
                pPt++;
93
 
                pBox++;
94
 
        }
95
 
 
96
 
        ilbmDoBitblt((DrawablePtr)pPixmap->drawable.pScreen->devPrivates[ilbmScreenPrivateIndex].ptr,
97
 
                                (DrawablePtr)pPixmap,
98
 
                                GXcopy,
99
 
                                prgnSave,
100
 
                                pPtsInit, wBackingBitPlanes (pWin));
101
 
 
102
 
        DEALLOCATE_LOCAL(pPtsInit);
103
 
}
104
 
 
105
 
/*-
106
 
 *-----------------------------------------------------------------------
107
 
 * ilbmRestoreAreas --
108
 
 *              Function called by miRestoreAreas to actually fetch the areas to be
109
 
 *              restored from the backing pixmap. This is very simple to do, since
110
 
 *              ilbmDoBitblt is designed for this very thing. The region to restore is
111
 
 *              already destination-relative and we're given the offset to the
112
 
 *              window origin, so we have only to create an array of points of the
113
 
 *              u.l. corners of the boxes in the region translated to the pixmap
114
 
 *              coordinate system and fetch the screen pixmap out of its devPrivate
115
 
 *              field....
116
 
 *
117
 
 * Results:
118
 
 *              None.
119
 
 *
120
 
 * Side Effects:
121
 
 *              Data are copied from the pixmap into the screen.
122
 
 *
123
 
 *-----------------------------------------------------------------------
124
 
 */
125
 
void
126
 
ilbmRestoreAreas(pPixmap, prgnRestore, xorg, yorg, pWin)
127
 
        PixmapPtr                               pPixmap;                /* Backing pixmap */
128
 
        RegionPtr                               prgnRestore;            /* Region to restore (screen-relative)*/
129
 
        int                                                     xorg;                                   /* X origin of window */
130
 
        int                                                     yorg;                                   /* Y origin of window */
131
 
        WindowPtr                               pWin;
132
 
{
133
 
        register DDXPointPtr pPt;
134
 
        DDXPointPtr                             pPtsInit;
135
 
        register BoxPtr         pBox;
136
 
        register int            numRects;
137
 
 
138
 
        numRects = REGION_NUM_RECTS(prgnRestore);
139
 
        pPtsInit = (DDXPointPtr)ALLOCATE_LOCAL(numRects*sizeof(DDXPointRec));
140
 
        if (!pPtsInit)
141
 
                return;
142
 
 
143
 
        pBox = REGION_RECTS(prgnRestore);
144
 
        pPt = pPtsInit;
145
 
        while (numRects--) {
146
 
                pPt->x = pBox->x1 - xorg;
147
 
                pPt->y = pBox->y1 - yorg;
148
 
                pPt++;
149
 
                pBox++;
150
 
        }
151
 
 
152
 
        ilbmDoBitblt((DrawablePtr)pPixmap,
153
 
                                (DrawablePtr)pPixmap->drawable.pScreen->devPrivates[ilbmScreenPrivateIndex].ptr,
154
 
                                GXcopy,
155
 
                                prgnRestore,
156
 
                                pPtsInit, wBackingBitPlanes (pWin));
157
 
 
158
 
        DEALLOCATE_LOCAL(pPtsInit);
159
 
}