2 * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
3 * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice including the dates of first publication and
13 * either this permission notice or a reference to
14 * http://oss.sgi.com/projects/FreeB/
15 * shall be included in all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
21 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
22 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 * Except as contained in this notice, the name of Silicon Graphics, Inc.
26 * shall not be used in advertising or otherwise to promote the sale, use or
27 * other dealings in this Software without prior written authorization from
28 * Silicon Graphics, Inc.
31 #include "glxserver.h"
33 #include "g_disptab.h"
36 __glXDispSwap_PolygonStipple(GLbyte
* pc
)
38 __GLXpixelHeader
*hdr
= (__GLXpixelHeader
*) pc
;
40 __GLX_DECLARE_SWAP_VARIABLES
;
42 __GLX_SWAP_INT((GLbyte
*) &hdr
->rowLength
);
43 __GLX_SWAP_INT((GLbyte
*) &hdr
->skipRows
);
44 __GLX_SWAP_INT((GLbyte
*) &hdr
->skipPixels
);
45 __GLX_SWAP_INT((GLbyte
*) &hdr
->alignment
);
47 hdr
->swapBytes
= !hdr
->swapBytes
;
51 __glXDispSwap_Bitmap(GLbyte
* pc
)
53 __GLXdispatchBitmapHeader
*hdr
= (__GLXdispatchBitmapHeader
*) pc
;
55 __GLX_DECLARE_SWAP_VARIABLES
;
57 __GLX_SWAP_INT((GLbyte
*) &hdr
->rowLength
);
58 __GLX_SWAP_INT((GLbyte
*) &hdr
->skipRows
);
59 __GLX_SWAP_INT((GLbyte
*) &hdr
->skipPixels
);
60 __GLX_SWAP_INT((GLbyte
*) &hdr
->alignment
);
62 __GLX_SWAP_INT((GLbyte
*) &hdr
->width
);
63 __GLX_SWAP_INT((GLbyte
*) &hdr
->height
);
64 __GLX_SWAP_FLOAT((GLbyte
*) &hdr
->xorig
);
65 __GLX_SWAP_FLOAT((GLbyte
*) &hdr
->yorig
);
66 __GLX_SWAP_FLOAT((GLbyte
*) &hdr
->xmove
);
67 __GLX_SWAP_FLOAT((GLbyte
*) &hdr
->ymove
);
69 hdr
->swapBytes
= !hdr
->swapBytes
;
74 __glXDispSwap_TexImage1D(GLbyte
* pc
)
76 __GLXdispatchTexImageHeader
*hdr
= (__GLXdispatchTexImageHeader
*) pc
;
78 __GLX_DECLARE_SWAP_VARIABLES
;
80 __GLX_SWAP_INT((GLbyte
*) &hdr
->rowLength
);
81 __GLX_SWAP_INT((GLbyte
*) &hdr
->skipRows
);
82 __GLX_SWAP_INT((GLbyte
*) &hdr
->skipPixels
);
83 __GLX_SWAP_INT((GLbyte
*) &hdr
->alignment
);
85 __GLX_SWAP_INT((GLbyte
*) &hdr
->target
);
86 __GLX_SWAP_INT((GLbyte
*) &hdr
->level
);
87 __GLX_SWAP_INT((GLbyte
*) &hdr
->components
);
88 __GLX_SWAP_INT((GLbyte
*) &hdr
->width
);
89 __GLX_SWAP_INT((GLbyte
*) &hdr
->height
);
90 __GLX_SWAP_INT((GLbyte
*) &hdr
->border
);
91 __GLX_SWAP_INT((GLbyte
*) &hdr
->format
);
92 __GLX_SWAP_INT((GLbyte
*) &hdr
->type
);
95 ** Just invert swapBytes flag; the GL will figure out if it needs to swap
98 hdr
->swapBytes
= !hdr
->swapBytes
;
102 __glXDispSwap_TexImage2D(GLbyte
* pc
)
104 __GLXdispatchTexImageHeader
*hdr
= (__GLXdispatchTexImageHeader
*) pc
;
106 __GLX_DECLARE_SWAP_VARIABLES
;
108 __GLX_SWAP_INT((GLbyte
*) &hdr
->rowLength
);
109 __GLX_SWAP_INT((GLbyte
*) &hdr
->skipRows
);
110 __GLX_SWAP_INT((GLbyte
*) &hdr
->skipPixels
);
111 __GLX_SWAP_INT((GLbyte
*) &hdr
->alignment
);
113 __GLX_SWAP_INT((GLbyte
*) &hdr
->target
);
114 __GLX_SWAP_INT((GLbyte
*) &hdr
->level
);
115 __GLX_SWAP_INT((GLbyte
*) &hdr
->components
);
116 __GLX_SWAP_INT((GLbyte
*) &hdr
->width
);
117 __GLX_SWAP_INT((GLbyte
*) &hdr
->height
);
118 __GLX_SWAP_INT((GLbyte
*) &hdr
->border
);
119 __GLX_SWAP_INT((GLbyte
*) &hdr
->format
);
120 __GLX_SWAP_INT((GLbyte
*) &hdr
->type
);
123 ** Just invert swapBytes flag; the GL will figure out if it needs to swap
126 hdr
->swapBytes
= !hdr
->swapBytes
;
130 __glXDispSwap_TexImage3D(GLbyte
* pc
)
132 __GLXdispatchTexImage3DHeader
*hdr
= (__GLXdispatchTexImage3DHeader
*) pc
;
134 __GLX_DECLARE_SWAP_VARIABLES
;
136 __GLX_SWAP_INT((GLbyte
*) &hdr
->rowLength
);
137 __GLX_SWAP_INT((GLbyte
*) &hdr
->imageHeight
);
138 __GLX_SWAP_INT((GLbyte
*) &hdr
->imageDepth
);
139 __GLX_SWAP_INT((GLbyte
*) &hdr
->skipRows
);
140 __GLX_SWAP_INT((GLbyte
*) &hdr
->skipImages
);
141 __GLX_SWAP_INT((GLbyte
*) &hdr
->skipVolumes
);
142 __GLX_SWAP_INT((GLbyte
*) &hdr
->skipPixels
);
143 __GLX_SWAP_INT((GLbyte
*) &hdr
->alignment
);
145 __GLX_SWAP_INT((GLbyte
*) &hdr
->target
);
146 __GLX_SWAP_INT((GLbyte
*) &hdr
->level
);
147 __GLX_SWAP_INT((GLbyte
*) &hdr
->internalformat
);
148 __GLX_SWAP_INT((GLbyte
*) &hdr
->width
);
149 __GLX_SWAP_INT((GLbyte
*) &hdr
->height
);
150 __GLX_SWAP_INT((GLbyte
*) &hdr
->depth
);
151 __GLX_SWAP_INT((GLbyte
*) &hdr
->size4d
);
152 __GLX_SWAP_INT((GLbyte
*) &hdr
->border
);
153 __GLX_SWAP_INT((GLbyte
*) &hdr
->format
);
154 __GLX_SWAP_INT((GLbyte
*) &hdr
->type
);
157 ** Just invert swapBytes flag; the GL will figure out if it needs to swap
160 hdr
->swapBytes
= !hdr
->swapBytes
;
164 __glXDispSwap_DrawPixels(GLbyte
* pc
)
166 __GLXdispatchDrawPixelsHeader
*hdr
= (__GLXdispatchDrawPixelsHeader
*) pc
;
168 __GLX_DECLARE_SWAP_VARIABLES
;
170 __GLX_SWAP_INT((GLbyte
*) &hdr
->rowLength
);
171 __GLX_SWAP_INT((GLbyte
*) &hdr
->skipRows
);
172 __GLX_SWAP_INT((GLbyte
*) &hdr
->skipPixels
);
173 __GLX_SWAP_INT((GLbyte
*) &hdr
->alignment
);
175 __GLX_SWAP_INT((GLbyte
*) &hdr
->width
);
176 __GLX_SWAP_INT((GLbyte
*) &hdr
->height
);
177 __GLX_SWAP_INT((GLbyte
*) &hdr
->format
);
178 __GLX_SWAP_INT((GLbyte
*) &hdr
->type
);
181 ** Just invert swapBytes flag; the GL will figure out if it needs to swap
184 hdr
->swapBytes
= !hdr
->swapBytes
;
188 __glXDispSwap_TexSubImage1D(GLbyte
* pc
)
190 __GLXdispatchTexSubImageHeader
*hdr
= (__GLXdispatchTexSubImageHeader
*) pc
;
192 __GLX_DECLARE_SWAP_VARIABLES
;
194 __GLX_SWAP_INT((GLbyte
*) &hdr
->rowLength
);
195 __GLX_SWAP_INT((GLbyte
*) &hdr
->skipRows
);
196 __GLX_SWAP_INT((GLbyte
*) &hdr
->skipPixels
);
197 __GLX_SWAP_INT((GLbyte
*) &hdr
->alignment
);
199 __GLX_SWAP_INT((GLbyte
*) &hdr
->target
);
200 __GLX_SWAP_INT((GLbyte
*) &hdr
->level
);
201 __GLX_SWAP_INT((GLbyte
*) &hdr
->xoffset
);
202 __GLX_SWAP_INT((GLbyte
*) &hdr
->width
);
203 __GLX_SWAP_INT((GLbyte
*) &hdr
->format
);
204 __GLX_SWAP_INT((GLbyte
*) &hdr
->type
);
207 ** Just invert swapBytes flag; the GL will figure out if it needs to swap
210 hdr
->swapBytes
= !hdr
->swapBytes
;
214 __glXDispSwap_TexSubImage2D(GLbyte
* pc
)
216 __GLXdispatchTexSubImageHeader
*hdr
= (__GLXdispatchTexSubImageHeader
*) pc
;
218 __GLX_DECLARE_SWAP_VARIABLES
;
220 __GLX_SWAP_INT((GLbyte
*) &hdr
->rowLength
);
221 __GLX_SWAP_INT((GLbyte
*) &hdr
->skipRows
);
222 __GLX_SWAP_INT((GLbyte
*) &hdr
->skipPixels
);
223 __GLX_SWAP_INT((GLbyte
*) &hdr
->alignment
);
225 __GLX_SWAP_INT((GLbyte
*) &hdr
->target
);
226 __GLX_SWAP_INT((GLbyte
*) &hdr
->level
);
227 __GLX_SWAP_INT((GLbyte
*) &hdr
->xoffset
);
228 __GLX_SWAP_INT((GLbyte
*) &hdr
->yoffset
);
229 __GLX_SWAP_INT((GLbyte
*) &hdr
->width
);
230 __GLX_SWAP_INT((GLbyte
*) &hdr
->height
);
231 __GLX_SWAP_INT((GLbyte
*) &hdr
->format
);
232 __GLX_SWAP_INT((GLbyte
*) &hdr
->type
);
235 ** Just invert swapBytes flag; the GL will figure out if it needs to swap
238 hdr
->swapBytes
= !hdr
->swapBytes
;
242 __glXDispSwap_TexSubImage3D(GLbyte
* pc
)
244 __GLXdispatchTexSubImage3DHeader
*hdr
=
245 (__GLXdispatchTexSubImage3DHeader
*) pc
;
247 __GLX_DECLARE_SWAP_VARIABLES
;
249 __GLX_SWAP_INT((GLbyte
*) &hdr
->rowLength
);
250 __GLX_SWAP_INT((GLbyte
*) &hdr
->imageHeight
);
251 __GLX_SWAP_INT((GLbyte
*) &hdr
->imageDepth
);
252 __GLX_SWAP_INT((GLbyte
*) &hdr
->skipRows
);
253 __GLX_SWAP_INT((GLbyte
*) &hdr
->skipImages
);
254 __GLX_SWAP_INT((GLbyte
*) &hdr
->skipVolumes
);
255 __GLX_SWAP_INT((GLbyte
*) &hdr
->skipPixels
);
256 __GLX_SWAP_INT((GLbyte
*) &hdr
->alignment
);
258 __GLX_SWAP_INT((GLbyte
*) &hdr
->target
);
259 __GLX_SWAP_INT((GLbyte
*) &hdr
->level
);
260 __GLX_SWAP_INT((GLbyte
*) &hdr
->xoffset
);
261 __GLX_SWAP_INT((GLbyte
*) &hdr
->yoffset
);
262 __GLX_SWAP_INT((GLbyte
*) &hdr
->zoffset
);
263 __GLX_SWAP_INT((GLbyte
*) &hdr
->width
);
264 __GLX_SWAP_INT((GLbyte
*) &hdr
->height
);
265 __GLX_SWAP_INT((GLbyte
*) &hdr
->depth
);
266 __GLX_SWAP_INT((GLbyte
*) &hdr
->size4d
);
267 __GLX_SWAP_INT((GLbyte
*) &hdr
->format
);
268 __GLX_SWAP_INT((GLbyte
*) &hdr
->type
);
271 ** Just invert swapBytes flag; the GL will figure out if it needs to swap
274 hdr
->swapBytes
= !hdr
->swapBytes
;
278 __glXDispSwap_ColorTable(GLbyte
* pc
)
280 __GLXdispatchColorTableHeader
*hdr
= (__GLXdispatchColorTableHeader
*) pc
;
282 __GLX_DECLARE_SWAP_VARIABLES
;
284 __GLX_SWAP_INT((GLbyte
*) &hdr
->rowLength
);
285 __GLX_SWAP_INT((GLbyte
*) &hdr
->skipRows
);
286 __GLX_SWAP_INT((GLbyte
*) &hdr
->skipPixels
);
287 __GLX_SWAP_INT((GLbyte
*) &hdr
->alignment
);
289 __GLX_SWAP_INT((GLbyte
*) &hdr
->target
);
290 __GLX_SWAP_INT((GLbyte
*) &hdr
->internalformat
);
291 __GLX_SWAP_INT((GLbyte
*) &hdr
->width
);
292 __GLX_SWAP_INT((GLbyte
*) &hdr
->format
);
293 __GLX_SWAP_INT((GLbyte
*) &hdr
->type
);
296 ** Just invert swapBytes flag; the GL will figure out if it needs to swap
299 hdr
->swapBytes
= !hdr
->swapBytes
;
303 __glXDispSwap_ColorSubTable(GLbyte
* pc
)
305 __GLXdispatchColorSubTableHeader
*hdr
=
306 (__GLXdispatchColorSubTableHeader
*) pc
;
307 __GLX_DECLARE_SWAP_VARIABLES
;
309 __GLX_SWAP_INT((GLbyte
*) &hdr
->rowLength
);
310 __GLX_SWAP_INT((GLbyte
*) &hdr
->skipRows
);
311 __GLX_SWAP_INT((GLbyte
*) &hdr
->skipPixels
);
312 __GLX_SWAP_INT((GLbyte
*) &hdr
->alignment
);
314 __GLX_SWAP_INT((GLbyte
*) &hdr
->target
);
315 __GLX_SWAP_INT((GLbyte
*) &hdr
->start
);
316 __GLX_SWAP_INT((GLbyte
*) &hdr
->count
);
317 __GLX_SWAP_INT((GLbyte
*) &hdr
->format
);
318 __GLX_SWAP_INT((GLbyte
*) &hdr
->type
);
321 ** Just invert swapBytes flag; the GL will figure out if it needs to swap
324 hdr
->swapBytes
= !hdr
->swapBytes
;
328 __glXDispSwap_ConvolutionFilter1D(GLbyte
* pc
)
330 __GLXdispatchConvolutionFilterHeader
*hdr
=
331 (__GLXdispatchConvolutionFilterHeader
*) pc
;
332 __GLX_DECLARE_SWAP_VARIABLES
;
334 __GLX_SWAP_INT((GLbyte
*) &hdr
->rowLength
);
335 __GLX_SWAP_INT((GLbyte
*) &hdr
->skipRows
);
336 __GLX_SWAP_INT((GLbyte
*) &hdr
->skipPixels
);
337 __GLX_SWAP_INT((GLbyte
*) &hdr
->alignment
);
339 __GLX_SWAP_INT((GLbyte
*) &hdr
->target
);
340 __GLX_SWAP_INT((GLbyte
*) &hdr
->internalformat
);
341 __GLX_SWAP_INT((GLbyte
*) &hdr
->width
);
342 __GLX_SWAP_INT((GLbyte
*) &hdr
->format
);
343 __GLX_SWAP_INT((GLbyte
*) &hdr
->type
);
346 ** Just invert swapBytes flag; the GL will figure out if it needs to swap
349 hdr
->swapBytes
= !hdr
->swapBytes
;
353 __glXDispSwap_ConvolutionFilter2D(GLbyte
* pc
)
355 __GLXdispatchConvolutionFilterHeader
*hdr
=
356 (__GLXdispatchConvolutionFilterHeader
*) pc
;
357 __GLX_DECLARE_SWAP_VARIABLES
;
359 __GLX_SWAP_INT((GLbyte
*) &hdr
->rowLength
);
360 __GLX_SWAP_INT((GLbyte
*) &hdr
->skipRows
);
361 __GLX_SWAP_INT((GLbyte
*) &hdr
->skipPixels
);
362 __GLX_SWAP_INT((GLbyte
*) &hdr
->alignment
);
364 __GLX_SWAP_INT((GLbyte
*) &hdr
->target
);
365 __GLX_SWAP_INT((GLbyte
*) &hdr
->internalformat
);
366 __GLX_SWAP_INT((GLbyte
*) &hdr
->width
);
367 __GLX_SWAP_INT((GLbyte
*) &hdr
->height
);
368 __GLX_SWAP_INT((GLbyte
*) &hdr
->format
);
369 __GLX_SWAP_INT((GLbyte
*) &hdr
->type
);
372 ** Just invert swapBytes flag; the GL will figure out if it needs to swap
375 hdr
->swapBytes
= !hdr
->swapBytes
;
379 __glXDispSwap_SeparableFilter2D(GLbyte
* pc
)
381 __GLXdispatchConvolutionFilterHeader
*hdr
=
382 (__GLXdispatchConvolutionFilterHeader
*) pc
;
385 __GLX_DECLARE_SWAP_VARIABLES
;
387 hdrlen
= __GLX_PAD(__GLX_CONV_FILT_CMD_HDR_SIZE
);
389 __GLX_SWAP_INT((GLbyte
*) &hdr
->rowLength
);
390 __GLX_SWAP_INT((GLbyte
*) &hdr
->skipRows
);
391 __GLX_SWAP_INT((GLbyte
*) &hdr
->skipPixels
);
392 __GLX_SWAP_INT((GLbyte
*) &hdr
->alignment
);
394 __GLX_SWAP_INT((GLbyte
*) &hdr
->target
);
395 __GLX_SWAP_INT((GLbyte
*) &hdr
->internalformat
);
396 __GLX_SWAP_INT((GLbyte
*) &hdr
->width
);
397 __GLX_SWAP_INT((GLbyte
*) &hdr
->height
);
398 __GLX_SWAP_INT((GLbyte
*) &hdr
->format
);
399 __GLX_SWAP_INT((GLbyte
*) &hdr
->type
);
402 ** Just invert swapBytes flag; the GL will figure out if it needs to swap
405 hdr
->swapBytes
= !hdr
->swapBytes
;