glx: indent -br -i3 -npcs --no-tabs drisw_glx.c
This commit is contained in:
parent
4e88ae5639
commit
60aa0918a1
|
@ -34,17 +34,20 @@ typedef struct __GLXDRIdisplayPrivateRec __GLXDRIdisplayPrivate;
|
||||||
typedef struct __GLXDRIcontextPrivateRec __GLXDRIcontextPrivate;
|
typedef struct __GLXDRIcontextPrivateRec __GLXDRIcontextPrivate;
|
||||||
typedef struct __GLXDRIdrawablePrivateRec __GLXDRIdrawablePrivate;
|
typedef struct __GLXDRIdrawablePrivateRec __GLXDRIdrawablePrivate;
|
||||||
|
|
||||||
struct __GLXDRIdisplayPrivateRec {
|
struct __GLXDRIdisplayPrivateRec
|
||||||
|
{
|
||||||
__GLXDRIdisplay base;
|
__GLXDRIdisplay base;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct __GLXDRIcontextPrivateRec {
|
struct __GLXDRIcontextPrivateRec
|
||||||
|
{
|
||||||
__GLXDRIcontext base;
|
__GLXDRIcontext base;
|
||||||
__DRIcontext *driContext;
|
__DRIcontext *driContext;
|
||||||
__GLXscreenConfigs *psc;
|
__GLXscreenConfigs *psc;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct __GLXDRIdrawablePrivateRec {
|
struct __GLXDRIdrawablePrivateRec
|
||||||
|
{
|
||||||
__GLXDRIdrawable base;
|
__GLXDRIdrawable base;
|
||||||
|
|
||||||
GC gc;
|
GC gc;
|
||||||
|
@ -59,8 +62,9 @@ struct __GLXDRIdrawablePrivateRec {
|
||||||
* swrast loader functions
|
* swrast loader functions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static Bool XCreateDrawable(__GLXDRIdrawablePrivate *pdp,
|
static Bool
|
||||||
Display *dpy, XID drawable, int visualid)
|
XCreateDrawable(__GLXDRIdrawablePrivate * pdp,
|
||||||
|
Display * dpy, XID drawable, int visualid)
|
||||||
{
|
{
|
||||||
XGCValues gcvalues;
|
XGCValues gcvalues;
|
||||||
long visMask;
|
long visMask;
|
||||||
|
@ -83,10 +87,7 @@ static Bool XCreateDrawable(__GLXDRIdrawablePrivate *pdp,
|
||||||
visMask = (VisualScreenMask | VisualIDMask);
|
visMask = (VisualScreenMask | VisualIDMask);
|
||||||
pdp->visinfo = XGetVisualInfo(dpy, visMask, &visTemp, &num_visuals);
|
pdp->visinfo = XGetVisualInfo(dpy, visMask, &visTemp, &num_visuals);
|
||||||
|
|
||||||
pdp->ximage = XCreateImage(dpy,
|
pdp->ximage = XCreateImage(dpy, pdp->visinfo->visual, pdp->visinfo->depth, ZPixmap, 0, /* format, offset */
|
||||||
pdp->visinfo->visual,
|
|
||||||
pdp->visinfo->depth,
|
|
||||||
ZPixmap, 0, /* format, offset */
|
|
||||||
NULL, /* data */
|
NULL, /* data */
|
||||||
0, 0, /* size */
|
0, 0, /* size */
|
||||||
32, /* bitmap_pad */
|
32, /* bitmap_pad */
|
||||||
|
@ -98,8 +99,8 @@ static Bool XCreateDrawable(__GLXDRIdrawablePrivate *pdp,
|
||||||
return True;
|
return True;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void XDestroyDrawable(__GLXDRIdrawablePrivate *pdp,
|
static void
|
||||||
Display *dpy, XID drawable)
|
XDestroyDrawable(__GLXDRIdrawablePrivate * pdp, Display * dpy, XID drawable)
|
||||||
{
|
{
|
||||||
XDestroyImage(pdp->ximage);
|
XDestroyImage(pdp->ximage);
|
||||||
XFree(pdp->visinfo);
|
XFree(pdp->visinfo);
|
||||||
|
@ -109,9 +110,8 @@ static void XDestroyDrawable(__GLXDRIdrawablePrivate *pdp,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
swrastGetDrawableInfo(__DRIdrawable *draw,
|
swrastGetDrawableInfo(__DRIdrawable * draw,
|
||||||
int *x, int *y, int *w, int *h,
|
int *x, int *y, int *w, int *h, void *loaderPrivate)
|
||||||
void *loaderPrivate)
|
|
||||||
{
|
{
|
||||||
__GLXDRIdrawablePrivate *pdp = loaderPrivate;
|
__GLXDRIdrawablePrivate *pdp = loaderPrivate;
|
||||||
__GLXDRIdrawable *pdraw = &(pdp->base);;
|
__GLXDRIdrawable *pdraw = &(pdp->base);;
|
||||||
|
@ -125,7 +125,7 @@ swrastGetDrawableInfo(__DRIdrawable *draw,
|
||||||
drawable = pdraw->xDrawable;
|
drawable = pdraw->xDrawable;
|
||||||
|
|
||||||
stat = XGetGeometry(dpy, drawable, &root,
|
stat = XGetGeometry(dpy, drawable, &root,
|
||||||
x, y, (unsigned int *)w, (unsigned int *)h,
|
x, y, (unsigned int *) w, (unsigned int *) h,
|
||||||
&bw, &depth);
|
&bw, &depth);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,9 +138,8 @@ bytes_per_line(int w, int bpp, unsigned mul)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
swrastPutImage(__DRIdrawable *draw, int op,
|
swrastPutImage(__DRIdrawable * draw, int op,
|
||||||
int x, int y, int w, int h, char *data,
|
int x, int y, int w, int h, char *data, void *loaderPrivate)
|
||||||
void *loaderPrivate)
|
|
||||||
{
|
{
|
||||||
__GLXDRIdrawablePrivate *pdp = loaderPrivate;
|
__GLXDRIdrawablePrivate *pdp = loaderPrivate;
|
||||||
__GLXDRIdrawable *pdraw = &(pdp->base);;
|
__GLXDRIdrawable *pdraw = &(pdp->base);;
|
||||||
|
@ -174,9 +173,8 @@ swrastPutImage(__DRIdrawable *draw, int op,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
swrastGetImage(__DRIdrawable *draw,
|
swrastGetImage(__DRIdrawable * draw,
|
||||||
int x, int y, int w, int h, char *data,
|
int x, int y, int w, int h, char *data, void *loaderPrivate)
|
||||||
void *loaderPrivate)
|
|
||||||
{
|
{
|
||||||
__GLXDRIdrawablePrivate *pdp = loaderPrivate;
|
__GLXDRIdrawablePrivate *pdp = loaderPrivate;
|
||||||
__GLXDRIdrawable *pdraw = &(pdp->base);;
|
__GLXDRIdrawable *pdraw = &(pdp->base);;
|
||||||
|
@ -198,7 +196,7 @@ swrastGetImage(__DRIdrawable *draw,
|
||||||
}
|
}
|
||||||
|
|
||||||
static const __DRIswrastLoaderExtension swrastLoaderExtension = {
|
static const __DRIswrastLoaderExtension swrastLoaderExtension = {
|
||||||
{ __DRI_SWRAST_LOADER, __DRI_SWRAST_LOADER_VERSION },
|
{__DRI_SWRAST_LOADER, __DRI_SWRAST_LOADER_VERSION},
|
||||||
swrastGetDrawableInfo,
|
swrastGetDrawableInfo,
|
||||||
swrastPutImage,
|
swrastPutImage,
|
||||||
swrastGetImage
|
swrastGetImage
|
||||||
|
@ -214,40 +212,42 @@ static const __DRIextension *loader_extensions[] = {
|
||||||
* GLXDRI functions
|
* GLXDRI functions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void driDestroyContext(__GLXDRIcontext *context,
|
static void
|
||||||
__GLXscreenConfigs *psc, Display *dpy)
|
driDestroyContext(__GLXDRIcontext * context,
|
||||||
|
__GLXscreenConfigs * psc, Display * dpy)
|
||||||
{
|
{
|
||||||
__GLXDRIcontextPrivate *pcp = (__GLXDRIcontextPrivate *) context;
|
__GLXDRIcontextPrivate *pcp = (__GLXDRIcontextPrivate *) context;
|
||||||
const __DRIcoreExtension *core = pcp->psc->core;
|
const __DRIcoreExtension *core = pcp->psc->core;
|
||||||
|
|
||||||
(*core->destroyContext)(pcp->driContext);
|
(*core->destroyContext) (pcp->driContext);
|
||||||
|
|
||||||
Xfree(pcp);
|
Xfree(pcp);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool driBindContext(__GLXDRIcontext *context,
|
static Bool
|
||||||
__GLXDRIdrawable *draw, __GLXDRIdrawable *read)
|
driBindContext(__GLXDRIcontext * context,
|
||||||
|
__GLXDRIdrawable * draw, __GLXDRIdrawable * read)
|
||||||
{
|
{
|
||||||
__GLXDRIcontextPrivate *pcp = (__GLXDRIcontextPrivate *) context;
|
__GLXDRIcontextPrivate *pcp = (__GLXDRIcontextPrivate *) context;
|
||||||
const __DRIcoreExtension *core = pcp->psc->core;
|
const __DRIcoreExtension *core = pcp->psc->core;
|
||||||
|
|
||||||
return (*core->bindContext)(pcp->driContext,
|
return (*core->bindContext) (pcp->driContext,
|
||||||
draw->driDrawable,
|
draw->driDrawable, read->driDrawable);
|
||||||
read->driDrawable);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void driUnbindContext(__GLXDRIcontext *context)
|
static void
|
||||||
|
driUnbindContext(__GLXDRIcontext * context)
|
||||||
{
|
{
|
||||||
__GLXDRIcontextPrivate *pcp = (__GLXDRIcontextPrivate *) context;
|
__GLXDRIcontextPrivate *pcp = (__GLXDRIcontextPrivate *) context;
|
||||||
const __DRIcoreExtension *core = pcp->psc->core;
|
const __DRIcoreExtension *core = pcp->psc->core;
|
||||||
|
|
||||||
(*core->unbindContext)(pcp->driContext);
|
(*core->unbindContext) (pcp->driContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
static __GLXDRIcontext *driCreateContext(__GLXscreenConfigs *psc,
|
static __GLXDRIcontext *
|
||||||
const __GLcontextModes *mode,
|
driCreateContext(__GLXscreenConfigs * psc,
|
||||||
GLXContext gc,
|
const __GLcontextModes * mode,
|
||||||
GLXContext shareList, int renderType)
|
GLXContext gc, GLXContext shareList, int renderType)
|
||||||
{
|
{
|
||||||
__GLXDRIcontextPrivate *pcp, *pcp_shared;
|
__GLXDRIcontextPrivate *pcp, *pcp_shared;
|
||||||
__GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) mode;
|
__GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) mode;
|
||||||
|
@ -268,7 +268,7 @@ static __GLXDRIcontext *driCreateContext(__GLXscreenConfigs *psc,
|
||||||
|
|
||||||
pcp->psc = psc;
|
pcp->psc = psc;
|
||||||
pcp->driContext =
|
pcp->driContext =
|
||||||
(*core->createNewContext)(psc->__driScreen,
|
(*core->createNewContext) (psc->__driScreen,
|
||||||
config->driConfig, shared, pcp);
|
config->driConfig, shared, pcp);
|
||||||
if (pcp->driContext == NULL) {
|
if (pcp->driContext == NULL) {
|
||||||
Xfree(pcp);
|
Xfree(pcp);
|
||||||
|
@ -282,21 +282,22 @@ static __GLXDRIcontext *driCreateContext(__GLXscreenConfigs *psc,
|
||||||
return &pcp->base;
|
return &pcp->base;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void driDestroyDrawable(__GLXDRIdrawable *pdraw)
|
static void
|
||||||
|
driDestroyDrawable(__GLXDRIdrawable * pdraw)
|
||||||
{
|
{
|
||||||
__GLXDRIdrawablePrivate *pdp = (__GLXDRIdrawablePrivate *) pdraw;
|
__GLXDRIdrawablePrivate *pdp = (__GLXDRIdrawablePrivate *) pdraw;
|
||||||
const __DRIcoreExtension *core = pdraw->psc->core;
|
const __DRIcoreExtension *core = pdraw->psc->core;
|
||||||
|
|
||||||
(*core->destroyDrawable)(pdraw->driDrawable);
|
(*core->destroyDrawable) (pdraw->driDrawable);
|
||||||
|
|
||||||
XDestroyDrawable(pdp, pdraw->psc->dpy, pdraw->drawable);
|
XDestroyDrawable(pdp, pdraw->psc->dpy, pdraw->drawable);
|
||||||
Xfree(pdp);
|
Xfree(pdp);
|
||||||
}
|
}
|
||||||
|
|
||||||
static __GLXDRIdrawable *driCreateDrawable(__GLXscreenConfigs *psc,
|
static __GLXDRIdrawable *
|
||||||
|
driCreateDrawable(__GLXscreenConfigs * psc,
|
||||||
XID xDrawable,
|
XID xDrawable,
|
||||||
GLXDrawable drawable,
|
GLXDrawable drawable, const __GLcontextModes * modes)
|
||||||
const __GLcontextModes *modes)
|
|
||||||
{
|
{
|
||||||
__GLXDRIdrawable *pdraw;
|
__GLXDRIdrawable *pdraw;
|
||||||
__GLXDRIdrawablePrivate *pdp;
|
__GLXDRIdrawablePrivate *pdp;
|
||||||
|
@ -320,9 +321,7 @@ static __GLXDRIdrawable *driCreateDrawable(__GLXscreenConfigs *psc,
|
||||||
|
|
||||||
/* Create a new drawable */
|
/* Create a new drawable */
|
||||||
pdraw->driDrawable =
|
pdraw->driDrawable =
|
||||||
(*swrast->createNewDrawable)(psc->__driScreen,
|
(*swrast->createNewDrawable) (psc->__driScreen, config->driConfig, pdp);
|
||||||
config->driConfig,
|
|
||||||
pdp);
|
|
||||||
|
|
||||||
if (!pdraw->driDrawable) {
|
if (!pdraw->driDrawable) {
|
||||||
XDestroyDrawable(pdp, psc->dpy, xDrawable);
|
XDestroyDrawable(pdp, psc->dpy, xDrawable);
|
||||||
|
@ -335,22 +334,25 @@ static __GLXDRIdrawable *driCreateDrawable(__GLXscreenConfigs *psc,
|
||||||
return pdraw;
|
return pdraw;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void driSwapBuffers(__GLXDRIdrawable *pdraw)
|
static void
|
||||||
|
driSwapBuffers(__GLXDRIdrawable * pdraw)
|
||||||
{
|
{
|
||||||
(*pdraw->psc->core->swapBuffers)(pdraw->driDrawable);
|
(*pdraw->psc->core->swapBuffers) (pdraw->driDrawable);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void driDestroyScreen(__GLXscreenConfigs *psc)
|
static void
|
||||||
|
driDestroyScreen(__GLXscreenConfigs * psc)
|
||||||
{
|
{
|
||||||
/* Free the direct rendering per screen data */
|
/* Free the direct rendering per screen data */
|
||||||
(*psc->core->destroyScreen)(psc->__driScreen);
|
(*psc->core->destroyScreen) (psc->__driScreen);
|
||||||
psc->__driScreen = NULL;
|
psc->__driScreen = NULL;
|
||||||
if (psc->driver)
|
if (psc->driver)
|
||||||
dlclose(psc->driver);
|
dlclose(psc->driver);
|
||||||
}
|
}
|
||||||
|
|
||||||
static __GLXDRIscreen *driCreateScreen(__GLXscreenConfigs *psc, int screen,
|
static __GLXDRIscreen *
|
||||||
__GLXdisplayPrivate *priv)
|
driCreateScreen(__GLXscreenConfigs * psc, int screen,
|
||||||
|
__GLXdisplayPrivate * priv)
|
||||||
{
|
{
|
||||||
__GLXDRIscreen *psp;
|
__GLXDRIscreen *psp;
|
||||||
const __DRIconfig **driver_configs;
|
const __DRIconfig **driver_configs;
|
||||||
|
@ -420,7 +422,8 @@ static __GLXDRIscreen *driCreateScreen(__GLXscreenConfigs *psc, int screen,
|
||||||
|
|
||||||
/* Called from __glXFreeDisplayPrivate.
|
/* Called from __glXFreeDisplayPrivate.
|
||||||
*/
|
*/
|
||||||
static void driDestroyDisplay(__GLXDRIdisplay *dpy)
|
static void
|
||||||
|
driDestroyDisplay(__GLXDRIdisplay * dpy)
|
||||||
{
|
{
|
||||||
Xfree(dpy);
|
Xfree(dpy);
|
||||||
}
|
}
|
||||||
|
@ -430,7 +433,8 @@ static void driDestroyDisplay(__GLXDRIdisplay *dpy)
|
||||||
* This is called from __glXInitialize() when we are given a new
|
* This is called from __glXInitialize() when we are given a new
|
||||||
* display pointer.
|
* display pointer.
|
||||||
*/
|
*/
|
||||||
_X_HIDDEN __GLXDRIdisplay *driswCreateDisplay(Display *dpy)
|
_X_HIDDEN __GLXDRIdisplay *
|
||||||
|
driswCreateDisplay(Display * dpy)
|
||||||
{
|
{
|
||||||
__GLXDRIdisplayPrivate *pdpyp;
|
__GLXDRIdisplayPrivate *pdpyp;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue