summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMichel Dänzer <michel@tungstengraphics.com>2007-05-22 13:56:30 +0200
committerMichel Dänzer <michel@tungstengraphics.com>2007-05-22 13:56:30 +0200
commit24d965fab52f790188e5de6e67e7387809b1f145 (patch)
treed3fd1020f427f14b39eb64bc248ab000ea701cfd /include
parent9e3e3883fa42ffee82e8e8ecbf75c153a2215acb (diff)
downloadexternal_mesa3d-24d965fab52f790188e5de6e67e7387809b1f145.zip
external_mesa3d-24d965fab52f790188e5de6e67e7387809b1f145.tar.gz
external_mesa3d-24d965fab52f790188e5de6e67e7387809b1f145.tar.bz2
Fix xserver build after recent XMesa changes.
Only build tested.
Diffstat (limited to 'include')
-rw-r--r--include/GL/xmesa.h4
-rw-r--r--include/GL/xmesa_x.h1
-rw-r--r--include/GL/xmesa_xf86.h29
3 files changed, 31 insertions, 3 deletions
diff --git a/include/GL/xmesa.h b/include/GL/xmesa.h
index 2199b08..98139af 100644
--- a/include/GL/xmesa.h
+++ b/include/GL/xmesa.h
@@ -402,11 +402,11 @@ extern XMesaBuffer XMesaCreatePBuffer(XMesaVisual v, XMesaColormap cmap,
* New in Mesa 7.1
*/
extern void
-XMesaBindTexImage(Display *dpy, XMesaBuffer drawable, int buffer,
+XMesaBindTexImage(XMesaDisplay *dpy, XMesaBuffer drawable, int buffer,
const int *attrib_list);
extern void
-XMesaReleaseTexImage(Display *dpy, XMesaBuffer drawable, int buffer);
+XMesaReleaseTexImage(XMesaDisplay *dpy, XMesaBuffer drawable, int buffer);
extern XMesaBuffer
diff --git a/include/GL/xmesa_x.h b/include/GL/xmesa_x.h
index 721d8b5..865bab4 100644
--- a/include/GL/xmesa_x.h
+++ b/include/GL/xmesa_x.h
@@ -66,6 +66,7 @@ typedef XColor XMesaColor;
#define XMesaDrawPoints XDrawPoints
#define XMesaDrawLine XDrawLine
#define XMesaFillRectangle XFillRectangle
+#define XMesaGetImage XGetImage
#define XMesaPutImage XPutImage
#define XMesaCopyArea XCopyArea
diff --git a/include/GL/xmesa_xf86.h b/include/GL/xmesa_xf86.h
index 0a15110..18908a1 100644
--- a/include/GL/xmesa_xf86.h
+++ b/include/GL/xmesa_xf86.h
@@ -42,8 +42,15 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "scrnintstr.h"
#include "pixmapstr.h"
#include "gcstruct.h"
+#include "servermd.h"
-typedef struct _XMesaImageRec XMesaImage;
+
+typedef struct _XMesaImageRec {
+ int width, height;
+ char *data;
+ int bytes_per_line; /* Padded to 32 bits */
+ int bits_per_pixel;
+} XMesaImage;
typedef ScreenRec XMesaDisplay;
typedef PixmapPtr XMesaPixmap;
@@ -120,6 +127,26 @@ do { \
(*__gc->ops->PolyFillRect)((DrawablePtr)__b, __gc, 1, __r); \
} while (0)
+static _X_INLINE XMesaImage *XMesaGetImage(XMesaDisplay *dpy, PixmapPtr p, int x,
+ int y, unsigned int width,
+ unsigned int height,
+ unsigned long plane_mask, int format)
+{
+ XMesaImage *img = Xcalloc(sizeof(*img));
+
+ img->width = p->drawable.width;
+ img->height = p->drawable.height;
+ img->bits_per_pixel = p->drawable.bitsPerPixel;
+ img->bytes_per_line = PixmapBytePad(width, p->drawable.depth);
+ img->data = malloc(height * img->bytes_per_line);
+
+ /* Assumes: Images are always in ZPixmap format */
+ (*p->drawable.pScreen->GetImage)(&p->drawable, x, y, width, height,
+ plane_mask, ZPixmap, img->data);
+
+ return img;
+}
+
#define XMesaPutImage(__d,__b,__gc,__i,__sx,__sy,__x,__y,__w,__h) \
do { \
/* Assumes: Images are always in ZPixmap format */ \