glx: Code motion
No functional change, just rearranging some code to make later commits more obvious. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
parent
f523ebb549
commit
0ba4e251a1
@ -97,21 +97,6 @@ struct __GLXDRIdrawable {
|
||||
XID dri2_id;
|
||||
};
|
||||
|
||||
static void
|
||||
__glXDRIdrawableDestroy(__GLXdrawable * drawable)
|
||||
{
|
||||
__GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable;
|
||||
const __DRIcoreExtension *core = private->screen->core;
|
||||
|
||||
FreeResource(private->dri2_id, FALSE);
|
||||
|
||||
(*core->destroyDrawable) (private->driDrawable);
|
||||
|
||||
__glXDrawableRelease(drawable);
|
||||
|
||||
free(private);
|
||||
}
|
||||
|
||||
static void
|
||||
copy_box(__GLXdrawable * drawable,
|
||||
int dst, int src,
|
||||
@ -134,6 +119,24 @@ copy_box(__GLXdrawable * drawable,
|
||||
}
|
||||
}
|
||||
|
||||
/* white lie */
|
||||
extern glx_func_ptr glXGetProcAddressARB(const char *);
|
||||
|
||||
static void
|
||||
__glXDRIdrawableDestroy(__GLXdrawable * drawable)
|
||||
{
|
||||
__GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable;
|
||||
const __DRIcoreExtension *core = private->screen->core;
|
||||
|
||||
FreeResource(private->dri2_id, FALSE);
|
||||
|
||||
(*core->destroyDrawable) (private->driDrawable);
|
||||
|
||||
__glXDrawableRelease(drawable);
|
||||
|
||||
free(private);
|
||||
}
|
||||
|
||||
static void
|
||||
__glXDRIdrawableCopySubBuffer(__GLXdrawable * drawable,
|
||||
int x, int y, int w, int h)
|
||||
@ -339,32 +342,6 @@ static __GLXtextureFromPixmap __glXDRItextureFromPixmap = {
|
||||
__glXDRIreleaseTexImage
|
||||
};
|
||||
|
||||
static void
|
||||
__glXDRIscreenDestroy(__GLXscreen * baseScreen)
|
||||
{
|
||||
int i;
|
||||
|
||||
ScrnInfoPtr pScrn = xf86ScreenToScrn(baseScreen->pScreen);
|
||||
__GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen;
|
||||
|
||||
(*screen->core->destroyScreen) (screen->driScreen);
|
||||
|
||||
dlclose(screen->driver);
|
||||
|
||||
__glXScreenDestroy(baseScreen);
|
||||
|
||||
if (screen->driConfigs) {
|
||||
for (i = 0; screen->driConfigs[i] != NULL; i++)
|
||||
free((__DRIconfig **) screen->driConfigs[i]);
|
||||
free(screen->driConfigs);
|
||||
}
|
||||
|
||||
pScrn->EnterVT = screen->enterVT;
|
||||
pScrn->LeaveVT = screen->leaveVT;
|
||||
|
||||
free(screen);
|
||||
}
|
||||
|
||||
static Bool
|
||||
dri2_convert_glx_attribs(__GLXDRIscreen *screen, unsigned num_attribs,
|
||||
const uint32_t *attribs,
|
||||
@ -931,8 +908,31 @@ initializeExtensions(__GLXscreen * screen)
|
||||
}
|
||||
}
|
||||
|
||||
/* white lie */
|
||||
extern glx_func_ptr glXGetProcAddressARB(const char *);
|
||||
static void
|
||||
__glXDRIscreenDestroy(__GLXscreen * baseScreen)
|
||||
{
|
||||
int i;
|
||||
|
||||
ScrnInfoPtr pScrn = xf86ScreenToScrn(baseScreen->pScreen);
|
||||
__GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen;
|
||||
|
||||
(*screen->core->destroyScreen) (screen->driScreen);
|
||||
|
||||
dlclose(screen->driver);
|
||||
|
||||
__glXScreenDestroy(baseScreen);
|
||||
|
||||
if (screen->driConfigs) {
|
||||
for (i = 0; screen->driConfigs[i] != NULL; i++)
|
||||
free((__DRIconfig **) screen->driConfigs[i]);
|
||||
free(screen->driConfigs);
|
||||
}
|
||||
|
||||
pScrn->EnterVT = screen->enterVT;
|
||||
pScrn->LeaveVT = screen->leaveVT;
|
||||
|
||||
free(screen);
|
||||
}
|
||||
|
||||
enum {
|
||||
GLXOPT_VENDOR_LIBRARY,
|
||||
|
@ -89,6 +89,9 @@ struct __GLXDRIdrawable {
|
||||
GCPtr swapgc; /* GC for swapping the color buffers */
|
||||
};
|
||||
|
||||
/* white lie */
|
||||
extern glx_func_ptr glXGetProcAddressARB(const char *);
|
||||
|
||||
static void
|
||||
__glXDRIdrawableDestroy(__GLXdrawable * drawable)
|
||||
{
|
||||
@ -210,28 +213,6 @@ static __GLXtextureFromPixmap __glXDRItextureFromPixmap = {
|
||||
__glXDRIreleaseTexImage
|
||||
};
|
||||
|
||||
static void
|
||||
__glXDRIscreenDestroy(__GLXscreen * baseScreen)
|
||||
{
|
||||
int i;
|
||||
|
||||
__GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen;
|
||||
|
||||
(*screen->core->destroyScreen) (screen->driScreen);
|
||||
|
||||
dlclose(screen->driver);
|
||||
|
||||
__glXScreenDestroy(baseScreen);
|
||||
|
||||
if (screen->driConfigs) {
|
||||
for (i = 0; screen->driConfigs[i] != NULL; i++)
|
||||
free((__DRIconfig **) screen->driConfigs[i]);
|
||||
free(screen->driConfigs);
|
||||
}
|
||||
|
||||
free(screen);
|
||||
}
|
||||
|
||||
static __GLXcontext *
|
||||
__glXDRIscreenCreateContext(__GLXscreen * baseScreen,
|
||||
__GLXconfig * glxConfig,
|
||||
@ -440,8 +421,27 @@ initializeExtensions(__GLXscreen * screen)
|
||||
}
|
||||
}
|
||||
|
||||
/* white lie */
|
||||
extern glx_func_ptr glXGetProcAddressARB(const char *);
|
||||
static void
|
||||
__glXDRIscreenDestroy(__GLXscreen * baseScreen)
|
||||
{
|
||||
int i;
|
||||
|
||||
__GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen;
|
||||
|
||||
(*screen->core->destroyScreen) (screen->driScreen);
|
||||
|
||||
dlclose(screen->driver);
|
||||
|
||||
__glXScreenDestroy(baseScreen);
|
||||
|
||||
if (screen->driConfigs) {
|
||||
for (i = 0; screen->driConfigs[i] != NULL; i++)
|
||||
free((__DRIconfig **) screen->driConfigs[i]);
|
||||
free(screen->driConfigs);
|
||||
}
|
||||
|
||||
free(screen);
|
||||
}
|
||||
|
||||
static __GLXscreen *
|
||||
__glXDRIscreenProbe(ScreenPtr pScreen)
|
||||
|
Loading…
Reference in New Issue
Block a user