VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.3.0.0/xf86glx_util.h@ 78406

Last change on this file since 78406 was 25078, checked in by vboxsync, 15 years ago

Additions/x11/x11include: exported and set eol-style on new headers

  • Property svn:eol-style set to native
File size: 3.0 KB
Line 
1/**************************************************************************
2
3Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
4All Rights Reserved.
5
6Permission is hereby granted, free of charge, to any person obtaining a
7copy of this software and associated documentation files (the
8"Software"), to deal in the Software without restriction, including
9without limitation the rights to use, copy, modify, merge, publish,
10distribute, sub license, and/or sell copies of the Software, and to
11permit persons to whom the Software is furnished to do so, subject to
12the following conditions:
13
14The above copyright notice and this permission notice (including the
15next paragraph) shall be included in all copies or substantial portions
16of the Software.
17
18THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
22ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25
26**************************************************************************/
27
28/*
29 * Authors:
30 * Kevin E. Martin <[email protected]>
31 * Brian Paul <[email protected]>
32 */
33
34#ifdef HAVE_DIX_CONFIG_H
35#include <dix-config.h>
36#endif
37
38#ifndef _XF86GLX_UTIL_H_
39#define _XF86GLX_UTIL_H_
40
41#ifdef __CYGWIN__
42#undef WIN32
43#undef _WIN32
44#endif
45
46#include <screenint.h>
47#include <pixmap.h>
48#include <gc.h>
49#include "GL/xmesa.h"
50
51#define XMESA_USE_PUTPIXEL_MACRO
52
53struct _XMesaImageRec {
54 int width, height;
55 char *data;
56 int bytes_per_line; /* Padded to 32 bits */
57 int bits_per_pixel;
58};
59
60extern XMesaImage *XMesaCreateImage(int bitsPerPixel, int width, int height,
61 char *data);
62extern void XMesaDestroyImage(XMesaImage *image);
63extern unsigned long XMesaGetPixel(XMesaImage *image, int x, int y);
64#ifdef XMESA_USE_PUTPIXEL_MACRO
65#define XMesaPutPixel(__i,__x,__y,__p) \
66{ \
67 CARD8 *__row = (CARD8 *)(__i->data + __y*__i->bytes_per_line); \
68 CARD8 *__i8; \
69 CARD16 *__i16; \
70 CARD32 *__i32; \
71 switch (__i->bits_per_pixel) { \
72 case 8: \
73 __i8 = (CARD8 *)__row; \
74 __i8[__x] = (CARD8)__p; \
75 break; \
76 case 15: \
77 case 16: \
78 __i16 = (CARD16 *)__row; \
79 __i16[__x] = (CARD16)__p; \
80 break; \
81 case 24: /* WARNING: architecture specific code */ \
82 __i8 = (CARD8 *)__row; \
83 __i8[__x*3] = (CARD8)(__p); \
84 __i8[__x*3+1] = (CARD8)(__p>>8); \
85 __i8[__x*3+2] = (CARD8)(__p>>16); \
86 break; \
87 case 32: \
88 __i32 = (CARD32 *)__row; \
89 __i32[__x] = (CARD32)__p; \
90 break; \
91 } \
92}
93#else
94extern void XMesaPutPixel(XMesaImage *image, int x, int y,
95 unsigned long pixel);
96#endif
97
98extern void XMesaPutImageHelper(ScreenPtr display,
99 DrawablePtr d, GCPtr gc,
100 XMesaImage *image,
101 int src_x, int src_y,
102 int dest_x, int dest_y,
103 unsigned int width, unsigned int height);
104
105#endif /* _XF86GLX_UTIL_H_ */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette