glx: indent -br -i3 -npcs --no-tabs drisw_glx.c

This commit is contained in:
RALOVICH, Kristóf 2008-10-13 13:47:37 +02:00 committed by Brian Paul
parent 4e88ae5639
commit 60aa0918a1
1 changed files with 274 additions and 270 deletions

View File

@ -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,7 +62,8 @@ struct __GLXDRIdrawablePrivateRec {
* swrast loader functions * swrast loader functions
*/ */
static Bool XCreateDrawable(__GLXDRIdrawablePrivate *pdp, static Bool
XCreateDrawable(__GLXDRIdrawablePrivate * pdp,
Display * dpy, XID drawable, int visualid) Display * dpy, XID drawable, int visualid)
{ {
XGCValues gcvalues; XGCValues gcvalues;
@ -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);
@ -110,8 +111,7 @@ 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);;
@ -139,8 +139,7 @@ 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);;
@ -175,8 +174,7 @@ 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);;
@ -214,7 +212,8 @@ static const __DRIextension *loader_extensions[] = {
* GLXDRI functions * GLXDRI functions
*/ */
static void driDestroyContext(__GLXDRIcontext *context, static void
driDestroyContext(__GLXDRIcontext * context,
__GLXscreenConfigs * psc, Display * dpy) __GLXscreenConfigs * psc, Display * dpy)
{ {
__GLXDRIcontextPrivate *pcp = (__GLXDRIcontextPrivate *) context; __GLXDRIcontextPrivate *pcp = (__GLXDRIcontextPrivate *) context;
@ -225,18 +224,19 @@ static void driDestroyContext(__GLXDRIcontext *context,
Xfree(pcp); Xfree(pcp);
} }
static Bool driBindContext(__GLXDRIcontext *context, static Bool
driBindContext(__GLXDRIcontext * context,
__GLXDRIdrawable * draw, __GLXDRIdrawable * read) __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;
@ -244,10 +244,10 @@ static void driUnbindContext(__GLXDRIcontext *context)
(*core->unbindContext) (pcp->driContext); (*core->unbindContext) (pcp->driContext);
} }
static __GLXDRIcontext *driCreateContext(__GLXscreenConfigs *psc, static __GLXDRIcontext *
driCreateContext(__GLXscreenConfigs * psc,
const __GLcontextModes * mode, const __GLcontextModes * mode,
GLXContext gc, GLXContext gc, GLXContext shareList, int renderType)
GLXContext shareList, int renderType)
{ {
__GLXDRIcontextPrivate *pcp, *pcp_shared; __GLXDRIcontextPrivate *pcp, *pcp_shared;
__GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) mode; __GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) mode;
@ -282,7 +282,8 @@ 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;
@ -293,10 +294,10 @@ static void driDestroyDrawable(__GLXDRIdrawable *pdraw)
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,12 +334,14 @@ 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);
@ -349,7 +350,8 @@ static void driDestroyScreen(__GLXscreenConfigs *psc)
dlclose(psc->driver); dlclose(psc->driver);
} }
static __GLXDRIscreen *driCreateScreen(__GLXscreenConfigs *psc, int screen, static __GLXDRIscreen *
driCreateScreen(__GLXscreenConfigs * psc, int screen,
__GLXdisplayPrivate * priv) __GLXdisplayPrivate * priv)
{ {
__GLXDRIscreen *psp; __GLXDRIscreen *psp;
@ -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;