From 77ce568ff704e6cdcfaa557965c894752d19e462 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Fonseca?= Date: Mon, 26 May 2008 20:14:40 +0900 Subject: Remove CVS keywords. --- src/glx/x11/glxclient.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/glx/x11/glxclient.h') diff --git a/src/glx/x11/glxclient.h b/src/glx/x11/glxclient.h index 477566cc46..03e44e5d04 100644 --- a/src/glx/x11/glxclient.h +++ b/src/glx/x11/glxclient.h @@ -31,7 +31,6 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. */ -/* $XFree86: xc/lib/GL/glx/glxclient.h,v 1.21 2004/02/09 23:46:31 alanh Exp $ */ /** * \file glxclient.h -- cgit v1.2.3 From 4566b006f1a6bbdb96871e511e10e16f18bad23e Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Tue, 10 Jun 2008 20:17:16 +0100 Subject: Bring in DRI2 changes --- src/glx/x11/glxclient.h | 171 ++++++++++++++++++++++++++++++------------------ 1 file changed, 109 insertions(+), 62 deletions(-) (limited to 'src/glx/x11/glxclient.h') diff --git a/src/glx/x11/glxclient.h b/src/glx/x11/glxclient.h index 03e44e5d04..73c278ee38 100644 --- a/src/glx/x11/glxclient.h +++ b/src/glx/x11/glxclient.h @@ -58,7 +58,7 @@ #include "GL/glxproto.h" #include "GL/internal/glcore.h" #include "glapitable.h" -#include "glxextensions.h" +#include "glxhash.h" #if defined( USE_XTHREADS ) # include #elif defined( PTHREADS ) @@ -70,7 +70,9 @@ #define __GLX_MAX_TEXTURE_UNITS 32 +typedef struct __GLXscreenConfigsRec __GLXscreenConfigs; typedef struct __GLXcontextRec __GLXcontext; +typedef struct __GLXdrawableRec __GLXdrawable; typedef struct __GLXdisplayPrivateRec __GLXdisplayPrivate; typedef struct _glapi_table __GLapi; @@ -78,6 +80,9 @@ typedef struct _glapi_table __GLapi; #ifdef GLX_DIRECT_RENDERING +#define containerOf(ptr, type, member) \ + (type *)( (char *)ptr - offsetof(type,member) ) + #include @@ -85,43 +90,64 @@ typedef struct _glapi_table __GLapi; * Display dependent methods. This structure is initialized during the * \c driCreateDisplay call. */ -struct __DRIdisplayRec { +typedef struct __GLXDRIdisplayRec __GLXDRIdisplay; +typedef struct __GLXDRIscreenRec __GLXDRIscreen; +typedef struct __GLXDRIdrawableRec __GLXDRIdrawable; +typedef struct __GLXDRIcontextRec __GLXDRIcontext; + +#include "glxextensions.h" + +struct __GLXDRIdisplayRec { /** * Method to destroy the private DRI display data. */ - void (*destroyDisplay)(Display *dpy, void *displayPrivate); + void (*destroyDisplay)(__GLXDRIdisplay *display); - /** - * Opaque pointer to private per display direct rendering data. - * \c NULL if direct rendering is not supported on this display. - */ - struct __DRIdisplayPrivateRec *private; + __GLXDRIscreen *(*createScreen)(__GLXscreenConfigs *psc, int screen, + __GLXdisplayPrivate *priv); +}; - /** - * Array of pointers to methods to create and initialize the private DRI - * screen data. - */ - PFNCREATENEWSCREENFUNC * createNewScreen; +struct __GLXDRIscreenRec { + + void (*destroyScreen)(__GLXscreenConfigs *psc); + + __GLXDRIcontext *(*createContext)(__GLXscreenConfigs *psc, + const __GLcontextModes *mode, + GLXContext gc, + GLXContext shareList, int renderType); + + __GLXDRIdrawable *(*createDrawable)(__GLXscreenConfigs *psc, + XID drawable, + GLXDrawable glxDrawable, + const __GLcontextModes *modes); }; +struct __GLXDRIcontextRec { + void (*destroyContext)(__GLXDRIcontext *context, __GLXscreenConfigs *psc, + Display *dpy); + Bool (*bindContext)(__GLXDRIcontext *context, + __GLXDRIdrawable *pdraw, + __GLXDRIdrawable *pread); + + void (*unbindContext)(__GLXDRIcontext *context); +}; -/* -** We keep a linked list of these structures, one per DRI device driver. -*/ -struct __DRIdriverRec { - const char *name; - void *handle; - PFNCREATENEWSCREENFUNC createNewScreenFunc; - struct __DRIdriverRec *next; +struct __GLXDRIdrawableRec { + void (*destroyDrawable)(__GLXDRIdrawable *drawable); + + XID xDrawable; + XID drawable; + __GLXscreenConfigs *psc; + __DRIdrawable *driDrawable; + GLenum textureTarget; }; /* ** Function to create and DRI display data and initialize the display ** dependent methods. */ -extern void *driCreateDisplay(Display *dpy, __DRIdisplay *pdisp); - -extern __DRIdriver *driGetDriver(Display *dpy, int scrNum); +extern __GLXDRIdisplay *driCreateDisplay(Display *dpy); +extern __GLXDRIdisplay *dri2CreateDisplay(Display *dpy); extern void DRI_glXUseXFont( Font font, int first, int count, int listbase ); @@ -133,8 +159,6 @@ extern const char *glXGetScreenDriver (Display *dpy, int scrNum); extern const char *glXGetDriverConfig (const char *driverName); -extern Bool __glXWindowExists(Display *dpy, GLXDrawable draw); - #endif /************************************************************************/ @@ -225,19 +249,11 @@ struct __GLXcontextRec { */ XID share_xid; - /** - * Visual id. - * - * \deprecated - * This filed has been largely been replaced by the \c mode field, but - * the work is not quite done. - */ - VisualID vid; - /** * Screen number. */ GLint screen; + __GLXscreenConfigs *psc; /** * \c GL_TRUE if the context was created with ImportContext, which @@ -343,24 +359,15 @@ struct __GLXcontextRec { */ GLint majorOpcode; -#ifdef GLX_DIRECT_RENDERING /** - * Per context direct rendering interface functions and data. + * Pointer to the mode used to create this context. */ - __DRIcontext driContext; + const __GLcontextModes * mode; + +#ifdef GLX_DIRECT_RENDERING + __GLXDRIcontext *driContext; + __DRIcontext *__driContext; #endif - - /** - * \c GLXFBConfigID used to create this context. May be \c None. This - * field has been replaced by the \c mode field. - * - * \since Internal API version 20030317. - * - * \deprecated - * This filed has been largely been replaced by the \c mode field, but - * the work is not quite done. - */ - GLXFBConfigID fbconfigID; /** * The current read-drawable for this context. Will be None if this @@ -438,7 +445,7 @@ extern void __glFreeAttributeState(__GLXcontext *); * One of these records exists per screen of the display. It contains * a pointer to the config data for that screen (if the screen supports GL). */ -typedef struct __GLXscreenConfigsRec { +struct __GLXscreenConfigsRec { /** * GLX extension string reported by the X-server. */ @@ -454,13 +461,46 @@ typedef struct __GLXscreenConfigsRec { /** * Per screen direct rendering interface functions and data. */ - __DRIscreen driScreen; + __DRIscreen *__driScreen; + const __DRIcoreExtension *core; + const __DRIlegacyExtension *legacy; + __glxHashTable *drawHash; + Display *dpy; + int scr, fd; + void *driver; + + __GLXDRIscreen *driScreen; + +#ifdef __DRI_COPY_SUB_BUFFER + const __DRIcopySubBufferExtension *copySubBuffer; +#endif + +#ifdef __DRI_SWAP_CONTROL + const __DRIswapControlExtension *swapControl; +#endif + +#ifdef __DRI_ALLOCATE + const __DRIallocateExtension *allocate; +#endif + +#ifdef __DRI_FRAME_TRACKING + const __DRIframeTrackingExtension *frameTracking; +#endif + +#ifdef __DRI_MEDIA_STREAM_COUNTER + const __DRImediaStreamCounterExtension *msc; +#endif + +#ifdef __DRI_TEX_BUFFER + const __DRItexBufferExtension *texBuffer; +#endif + #endif /** - * Linked list of configurations for this screen. + * Linked list of glx visuals and fbconfigs for this screen. */ - __GLcontextModes *configs; + __GLcontextModes *visuals, *configs; /** * Per-screen dynamic GLX extension tracking. The \c direct_support @@ -474,7 +514,7 @@ typedef struct __GLXscreenConfigsRec { GLboolean ext_list_first_time; /*@}*/ -} __GLXscreenConfigs; +}; /** * Per display private data. One of these records exists for each display @@ -523,11 +563,11 @@ struct __GLXdisplayPrivateRec { /** * Per display direct rendering interface functions and data. */ - __DRIdisplay driDisplay; + __GLXDRIdisplay *driDisplay; + __GLXDRIdisplay *dri2Display; #endif }; -void __glXFreeContext(__GLXcontext*); extern GLubyte *__glXFlushRenderBuffer(__GLXcontext*, GLubyte*); @@ -571,6 +611,10 @@ extern __GLXcontext *__glXcurrentContext; #endif /* defined( USE_XTHREADS ) || defined( PTHREADS ) */ +extern void __glXSetCurrentContextNull(void); + +extern void __glXFreeContext(__GLXcontext*); + /* ** Global lock for all threads in this address space using the GLX @@ -680,13 +724,16 @@ extern char *__glXstrdup(const char *str); extern const char __glXGLClientVersion[]; extern const char __glXGLClientExtensions[]; -/* Determine the internal API version */ -extern int __glXGetInternalVersion(void); - /* Get the unadjusted system time */ extern int __glXGetUST( int64_t * ust ); -extern Bool __glXGetMscRateOML(Display * dpy, GLXDrawable drawable, - int32_t * numerator, int32_t * denominator); +extern GLboolean __glXGetMscRateOML(Display * dpy, GLXDrawable drawable, + int32_t * numerator, int32_t * denominator); + +#ifdef GLX_DIRECT_RENDERING +GLboolean +__driGetMscRateOML(__DRIdrawable *draw, + int32_t *numerator, int32_t *denominator, void *private); +#endif #endif /* !__GLX_client_h__ */ -- cgit v1.2.3 From 6f7ed99b306990f284f9d57c0b66efaa7f2277e1 Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Thu, 12 Jun 2008 00:11:54 +0100 Subject: revert the DRI2 commits --- src/glx/x11/glxclient.h | 171 ++++++++++++++++++------------------------------ 1 file changed, 62 insertions(+), 109 deletions(-) (limited to 'src/glx/x11/glxclient.h') diff --git a/src/glx/x11/glxclient.h b/src/glx/x11/glxclient.h index 73c278ee38..03e44e5d04 100644 --- a/src/glx/x11/glxclient.h +++ b/src/glx/x11/glxclient.h @@ -58,7 +58,7 @@ #include "GL/glxproto.h" #include "GL/internal/glcore.h" #include "glapitable.h" -#include "glxhash.h" +#include "glxextensions.h" #if defined( USE_XTHREADS ) # include #elif defined( PTHREADS ) @@ -70,9 +70,7 @@ #define __GLX_MAX_TEXTURE_UNITS 32 -typedef struct __GLXscreenConfigsRec __GLXscreenConfigs; typedef struct __GLXcontextRec __GLXcontext; -typedef struct __GLXdrawableRec __GLXdrawable; typedef struct __GLXdisplayPrivateRec __GLXdisplayPrivate; typedef struct _glapi_table __GLapi; @@ -80,9 +78,6 @@ typedef struct _glapi_table __GLapi; #ifdef GLX_DIRECT_RENDERING -#define containerOf(ptr, type, member) \ - (type *)( (char *)ptr - offsetof(type,member) ) - #include @@ -90,64 +85,43 @@ typedef struct _glapi_table __GLapi; * Display dependent methods. This structure is initialized during the * \c driCreateDisplay call. */ -typedef struct __GLXDRIdisplayRec __GLXDRIdisplay; -typedef struct __GLXDRIscreenRec __GLXDRIscreen; -typedef struct __GLXDRIdrawableRec __GLXDRIdrawable; -typedef struct __GLXDRIcontextRec __GLXDRIcontext; - -#include "glxextensions.h" - -struct __GLXDRIdisplayRec { +struct __DRIdisplayRec { /** * Method to destroy the private DRI display data. */ - void (*destroyDisplay)(__GLXDRIdisplay *display); - - __GLXDRIscreen *(*createScreen)(__GLXscreenConfigs *psc, int screen, - __GLXdisplayPrivate *priv); -}; + void (*destroyDisplay)(Display *dpy, void *displayPrivate); -struct __GLXDRIscreenRec { - - void (*destroyScreen)(__GLXscreenConfigs *psc); - - __GLXDRIcontext *(*createContext)(__GLXscreenConfigs *psc, - const __GLcontextModes *mode, - GLXContext gc, - GLXContext shareList, int renderType); - - __GLXDRIdrawable *(*createDrawable)(__GLXscreenConfigs *psc, - XID drawable, - GLXDrawable glxDrawable, - const __GLcontextModes *modes); -}; + /** + * Opaque pointer to private per display direct rendering data. + * \c NULL if direct rendering is not supported on this display. + */ + struct __DRIdisplayPrivateRec *private; -struct __GLXDRIcontextRec { - void (*destroyContext)(__GLXDRIcontext *context, __GLXscreenConfigs *psc, - Display *dpy); - Bool (*bindContext)(__GLXDRIcontext *context, - __GLXDRIdrawable *pdraw, - __GLXDRIdrawable *pread); - - void (*unbindContext)(__GLXDRIcontext *context); + /** + * Array of pointers to methods to create and initialize the private DRI + * screen data. + */ + PFNCREATENEWSCREENFUNC * createNewScreen; }; -struct __GLXDRIdrawableRec { - void (*destroyDrawable)(__GLXDRIdrawable *drawable); - XID xDrawable; - XID drawable; - __GLXscreenConfigs *psc; - __DRIdrawable *driDrawable; - GLenum textureTarget; +/* +** We keep a linked list of these structures, one per DRI device driver. +*/ +struct __DRIdriverRec { + const char *name; + void *handle; + PFNCREATENEWSCREENFUNC createNewScreenFunc; + struct __DRIdriverRec *next; }; /* ** Function to create and DRI display data and initialize the display ** dependent methods. */ -extern __GLXDRIdisplay *driCreateDisplay(Display *dpy); -extern __GLXDRIdisplay *dri2CreateDisplay(Display *dpy); +extern void *driCreateDisplay(Display *dpy, __DRIdisplay *pdisp); + +extern __DRIdriver *driGetDriver(Display *dpy, int scrNum); extern void DRI_glXUseXFont( Font font, int first, int count, int listbase ); @@ -159,6 +133,8 @@ extern const char *glXGetScreenDriver (Display *dpy, int scrNum); extern const char *glXGetDriverConfig (const char *driverName); +extern Bool __glXWindowExists(Display *dpy, GLXDrawable draw); + #endif /************************************************************************/ @@ -249,11 +225,19 @@ struct __GLXcontextRec { */ XID share_xid; + /** + * Visual id. + * + * \deprecated + * This filed has been largely been replaced by the \c mode field, but + * the work is not quite done. + */ + VisualID vid; + /** * Screen number. */ GLint screen; - __GLXscreenConfigs *psc; /** * \c GL_TRUE if the context was created with ImportContext, which @@ -359,15 +343,24 @@ struct __GLXcontextRec { */ GLint majorOpcode; +#ifdef GLX_DIRECT_RENDERING /** - * Pointer to the mode used to create this context. + * Per context direct rendering interface functions and data. */ - const __GLcontextModes * mode; - -#ifdef GLX_DIRECT_RENDERING - __GLXDRIcontext *driContext; - __DRIcontext *__driContext; + __DRIcontext driContext; #endif + + /** + * \c GLXFBConfigID used to create this context. May be \c None. This + * field has been replaced by the \c mode field. + * + * \since Internal API version 20030317. + * + * \deprecated + * This filed has been largely been replaced by the \c mode field, but + * the work is not quite done. + */ + GLXFBConfigID fbconfigID; /** * The current read-drawable for this context. Will be None if this @@ -445,7 +438,7 @@ extern void __glFreeAttributeState(__GLXcontext *); * One of these records exists per screen of the display. It contains * a pointer to the config data for that screen (if the screen supports GL). */ -struct __GLXscreenConfigsRec { +typedef struct __GLXscreenConfigsRec { /** * GLX extension string reported by the X-server. */ @@ -461,46 +454,13 @@ struct __GLXscreenConfigsRec { /** * Per screen direct rendering interface functions and data. */ - __DRIscreen *__driScreen; - const __DRIcoreExtension *core; - const __DRIlegacyExtension *legacy; - __glxHashTable *drawHash; - Display *dpy; - int scr, fd; - void *driver; - - __GLXDRIscreen *driScreen; - -#ifdef __DRI_COPY_SUB_BUFFER - const __DRIcopySubBufferExtension *copySubBuffer; -#endif - -#ifdef __DRI_SWAP_CONTROL - const __DRIswapControlExtension *swapControl; -#endif - -#ifdef __DRI_ALLOCATE - const __DRIallocateExtension *allocate; -#endif - -#ifdef __DRI_FRAME_TRACKING - const __DRIframeTrackingExtension *frameTracking; -#endif - -#ifdef __DRI_MEDIA_STREAM_COUNTER - const __DRImediaStreamCounterExtension *msc; -#endif - -#ifdef __DRI_TEX_BUFFER - const __DRItexBufferExtension *texBuffer; -#endif - + __DRIscreen driScreen; #endif /** - * Linked list of glx visuals and fbconfigs for this screen. + * Linked list of configurations for this screen. */ - __GLcontextModes *visuals, *configs; + __GLcontextModes *configs; /** * Per-screen dynamic GLX extension tracking. The \c direct_support @@ -514,7 +474,7 @@ struct __GLXscreenConfigsRec { GLboolean ext_list_first_time; /*@}*/ -}; +} __GLXscreenConfigs; /** * Per display private data. One of these records exists for each display @@ -563,11 +523,11 @@ struct __GLXdisplayPrivateRec { /** * Per display direct rendering interface functions and data. */ - __GLXDRIdisplay *driDisplay; - __GLXDRIdisplay *dri2Display; + __DRIdisplay driDisplay; #endif }; +void __glXFreeContext(__GLXcontext*); extern GLubyte *__glXFlushRenderBuffer(__GLXcontext*, GLubyte*); @@ -611,10 +571,6 @@ extern __GLXcontext *__glXcurrentContext; #endif /* defined( USE_XTHREADS ) || defined( PTHREADS ) */ -extern void __glXSetCurrentContextNull(void); - -extern void __glXFreeContext(__GLXcontext*); - /* ** Global lock for all threads in this address space using the GLX @@ -724,16 +680,13 @@ extern char *__glXstrdup(const char *str); extern const char __glXGLClientVersion[]; extern const char __glXGLClientExtensions[]; +/* Determine the internal API version */ +extern int __glXGetInternalVersion(void); + /* Get the unadjusted system time */ extern int __glXGetUST( int64_t * ust ); -extern GLboolean __glXGetMscRateOML(Display * dpy, GLXDrawable drawable, - int32_t * numerator, int32_t * denominator); - -#ifdef GLX_DIRECT_RENDERING -GLboolean -__driGetMscRateOML(__DRIdrawable *draw, - int32_t *numerator, int32_t *denominator, void *private); -#endif +extern Bool __glXGetMscRateOML(Display * dpy, GLXDrawable drawable, + int32_t * numerator, int32_t * denominator); #endif /* !__GLX_client_h__ */ -- cgit v1.2.3 From df2c9424d3b625d6e97528c74051257bc5630a67 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 11 Jul 2008 15:43:52 -0600 Subject: glx: added __glXPreferEGL() to tell libGL to prefer "egl_" drivers over regular DRI drivers. Also, clean-up, consolidate the dlopen() code a bit. --- src/glx/x11/glxclient.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/glx/x11/glxclient.h') diff --git a/src/glx/x11/glxclient.h b/src/glx/x11/glxclient.h index 03e44e5d04..f9d076f56f 100644 --- a/src/glx/x11/glxclient.h +++ b/src/glx/x11/glxclient.h @@ -541,6 +541,8 @@ extern void __glXSendLargeCommand(__GLXcontext *, const GLvoid *, GLint, /* Initialize the GLX extension for dpy */ extern __GLXdisplayPrivate *__glXInitialize(Display*); +extern void __glXPreferEGL(int state); + /************************************************************************/ extern int __glXDebug; -- cgit v1.2.3 From 696bf66fa9c7173067969ddf034f4f1ebf403b85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?RALOVICH=2C=20Krist=C3=B3f?= Date: Sat, 11 Oct 2008 14:27:07 +0200 Subject: glx: add a line of Emacs helping variables --- src/glx/x11/glxclient.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/glx/x11/glxclient.h') diff --git a/src/glx/x11/glxclient.h b/src/glx/x11/glxclient.h index ac44e950a7..2d530eabdb 100644 --- a/src/glx/x11/glxclient.h +++ b/src/glx/x11/glxclient.h @@ -1,3 +1,4 @@ +/* -*- mode: c; tab-width: 3; indent-tabs-mode: nil; c-basic-offset: 3; coding: utf-8-unix -*- */ /* * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. -- cgit v1.2.3 From 5f6472fc695ae6d0dfd87f71312e98a5395fd8a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?RALOVICH=2C=20Krist=C3=B3f?= Date: Mon, 13 Oct 2008 15:14:33 +0200 Subject: glx: indent -br -i3 -npcs --no-tabs glxclient.h --- src/glx/x11/glxclient.h | 361 +++++++++++++++++++++++++----------------------- 1 file changed, 188 insertions(+), 173 deletions(-) (limited to 'src/glx/x11/glxclient.h') diff --git a/src/glx/x11/glxclient.h b/src/glx/x11/glxclient.h index 2d530eabdb..5cac25a142 100644 --- a/src/glx/x11/glxclient.h +++ b/src/glx/x11/glxclient.h @@ -81,7 +81,7 @@ -#define GLX_MAJOR_VERSION 1 /* current version numbers */ +#define GLX_MAJOR_VERSION 1 /* current version numbers */ #define GLX_MINOR_VERSION 4 #define __GLX_MAX_TEXTURE_UNITS 32 @@ -113,70 +113,73 @@ typedef struct __GLXDRIcontextRec __GLXDRIcontext; #include "glxextensions.h" -struct __GLXDRIdisplayRec { +struct __GLXDRIdisplayRec +{ /** * Method to destroy the private DRI display data. */ - void (*destroyDisplay)(__GLXDRIdisplay *display); + void (*destroyDisplay) (__GLXDRIdisplay * display); - __GLXDRIscreen *(*createScreen)(__GLXscreenConfigs *psc, int screen, - __GLXdisplayPrivate *priv); + __GLXDRIscreen *(*createScreen) (__GLXscreenConfigs * psc, int screen, + __GLXdisplayPrivate * priv); }; -struct __GLXDRIscreenRec { +struct __GLXDRIscreenRec +{ - void (*destroyScreen)(__GLXscreenConfigs *psc); + void (*destroyScreen) (__GLXscreenConfigs * psc); - __GLXDRIcontext *(*createContext)(__GLXscreenConfigs *psc, - const __GLcontextModes *mode, - GLXContext gc, - GLXContext shareList, int renderType); - - __GLXDRIdrawable *(*createDrawable)(__GLXscreenConfigs *psc, - XID drawable, - GLXDrawable glxDrawable, - const __GLcontextModes *modes); + __GLXDRIcontext *(*createContext) (__GLXscreenConfigs * psc, + const __GLcontextModes * mode, + GLXContext gc, + GLXContext shareList, int renderType); - void (*swapBuffers)(__GLXDRIdrawable *pdraw); + __GLXDRIdrawable *(*createDrawable) (__GLXscreenConfigs * psc, + XID drawable, + GLXDrawable glxDrawable, + const __GLcontextModes * modes); + + void (*swapBuffers) (__GLXDRIdrawable * pdraw); }; -struct __GLXDRIcontextRec { - void (*destroyContext)(__GLXDRIcontext *context, __GLXscreenConfigs *psc, - Display *dpy); - Bool (*bindContext)(__GLXDRIcontext *context, - __GLXDRIdrawable *pdraw, - __GLXDRIdrawable *pread); - - void (*unbindContext)(__GLXDRIcontext *context); +struct __GLXDRIcontextRec +{ + void (*destroyContext) (__GLXDRIcontext * context, + __GLXscreenConfigs * psc, Display * dpy); + Bool(*bindContext) (__GLXDRIcontext * context, __GLXDRIdrawable * pdraw, + __GLXDRIdrawable * pread); + + void (*unbindContext) (__GLXDRIcontext * context); }; -struct __GLXDRIdrawableRec { - void (*destroyDrawable)(__GLXDRIdrawable *drawable); +struct __GLXDRIdrawableRec +{ + void (*destroyDrawable) (__GLXDRIdrawable * drawable); - XID xDrawable; - XID drawable; - __GLXscreenConfigs *psc; - GLenum textureTarget; - __DRIdrawable *driDrawable; + XID xDrawable; + XID drawable; + __GLXscreenConfigs *psc; + GLenum textureTarget; + __DRIdrawable *driDrawable; }; /* ** Function to create and DRI display data and initialize the display ** dependent methods. */ -extern __GLXDRIdisplay *driswCreateDisplay(Display *dpy); -extern __GLXDRIdisplay *driCreateDisplay(Display *dpy); -extern __GLXDRIdisplay *dri2CreateDisplay(Display *dpy); +extern __GLXDRIdisplay *driswCreateDisplay(Display * dpy); +extern __GLXDRIdisplay *driCreateDisplay(Display * dpy); +extern __GLXDRIdisplay *dri2CreateDisplay(Display * dpy); -extern void DRI_glXUseXFont( Font font, int first, int count, int listbase ); +extern void DRI_glXUseXFont(Font font, int first, int count, int listbase); /* ** Functions to obtain driver configuration information from a direct ** rendering client application */ -extern const char *glXGetScreenDriver (Display *dpy, int scrNum); +extern const char *glXGetScreenDriver(Display * dpy, int scrNum); -extern const char *glXGetDriverConfig (const char *driverName); +extern const char *glXGetDriverConfig(const char *driverName); #endif @@ -184,53 +187,57 @@ extern const char *glXGetDriverConfig (const char *driverName); #define __GL_CLIENT_ATTRIB_STACK_DEPTH 16 -typedef struct __GLXpixelStoreModeRec { - GLboolean swapEndian; - GLboolean lsbFirst; - GLuint rowLength; - GLuint imageHeight; - GLuint imageDepth; - GLuint skipRows; - GLuint skipPixels; - GLuint skipImages; - GLuint alignment; +typedef struct __GLXpixelStoreModeRec +{ + GLboolean swapEndian; + GLboolean lsbFirst; + GLuint rowLength; + GLuint imageHeight; + GLuint imageDepth; + GLuint skipRows; + GLuint skipPixels; + GLuint skipImages; + GLuint alignment; } __GLXpixelStoreMode; -typedef struct __GLXattributeRec { - GLuint mask; +typedef struct __GLXattributeRec +{ + GLuint mask; /** * Pixel storage state. Most of the pixel store mode state is kept * here and used by the client code to manage the packing and * unpacking of data sent to/received from the server. */ - __GLXpixelStoreMode storePack, storeUnpack; + __GLXpixelStoreMode storePack, storeUnpack; /** * Is EXT_vertex_array / GL 1.1 DrawArrays protocol specifically * disabled? */ - GLboolean NoDrawArraysProtocol; - + GLboolean NoDrawArraysProtocol; + /** * Vertex Array storage state. The vertex array component * state is stored here and is used to manage the packing of * DrawArrays data sent to the server. */ - struct array_state_vector * array_state; + struct array_state_vector *array_state; } __GLXattribute; -typedef struct __GLXattributeMachineRec { - __GLXattribute *stack[__GL_CLIENT_ATTRIB_STACK_DEPTH]; - __GLXattribute **stackPointer; +typedef struct __GLXattributeMachineRec +{ + __GLXattribute *stack[__GL_CLIENT_ATTRIB_STACK_DEPTH]; + __GLXattribute **stackPointer; } __GLXattributeMachine; /** * GLX state that needs to be kept on the client. One of these records * exist for each context that has been made current by this client. */ -struct __GLXcontextRec { +struct __GLXcontextRec +{ /** * \name Drawing command buffer. * @@ -247,13 +254,13 @@ struct __GLXcontextRec { * These must be the first 6 fields since they are static initialized * in the dummy context in glxext.c */ - /*@{*/ - GLubyte *buf; - GLubyte *pc; - GLubyte *limit; - GLubyte *bufEnd; - GLint bufSize; - /*@}*/ + /*@{ */ + GLubyte *buf; + GLubyte *pc; + GLubyte *limit; + GLubyte *bufEnd; + GLint bufSize; + /*@} */ /** * The XID of this rendering context. When the context is created a @@ -261,24 +268,24 @@ struct __GLXcontextRec { * destroyed but is still current to some thread. In this case the * context will be freed on next MakeCurrent. */ - XID xid; + XID xid; /** * The XID of the \c shareList context. */ - XID share_xid; + XID share_xid; /** * Screen number. */ - GLint screen; - __GLXscreenConfigs *psc; + GLint screen; + __GLXscreenConfigs *psc; /** * \c GL_TRUE if the context was created with ImportContext, which * means the server-side context was created by another X client. */ - GLboolean imported; + GLboolean imported; /** * The context tag returned by MakeCurrent when this context is made @@ -288,7 +295,7 @@ struct __GLXcontextRec { * \c WaitX, \c WaitGL, \c UseXFont, and \c MakeCurrent (for the old * context)). */ - GLXContextTag currentContextTag; + GLXContextTag currentContextTag; /** * \name Rendering mode @@ -297,11 +304,11 @@ struct __GLXcontextRec { * When \c glRenderMode is called, the buffer associated with the * previous rendering mode (feedback or select) is filled. */ - /*@{*/ - GLenum renderMode; - GLfloat *feedbackBuf; - GLuint *selectBuf; - /*@}*/ + /*@{ */ + GLenum renderMode; + GLfloat *feedbackBuf; + GLuint *selectBuf; + /*@} */ /** * This is \c GL_TRUE if the pixel unpack modes are such that an image @@ -309,43 +316,43 @@ struct __GLXcontextRec { * still be true that the server will have to do some work. This * just promises that a straight copy will fetch the correct bytes. */ - GLboolean fastImageUnpack; + GLboolean fastImageUnpack; /** * Fill newImage with the unpacked form of \c oldImage getting it * ready for transport to the server. */ - void (*fillImage)(__GLXcontext*, GLint, GLint, GLint, GLint, GLenum, - GLenum, const GLvoid*, GLubyte*, GLubyte*); + void (*fillImage) (__GLXcontext *, GLint, GLint, GLint, GLint, GLenum, + GLenum, const GLvoid *, GLubyte *, GLubyte *); /** * Client side attribs. */ - __GLXattributeMachine attributes; + __GLXattributeMachine attributes; /** * Client side error code. This is set when client side gl API * routines need to set an error because of a bad enumerant or * running out of memory, etc. */ - GLenum error; + GLenum error; /** * Whether this context does direct rendering. */ - Bool isDirect; + Bool isDirect; /** * \c dpy of current display for this context. Will be \c NULL if not * current to any display, or if this is the "dummy context". */ - Display *currentDpy; + Display *currentDpy; /** * The current drawable for this context. Will be None if this * context is not current to any drawable. currentReadable is below. */ - GLXDrawable currentDrawable; + GLXDrawable currentDrawable; /** * \name GL Constant Strings @@ -354,38 +361,38 @@ struct __GLXcontextRec { * These pertain to GL attributes, not to be confused with * GLX versioning attributes. */ - /*@{*/ - GLubyte *vendor; - GLubyte *renderer; - GLubyte *version; - GLubyte *extensions; - /*@}*/ + /*@{ */ + GLubyte *vendor; + GLubyte *renderer; + GLubyte *version; + GLubyte *extensions; + /*@} */ /** * Record the dpy this context was created on for later freeing */ - Display *createDpy; + Display *createDpy; /** * Maximum small render command size. This is the smaller of 64k and * the size of the above buffer. */ - GLint maxSmallRenderCommandSize; + GLint maxSmallRenderCommandSize; /** * Major opcode for the extension. Copied here so a lookup isn't * needed. */ - GLint majorOpcode; + GLint majorOpcode; /** * Pointer to the mode used to create this context. */ - const __GLcontextModes * mode; + const __GLcontextModes *mode; #ifdef GLX_DIRECT_RENDERING - __GLXDRIcontext *driContext; - __DRIcontext *__driContext; + __GLXDRIcontext *driContext; + __DRIcontext *__driContext; #endif /** @@ -394,7 +401,7 @@ struct __GLXcontextRec { * * \since Internal API version 20030606. */ - GLXDrawable currentReadable; + GLXDrawable currentReadable; /** * Pointer to client-state data that is private to libGL. This is only @@ -403,13 +410,13 @@ struct __GLXcontextRec { * No internal API version change was made for this change. Client-side * drivers should NEVER use this data or even care that it exists. */ - void * client_state_private; + void *client_state_private; /** * Stored value for \c glXQueryContext attribute \c GLX_RENDER_TYPE. */ int renderType; - + /** * \name Raw server GL version * @@ -417,12 +424,12 @@ struct __GLXcontextRec { * returned by the server, and it may not reflect what is actually * supported (or reported) by the client-side library. */ - /*@{*/ + /*@{ */ int server_major; /**< Major version number. */ int server_minor; /**< Minor version number. */ - /*@}*/ + /*@} */ - char gl_extension_bits[ __GL_EXT_BYTES ]; + char gl_extension_bits[__GL_EXT_BYTES]; }; #define __glXSetError(gc,code) \ @@ -464,56 +471,57 @@ extern void __glFreeAttributeState(__GLXcontext *); * One of these records exists per screen of the display. It contains * a pointer to the config data for that screen (if the screen supports GL). */ -struct __GLXscreenConfigsRec { +struct __GLXscreenConfigsRec +{ /** * GLX extension string reported by the X-server. */ - const char *serverGLXexts; + const char *serverGLXexts; /** * GLX extension string to be reported to applications. This is the * set of extensions that the application can actually use. */ - char *effectiveGLXexts; + char *effectiveGLXexts; #ifdef GLX_DIRECT_RENDERING /** * Per screen direct rendering interface functions and data. */ - __DRIscreen *__driScreen; - const __DRIcoreExtension *core; - const __DRIlegacyExtension *legacy; - const __DRIswrastExtension *swrast; - const __DRIdri2Extension *dri2; - __glxHashTable *drawHash; - Display *dpy; - int scr, fd; - void *driver; + __DRIscreen *__driScreen; + const __DRIcoreExtension *core; + const __DRIlegacyExtension *legacy; + const __DRIswrastExtension *swrast; + const __DRIdri2Extension *dri2; + __glxHashTable *drawHash; + Display *dpy; + int scr, fd; + void *driver; - __GLXDRIscreen *driScreen; + __GLXDRIscreen *driScreen; #ifdef __DRI_COPY_SUB_BUFFER - const __DRIcopySubBufferExtension *copySubBuffer; + const __DRIcopySubBufferExtension *copySubBuffer; #endif #ifdef __DRI_SWAP_CONTROL - const __DRIswapControlExtension *swapControl; + const __DRIswapControlExtension *swapControl; #endif #ifdef __DRI_ALLOCATE - const __DRIallocateExtension *allocate; + const __DRIallocateExtension *allocate; #endif #ifdef __DRI_FRAME_TRACKING - const __DRIframeTrackingExtension *frameTracking; + const __DRIframeTrackingExtension *frameTracking; #endif #ifdef __DRI_MEDIA_STREAM_COUNTER - const __DRImediaStreamCounterExtension *msc; + const __DRImediaStreamCounterExtension *msc; #endif #ifdef __DRI_TEX_BUFFER - const __DRItexBufferExtension *texBuffer; + const __DRItexBufferExtension *texBuffer; #endif #endif @@ -521,7 +529,7 @@ struct __GLXscreenConfigsRec { /** * Linked list of glx visuals and fbconfigs for this screen. */ - __GLcontextModes *visuals, *configs; + __GLcontextModes *visuals, *configs; /** * Per-screen dynamic GLX extension tracking. The \c direct_support @@ -530,10 +538,10 @@ struct __GLXscreenConfigsRec { * this field. The \c __GLXscreenConfigs structure is not used outside * libGL. */ - /*@{*/ - unsigned char direct_support[8]; - GLboolean ext_list_first_time; - /*@}*/ + /*@{ */ + unsigned char direct_support[8]; + GLboolean ext_list_first_time; + /*@} */ }; @@ -541,26 +549,27 @@ struct __GLXscreenConfigsRec { * Per display private data. One of these records exists for each display * that is using the OpenGL (GLX) extension. */ -struct __GLXdisplayPrivateRec { +struct __GLXdisplayPrivateRec +{ /** * Back pointer to the display */ - Display *dpy; + Display *dpy; /** * The \c majorOpcode is common to all connections to the same server. * It is also copied into the context structure. */ - int majorOpcode; + int majorOpcode; /** * \name Server Version * * Major and minor version returned by the server during initialization. */ - /*@{*/ - int majorVersion, minorVersion; - /*@}*/ + /*@{ */ + int majorVersion, minorVersion; + /*@} */ /** * \name Storage for the servers GLX vendor and versions strings. @@ -568,40 +577,40 @@ struct __GLXdisplayPrivateRec { * These are the same for all screens on this display. These fields will * be filled in on demand. */ - /*@{*/ - const char *serverGLXvendor; - const char *serverGLXversion; - /*@}*/ + /*@{ */ + const char *serverGLXvendor; + const char *serverGLXversion; + /*@} */ /** * Configurations of visuals for all screens on this display. * Also, per screen data which now includes the server \c GLX_EXTENSION * string. */ - __GLXscreenConfigs *screenConfigs; + __GLXscreenConfigs *screenConfigs; #ifdef GLX_DIRECT_RENDERING /** * Per display direct rendering interface functions and data. */ - __GLXDRIdisplay *driswDisplay; - __GLXDRIdisplay *driDisplay; - __GLXDRIdisplay *dri2Display; + __GLXDRIdisplay *driswDisplay; + __GLXDRIdisplay *driDisplay; + __GLXDRIdisplay *dri2Display; #endif }; -extern GLubyte *__glXFlushRenderBuffer(__GLXcontext*, GLubyte*); +extern GLubyte *__glXFlushRenderBuffer(__GLXcontext *, GLubyte *); -extern void __glXSendLargeChunk(__GLXcontext *gc, GLint requestNumber, - GLint totalRequests, - const GLvoid * data, GLint dataLen); +extern void __glXSendLargeChunk(__GLXcontext * gc, GLint requestNumber, + GLint totalRequests, + const GLvoid * data, GLint dataLen); extern void __glXSendLargeCommand(__GLXcontext *, const GLvoid *, GLint, - const GLvoid *, GLint); + const GLvoid *, GLint); /* Initialize the GLX extension for dpy */ -extern __GLXdisplayPrivate *__glXInitialize(Display*); +extern __GLXdisplayPrivate *__glXInitialize(Display *); extern void __glXPreferEGL(int state); @@ -612,12 +621,12 @@ extern int __glXDebug; /* This is per-thread storage in an MT environment */ #if defined( USE_XTHREADS ) || defined( PTHREADS ) -extern void __glXSetCurrentContext(__GLXcontext *c); +extern void __glXSetCurrentContext(__GLXcontext * c); # if defined( GLX_USE_TLS ) -extern __thread void * __glX_tls_Context - __attribute__((tls_model("initial-exec"))); +extern __thread void *__glX_tls_Context + __attribute__ ((tls_model("initial-exec"))); # define __glXGetCurrentContext() __glX_tls_Context @@ -637,7 +646,7 @@ extern __GLXcontext *__glXcurrentContext; extern void __glXSetCurrentContextNull(void); -extern void __glXFreeContext(__GLXcontext*); +extern void __glXFreeContext(__GLXcontext *); /* @@ -660,7 +669,7 @@ extern pthread_mutex_t __glXmutex; /* ** Setup for a command. Initialize the extension for dpy if necessary. */ -extern CARD8 __glXSetupForCommand(Display *dpy); +extern CARD8 __glXSetupForCommand(Display * dpy); /************************************************************************/ @@ -671,9 +680,11 @@ extern CARD8 __glXSetupForCommand(Display *dpy); extern const GLuint __glXDefaultPixelStore[9]; /* Send an image to the server using RenderLarge. */ -extern void __glXSendLargeImage(__GLXcontext *gc, GLint compsize, GLint dim, - GLint width, GLint height, GLint depth, GLenum format, GLenum type, - const GLvoid *src, GLubyte *pc, GLubyte *modes); +extern void __glXSendLargeImage(__GLXcontext * gc, GLint compsize, GLint dim, + GLint width, GLint height, GLint depth, + GLenum format, GLenum type, + const GLvoid * src, GLubyte * pc, + GLubyte * modes); /* Return the size, in bytes, of some pixel data */ extern GLint __glImageSize(GLint, GLint, GLint, GLenum, GLenum, GLenum); @@ -693,23 +704,23 @@ extern GLint __glBytesPerElement(GLenum type); ** updated to contain the modes needed by the server to decode the ** sent data. */ -extern void __glFillImage(__GLXcontext*, GLint, GLint, GLint, GLint, GLenum, - GLenum, const GLvoid*, GLubyte*, GLubyte*); +extern void __glFillImage(__GLXcontext *, GLint, GLint, GLint, GLint, GLenum, + GLenum, const GLvoid *, GLubyte *, GLubyte *); /* Copy map data with a stride into a packed buffer */ extern void __glFillMap1f(GLint, GLint, GLint, const GLfloat *, GLubyte *); extern void __glFillMap1d(GLint, GLint, GLint, const GLdouble *, GLubyte *); extern void __glFillMap2f(GLint, GLint, GLint, GLint, GLint, - const GLfloat *, GLfloat *); + const GLfloat *, GLfloat *); extern void __glFillMap2d(GLint, GLint, GLint, GLint, GLint, - const GLdouble *, GLdouble *); + const GLdouble *, GLdouble *); /* ** Empty an image out of the reply buffer into the clients memory applying ** the pack modes to pack back into the clients requested format. */ -extern void __glEmptyImage(__GLXcontext*, GLint, GLint, GLint, GLint, GLenum, - GLenum, const GLubyte *, GLvoid *); +extern void __glEmptyImage(__GLXcontext *, GLint, GLint, GLint, GLint, GLenum, + GLenum, const GLubyte *, GLvoid *); /* @@ -722,7 +733,7 @@ extern void __glXFreeVertexArrayState(__GLXcontext *); ** Inform the Server of the major and minor numbers and of the client ** libraries extension string. */ -extern void __glXClientInfo ( Display *dpy, int opcode ); +extern void __glXClientInfo(Display * dpy, int opcode); /************************************************************************/ @@ -730,18 +741,21 @@ extern void __glXClientInfo ( Display *dpy, int opcode ); ** Declarations that should be in Xlib */ #ifdef __GL_USE_OUR_PROTOTYPES -extern void _XFlush(Display*); -extern Status _XReply(Display*, xReply*, int, Bool); -extern void _XRead(Display*, void*, long); -extern void _XSend(Display*, const void*, long); +extern void _XFlush(Display *); +extern Status _XReply(Display *, xReply *, int, Bool); +extern void _XRead(Display *, void *, long); +extern void _XSend(Display *, const void *, long); #endif -extern void __glXInitializeVisualConfigFromTags( __GLcontextModes *config, - int count, const INT32 *bp, Bool tagged_only, Bool fbconfig_style_tags ); +extern void __glXInitializeVisualConfigFromTags(__GLcontextModes * config, + int count, const INT32 * bp, + Bool tagged_only, + Bool fbconfig_style_tags); -extern char * __glXGetStringFromServer( Display * dpy, int opcode, - CARD32 glxCode, CARD32 for_whom, CARD32 name ); +extern char *__glXGetStringFromServer(Display * dpy, int opcode, + CARD32 glxCode, CARD32 for_whom, + CARD32 name); extern char *__glXstrdup(const char *str); @@ -750,15 +764,16 @@ extern const char __glXGLClientVersion[]; extern const char __glXGLClientExtensions[]; /* Get the unadjusted system time */ -extern int __glXGetUST( int64_t * ust ); +extern int __glXGetUST(int64_t * ust); extern GLboolean __glXGetMscRateOML(Display * dpy, GLXDrawable drawable, - int32_t * numerator, int32_t * denominator); + int32_t * numerator, + int32_t * denominator); #ifdef GLX_DIRECT_RENDERING GLboolean -__driGetMscRateOML(__DRIdrawable *draw, - int32_t *numerator, int32_t *denominator, void *private); +__driGetMscRateOML(__DRIdrawable * draw, + int32_t * numerator, int32_t * denominator, void *private); #endif #endif /* !__GLX_client_h__ */ -- cgit v1.2.3 From e5ef0beb0549b2b613c379553cc51f9f1ae72299 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Tue, 14 Oct 2008 23:07:42 -0400 Subject: Revert pointless reindents to avoid merge conflicts. Why are we reindenting code that's work in progress... --- src/glx/x11/glxclient.h | 361 +++++++++++++++++++++++------------------------- 1 file changed, 173 insertions(+), 188 deletions(-) (limited to 'src/glx/x11/glxclient.h') diff --git a/src/glx/x11/glxclient.h b/src/glx/x11/glxclient.h index 5cac25a142..2d530eabdb 100644 --- a/src/glx/x11/glxclient.h +++ b/src/glx/x11/glxclient.h @@ -81,7 +81,7 @@ -#define GLX_MAJOR_VERSION 1 /* current version numbers */ +#define GLX_MAJOR_VERSION 1 /* current version numbers */ #define GLX_MINOR_VERSION 4 #define __GLX_MAX_TEXTURE_UNITS 32 @@ -113,73 +113,70 @@ typedef struct __GLXDRIcontextRec __GLXDRIcontext; #include "glxextensions.h" -struct __GLXDRIdisplayRec -{ +struct __GLXDRIdisplayRec { /** * Method to destroy the private DRI display data. */ - void (*destroyDisplay) (__GLXDRIdisplay * display); + void (*destroyDisplay)(__GLXDRIdisplay *display); - __GLXDRIscreen *(*createScreen) (__GLXscreenConfigs * psc, int screen, - __GLXdisplayPrivate * priv); + __GLXDRIscreen *(*createScreen)(__GLXscreenConfigs *psc, int screen, + __GLXdisplayPrivate *priv); }; -struct __GLXDRIscreenRec -{ +struct __GLXDRIscreenRec { - void (*destroyScreen) (__GLXscreenConfigs * psc); + void (*destroyScreen)(__GLXscreenConfigs *psc); - __GLXDRIcontext *(*createContext) (__GLXscreenConfigs * psc, - const __GLcontextModes * mode, - GLXContext gc, - GLXContext shareList, int renderType); + __GLXDRIcontext *(*createContext)(__GLXscreenConfigs *psc, + const __GLcontextModes *mode, + GLXContext gc, + GLXContext shareList, int renderType); + + __GLXDRIdrawable *(*createDrawable)(__GLXscreenConfigs *psc, + XID drawable, + GLXDrawable glxDrawable, + const __GLcontextModes *modes); - __GLXDRIdrawable *(*createDrawable) (__GLXscreenConfigs * psc, - XID drawable, - GLXDrawable glxDrawable, - const __GLcontextModes * modes); - - void (*swapBuffers) (__GLXDRIdrawable * pdraw); + void (*swapBuffers)(__GLXDRIdrawable *pdraw); }; -struct __GLXDRIcontextRec -{ - void (*destroyContext) (__GLXDRIcontext * context, - __GLXscreenConfigs * psc, Display * dpy); - Bool(*bindContext) (__GLXDRIcontext * context, __GLXDRIdrawable * pdraw, - __GLXDRIdrawable * pread); - - void (*unbindContext) (__GLXDRIcontext * context); +struct __GLXDRIcontextRec { + void (*destroyContext)(__GLXDRIcontext *context, __GLXscreenConfigs *psc, + Display *dpy); + Bool (*bindContext)(__GLXDRIcontext *context, + __GLXDRIdrawable *pdraw, + __GLXDRIdrawable *pread); + + void (*unbindContext)(__GLXDRIcontext *context); }; -struct __GLXDRIdrawableRec -{ - void (*destroyDrawable) (__GLXDRIdrawable * drawable); +struct __GLXDRIdrawableRec { + void (*destroyDrawable)(__GLXDRIdrawable *drawable); - XID xDrawable; - XID drawable; - __GLXscreenConfigs *psc; - GLenum textureTarget; - __DRIdrawable *driDrawable; + XID xDrawable; + XID drawable; + __GLXscreenConfigs *psc; + GLenum textureTarget; + __DRIdrawable *driDrawable; }; /* ** Function to create and DRI display data and initialize the display ** dependent methods. */ -extern __GLXDRIdisplay *driswCreateDisplay(Display * dpy); -extern __GLXDRIdisplay *driCreateDisplay(Display * dpy); -extern __GLXDRIdisplay *dri2CreateDisplay(Display * dpy); +extern __GLXDRIdisplay *driswCreateDisplay(Display *dpy); +extern __GLXDRIdisplay *driCreateDisplay(Display *dpy); +extern __GLXDRIdisplay *dri2CreateDisplay(Display *dpy); -extern void DRI_glXUseXFont(Font font, int first, int count, int listbase); +extern void DRI_glXUseXFont( Font font, int first, int count, int listbase ); /* ** Functions to obtain driver configuration information from a direct ** rendering client application */ -extern const char *glXGetScreenDriver(Display * dpy, int scrNum); +extern const char *glXGetScreenDriver (Display *dpy, int scrNum); -extern const char *glXGetDriverConfig(const char *driverName); +extern const char *glXGetDriverConfig (const char *driverName); #endif @@ -187,57 +184,53 @@ extern const char *glXGetDriverConfig(const char *driverName); #define __GL_CLIENT_ATTRIB_STACK_DEPTH 16 -typedef struct __GLXpixelStoreModeRec -{ - GLboolean swapEndian; - GLboolean lsbFirst; - GLuint rowLength; - GLuint imageHeight; - GLuint imageDepth; - GLuint skipRows; - GLuint skipPixels; - GLuint skipImages; - GLuint alignment; +typedef struct __GLXpixelStoreModeRec { + GLboolean swapEndian; + GLboolean lsbFirst; + GLuint rowLength; + GLuint imageHeight; + GLuint imageDepth; + GLuint skipRows; + GLuint skipPixels; + GLuint skipImages; + GLuint alignment; } __GLXpixelStoreMode; -typedef struct __GLXattributeRec -{ - GLuint mask; +typedef struct __GLXattributeRec { + GLuint mask; /** * Pixel storage state. Most of the pixel store mode state is kept * here and used by the client code to manage the packing and * unpacking of data sent to/received from the server. */ - __GLXpixelStoreMode storePack, storeUnpack; + __GLXpixelStoreMode storePack, storeUnpack; /** * Is EXT_vertex_array / GL 1.1 DrawArrays protocol specifically * disabled? */ - GLboolean NoDrawArraysProtocol; - + GLboolean NoDrawArraysProtocol; + /** * Vertex Array storage state. The vertex array component * state is stored here and is used to manage the packing of * DrawArrays data sent to the server. */ - struct array_state_vector *array_state; + struct array_state_vector * array_state; } __GLXattribute; -typedef struct __GLXattributeMachineRec -{ - __GLXattribute *stack[__GL_CLIENT_ATTRIB_STACK_DEPTH]; - __GLXattribute **stackPointer; +typedef struct __GLXattributeMachineRec { + __GLXattribute *stack[__GL_CLIENT_ATTRIB_STACK_DEPTH]; + __GLXattribute **stackPointer; } __GLXattributeMachine; /** * GLX state that needs to be kept on the client. One of these records * exist for each context that has been made current by this client. */ -struct __GLXcontextRec -{ +struct __GLXcontextRec { /** * \name Drawing command buffer. * @@ -254,13 +247,13 @@ struct __GLXcontextRec * These must be the first 6 fields since they are static initialized * in the dummy context in glxext.c */ - /*@{ */ - GLubyte *buf; - GLubyte *pc; - GLubyte *limit; - GLubyte *bufEnd; - GLint bufSize; - /*@} */ + /*@{*/ + GLubyte *buf; + GLubyte *pc; + GLubyte *limit; + GLubyte *bufEnd; + GLint bufSize; + /*@}*/ /** * The XID of this rendering context. When the context is created a @@ -268,24 +261,24 @@ struct __GLXcontextRec * destroyed but is still current to some thread. In this case the * context will be freed on next MakeCurrent. */ - XID xid; + XID xid; /** * The XID of the \c shareList context. */ - XID share_xid; + XID share_xid; /** * Screen number. */ - GLint screen; - __GLXscreenConfigs *psc; + GLint screen; + __GLXscreenConfigs *psc; /** * \c GL_TRUE if the context was created with ImportContext, which * means the server-side context was created by another X client. */ - GLboolean imported; + GLboolean imported; /** * The context tag returned by MakeCurrent when this context is made @@ -295,7 +288,7 @@ struct __GLXcontextRec * \c WaitX, \c WaitGL, \c UseXFont, and \c MakeCurrent (for the old * context)). */ - GLXContextTag currentContextTag; + GLXContextTag currentContextTag; /** * \name Rendering mode @@ -304,11 +297,11 @@ struct __GLXcontextRec * When \c glRenderMode is called, the buffer associated with the * previous rendering mode (feedback or select) is filled. */ - /*@{ */ - GLenum renderMode; - GLfloat *feedbackBuf; - GLuint *selectBuf; - /*@} */ + /*@{*/ + GLenum renderMode; + GLfloat *feedbackBuf; + GLuint *selectBuf; + /*@}*/ /** * This is \c GL_TRUE if the pixel unpack modes are such that an image @@ -316,43 +309,43 @@ struct __GLXcontextRec * still be true that the server will have to do some work. This * just promises that a straight copy will fetch the correct bytes. */ - GLboolean fastImageUnpack; + GLboolean fastImageUnpack; /** * Fill newImage with the unpacked form of \c oldImage getting it * ready for transport to the server. */ - void (*fillImage) (__GLXcontext *, GLint, GLint, GLint, GLint, GLenum, - GLenum, const GLvoid *, GLubyte *, GLubyte *); + void (*fillImage)(__GLXcontext*, GLint, GLint, GLint, GLint, GLenum, + GLenum, const GLvoid*, GLubyte*, GLubyte*); /** * Client side attribs. */ - __GLXattributeMachine attributes; + __GLXattributeMachine attributes; /** * Client side error code. This is set when client side gl API * routines need to set an error because of a bad enumerant or * running out of memory, etc. */ - GLenum error; + GLenum error; /** * Whether this context does direct rendering. */ - Bool isDirect; + Bool isDirect; /** * \c dpy of current display for this context. Will be \c NULL if not * current to any display, or if this is the "dummy context". */ - Display *currentDpy; + Display *currentDpy; /** * The current drawable for this context. Will be None if this * context is not current to any drawable. currentReadable is below. */ - GLXDrawable currentDrawable; + GLXDrawable currentDrawable; /** * \name GL Constant Strings @@ -361,38 +354,38 @@ struct __GLXcontextRec * These pertain to GL attributes, not to be confused with * GLX versioning attributes. */ - /*@{ */ - GLubyte *vendor; - GLubyte *renderer; - GLubyte *version; - GLubyte *extensions; - /*@} */ + /*@{*/ + GLubyte *vendor; + GLubyte *renderer; + GLubyte *version; + GLubyte *extensions; + /*@}*/ /** * Record the dpy this context was created on for later freeing */ - Display *createDpy; + Display *createDpy; /** * Maximum small render command size. This is the smaller of 64k and * the size of the above buffer. */ - GLint maxSmallRenderCommandSize; + GLint maxSmallRenderCommandSize; /** * Major opcode for the extension. Copied here so a lookup isn't * needed. */ - GLint majorOpcode; + GLint majorOpcode; /** * Pointer to the mode used to create this context. */ - const __GLcontextModes *mode; + const __GLcontextModes * mode; #ifdef GLX_DIRECT_RENDERING - __GLXDRIcontext *driContext; - __DRIcontext *__driContext; + __GLXDRIcontext *driContext; + __DRIcontext *__driContext; #endif /** @@ -401,7 +394,7 @@ struct __GLXcontextRec * * \since Internal API version 20030606. */ - GLXDrawable currentReadable; + GLXDrawable currentReadable; /** * Pointer to client-state data that is private to libGL. This is only @@ -410,13 +403,13 @@ struct __GLXcontextRec * No internal API version change was made for this change. Client-side * drivers should NEVER use this data or even care that it exists. */ - void *client_state_private; + void * client_state_private; /** * Stored value for \c glXQueryContext attribute \c GLX_RENDER_TYPE. */ int renderType; - + /** * \name Raw server GL version * @@ -424,12 +417,12 @@ struct __GLXcontextRec * returned by the server, and it may not reflect what is actually * supported (or reported) by the client-side library. */ - /*@{ */ + /*@{*/ int server_major; /**< Major version number. */ int server_minor; /**< Minor version number. */ - /*@} */ + /*@}*/ - char gl_extension_bits[__GL_EXT_BYTES]; + char gl_extension_bits[ __GL_EXT_BYTES ]; }; #define __glXSetError(gc,code) \ @@ -471,57 +464,56 @@ extern void __glFreeAttributeState(__GLXcontext *); * One of these records exists per screen of the display. It contains * a pointer to the config data for that screen (if the screen supports GL). */ -struct __GLXscreenConfigsRec -{ +struct __GLXscreenConfigsRec { /** * GLX extension string reported by the X-server. */ - const char *serverGLXexts; + const char *serverGLXexts; /** * GLX extension string to be reported to applications. This is the * set of extensions that the application can actually use. */ - char *effectiveGLXexts; + char *effectiveGLXexts; #ifdef GLX_DIRECT_RENDERING /** * Per screen direct rendering interface functions and data. */ - __DRIscreen *__driScreen; - const __DRIcoreExtension *core; - const __DRIlegacyExtension *legacy; - const __DRIswrastExtension *swrast; - const __DRIdri2Extension *dri2; - __glxHashTable *drawHash; - Display *dpy; - int scr, fd; - void *driver; + __DRIscreen *__driScreen; + const __DRIcoreExtension *core; + const __DRIlegacyExtension *legacy; + const __DRIswrastExtension *swrast; + const __DRIdri2Extension *dri2; + __glxHashTable *drawHash; + Display *dpy; + int scr, fd; + void *driver; - __GLXDRIscreen *driScreen; + __GLXDRIscreen *driScreen; #ifdef __DRI_COPY_SUB_BUFFER - const __DRIcopySubBufferExtension *copySubBuffer; + const __DRIcopySubBufferExtension *copySubBuffer; #endif #ifdef __DRI_SWAP_CONTROL - const __DRIswapControlExtension *swapControl; + const __DRIswapControlExtension *swapControl; #endif #ifdef __DRI_ALLOCATE - const __DRIallocateExtension *allocate; + const __DRIallocateExtension *allocate; #endif #ifdef __DRI_FRAME_TRACKING - const __DRIframeTrackingExtension *frameTracking; + const __DRIframeTrackingExtension *frameTracking; #endif #ifdef __DRI_MEDIA_STREAM_COUNTER - const __DRImediaStreamCounterExtension *msc; + const __DRImediaStreamCounterExtension *msc; #endif #ifdef __DRI_TEX_BUFFER - const __DRItexBufferExtension *texBuffer; + const __DRItexBufferExtension *texBuffer; #endif #endif @@ -529,7 +521,7 @@ struct __GLXscreenConfigsRec /** * Linked list of glx visuals and fbconfigs for this screen. */ - __GLcontextModes *visuals, *configs; + __GLcontextModes *visuals, *configs; /** * Per-screen dynamic GLX extension tracking. The \c direct_support @@ -538,10 +530,10 @@ struct __GLXscreenConfigsRec * this field. The \c __GLXscreenConfigs structure is not used outside * libGL. */ - /*@{ */ - unsigned char direct_support[8]; - GLboolean ext_list_first_time; - /*@} */ + /*@{*/ + unsigned char direct_support[8]; + GLboolean ext_list_first_time; + /*@}*/ }; @@ -549,27 +541,26 @@ struct __GLXscreenConfigsRec * Per display private data. One of these records exists for each display * that is using the OpenGL (GLX) extension. */ -struct __GLXdisplayPrivateRec -{ +struct __GLXdisplayPrivateRec { /** * Back pointer to the display */ - Display *dpy; + Display *dpy; /** * The \c majorOpcode is common to all connections to the same server. * It is also copied into the context structure. */ - int majorOpcode; + int majorOpcode; /** * \name Server Version * * Major and minor version returned by the server during initialization. */ - /*@{ */ - int majorVersion, minorVersion; - /*@} */ + /*@{*/ + int majorVersion, minorVersion; + /*@}*/ /** * \name Storage for the servers GLX vendor and versions strings. @@ -577,40 +568,40 @@ struct __GLXdisplayPrivateRec * These are the same for all screens on this display. These fields will * be filled in on demand. */ - /*@{ */ - const char *serverGLXvendor; - const char *serverGLXversion; - /*@} */ + /*@{*/ + const char *serverGLXvendor; + const char *serverGLXversion; + /*@}*/ /** * Configurations of visuals for all screens on this display. * Also, per screen data which now includes the server \c GLX_EXTENSION * string. */ - __GLXscreenConfigs *screenConfigs; + __GLXscreenConfigs *screenConfigs; #ifdef GLX_DIRECT_RENDERING /** * Per display direct rendering interface functions and data. */ - __GLXDRIdisplay *driswDisplay; - __GLXDRIdisplay *driDisplay; - __GLXDRIdisplay *dri2Display; + __GLXDRIdisplay *driswDisplay; + __GLXDRIdisplay *driDisplay; + __GLXDRIdisplay *dri2Display; #endif }; -extern GLubyte *__glXFlushRenderBuffer(__GLXcontext *, GLubyte *); +extern GLubyte *__glXFlushRenderBuffer(__GLXcontext*, GLubyte*); -extern void __glXSendLargeChunk(__GLXcontext * gc, GLint requestNumber, - GLint totalRequests, - const GLvoid * data, GLint dataLen); +extern void __glXSendLargeChunk(__GLXcontext *gc, GLint requestNumber, + GLint totalRequests, + const GLvoid * data, GLint dataLen); extern void __glXSendLargeCommand(__GLXcontext *, const GLvoid *, GLint, - const GLvoid *, GLint); + const GLvoid *, GLint); /* Initialize the GLX extension for dpy */ -extern __GLXdisplayPrivate *__glXInitialize(Display *); +extern __GLXdisplayPrivate *__glXInitialize(Display*); extern void __glXPreferEGL(int state); @@ -621,12 +612,12 @@ extern int __glXDebug; /* This is per-thread storage in an MT environment */ #if defined( USE_XTHREADS ) || defined( PTHREADS ) -extern void __glXSetCurrentContext(__GLXcontext * c); +extern void __glXSetCurrentContext(__GLXcontext *c); # if defined( GLX_USE_TLS ) -extern __thread void *__glX_tls_Context - __attribute__ ((tls_model("initial-exec"))); +extern __thread void * __glX_tls_Context + __attribute__((tls_model("initial-exec"))); # define __glXGetCurrentContext() __glX_tls_Context @@ -646,7 +637,7 @@ extern __GLXcontext *__glXcurrentContext; extern void __glXSetCurrentContextNull(void); -extern void __glXFreeContext(__GLXcontext *); +extern void __glXFreeContext(__GLXcontext*); /* @@ -669,7 +660,7 @@ extern pthread_mutex_t __glXmutex; /* ** Setup for a command. Initialize the extension for dpy if necessary. */ -extern CARD8 __glXSetupForCommand(Display * dpy); +extern CARD8 __glXSetupForCommand(Display *dpy); /************************************************************************/ @@ -680,11 +671,9 @@ extern CARD8 __glXSetupForCommand(Display * dpy); extern const GLuint __glXDefaultPixelStore[9]; /* Send an image to the server using RenderLarge. */ -extern void __glXSendLargeImage(__GLXcontext * gc, GLint compsize, GLint dim, - GLint width, GLint height, GLint depth, - GLenum format, GLenum type, - const GLvoid * src, GLubyte * pc, - GLubyte * modes); +extern void __glXSendLargeImage(__GLXcontext *gc, GLint compsize, GLint dim, + GLint width, GLint height, GLint depth, GLenum format, GLenum type, + const GLvoid *src, GLubyte *pc, GLubyte *modes); /* Return the size, in bytes, of some pixel data */ extern GLint __glImageSize(GLint, GLint, GLint, GLenum, GLenum, GLenum); @@ -704,23 +693,23 @@ extern GLint __glBytesPerElement(GLenum type); ** updated to contain the modes needed by the server to decode the ** sent data. */ -extern void __glFillImage(__GLXcontext *, GLint, GLint, GLint, GLint, GLenum, - GLenum, const GLvoid *, GLubyte *, GLubyte *); +extern void __glFillImage(__GLXcontext*, GLint, GLint, GLint, GLint, GLenum, + GLenum, const GLvoid*, GLubyte*, GLubyte*); /* Copy map data with a stride into a packed buffer */ extern void __glFillMap1f(GLint, GLint, GLint, const GLfloat *, GLubyte *); extern void __glFillMap1d(GLint, GLint, GLint, const GLdouble *, GLubyte *); extern void __glFillMap2f(GLint, GLint, GLint, GLint, GLint, - const GLfloat *, GLfloat *); + const GLfloat *, GLfloat *); extern void __glFillMap2d(GLint, GLint, GLint, GLint, GLint, - const GLdouble *, GLdouble *); + const GLdouble *, GLdouble *); /* ** Empty an image out of the reply buffer into the clients memory applying ** the pack modes to pack back into the clients requested format. */ -extern void __glEmptyImage(__GLXcontext *, GLint, GLint, GLint, GLint, GLenum, - GLenum, const GLubyte *, GLvoid *); +extern void __glEmptyImage(__GLXcontext*, GLint, GLint, GLint, GLint, GLenum, + GLenum, const GLubyte *, GLvoid *); /* @@ -733,7 +722,7 @@ extern void __glXFreeVertexArrayState(__GLXcontext *); ** Inform the Server of the major and minor numbers and of the client ** libraries extension string. */ -extern void __glXClientInfo(Display * dpy, int opcode); +extern void __glXClientInfo ( Display *dpy, int opcode ); /************************************************************************/ @@ -741,21 +730,18 @@ extern void __glXClientInfo(Display * dpy, int opcode); ** Declarations that should be in Xlib */ #ifdef __GL_USE_OUR_PROTOTYPES -extern void _XFlush(Display *); -extern Status _XReply(Display *, xReply *, int, Bool); -extern void _XRead(Display *, void *, long); -extern void _XSend(Display *, const void *, long); +extern void _XFlush(Display*); +extern Status _XReply(Display*, xReply*, int, Bool); +extern void _XRead(Display*, void*, long); +extern void _XSend(Display*, const void*, long); #endif -extern void __glXInitializeVisualConfigFromTags(__GLcontextModes * config, - int count, const INT32 * bp, - Bool tagged_only, - Bool fbconfig_style_tags); +extern void __glXInitializeVisualConfigFromTags( __GLcontextModes *config, + int count, const INT32 *bp, Bool tagged_only, Bool fbconfig_style_tags ); -extern char *__glXGetStringFromServer(Display * dpy, int opcode, - CARD32 glxCode, CARD32 for_whom, - CARD32 name); +extern char * __glXGetStringFromServer( Display * dpy, int opcode, + CARD32 glxCode, CARD32 for_whom, CARD32 name ); extern char *__glXstrdup(const char *str); @@ -764,16 +750,15 @@ extern const char __glXGLClientVersion[]; extern const char __glXGLClientExtensions[]; /* Get the unadjusted system time */ -extern int __glXGetUST(int64_t * ust); +extern int __glXGetUST( int64_t * ust ); extern GLboolean __glXGetMscRateOML(Display * dpy, GLXDrawable drawable, - int32_t * numerator, - int32_t * denominator); + int32_t * numerator, int32_t * denominator); #ifdef GLX_DIRECT_RENDERING GLboolean -__driGetMscRateOML(__DRIdrawable * draw, - int32_t * numerator, int32_t * denominator, void *private); +__driGetMscRateOML(__DRIdrawable *draw, + int32_t *numerator, int32_t *denominator, void *private); #endif #endif /* !__GLX_client_h__ */ -- cgit v1.2.3 From d533a5d00ae2d0669e9da41718ee847de0c343aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Sat, 11 Oct 2008 20:41:14 -0400 Subject: Update DRI2 implementation according to new specification. --- src/glx/x11/glxclient.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/glx/x11/glxclient.h') diff --git a/src/glx/x11/glxclient.h b/src/glx/x11/glxclient.h index 2d530eabdb..80f28332b7 100644 --- a/src/glx/x11/glxclient.h +++ b/src/glx/x11/glxclient.h @@ -138,6 +138,8 @@ struct __GLXDRIscreenRec { const __GLcontextModes *modes); void (*swapBuffers)(__GLXDRIdrawable *pdraw); + void (*copySubBuffer)(__GLXDRIdrawable *pdraw, + int x, int y, int width, int height); }; struct __GLXDRIcontextRec { @@ -493,7 +495,7 @@ struct __GLXscreenConfigsRec { __GLXDRIscreen *driScreen; #ifdef __DRI_COPY_SUB_BUFFER - const __DRIcopySubBufferExtension *copySubBuffer; + const __DRIcopySubBufferExtension *driCopySubBuffer; #endif #ifdef __DRI_SWAP_CONTROL -- cgit v1.2.3