gdi32: Remove OpenGL functions that don't use an HDC from the driver entry points.
This commit is contained in:
parent
66a5995e11
commit
ee21554893
|
@ -526,16 +526,11 @@ const struct gdi_dc_funcs dib_driver =
|
|||
NULL, /* pSwapBuffers */
|
||||
NULL, /* pUnrealizePalette */
|
||||
NULL, /* pWidenPath */
|
||||
NULL, /* pwglCopyContext */
|
||||
NULL, /* pwglCreateContext */
|
||||
NULL, /* pwglCreateContextAttribsARB */
|
||||
NULL, /* pwglDeleteContext */
|
||||
NULL, /* pwglGetProcAddress */
|
||||
NULL, /* pwglMakeContextCurrentARB */
|
||||
NULL, /* pwglMakeCurrent */
|
||||
NULL, /* pwglSetPixelFormatWINE */
|
||||
NULL, /* pwglShareLists */
|
||||
NULL, /* pwglUseFontBitmapsA */
|
||||
NULL, /* pwglUseFontBitmapsW */
|
||||
GDI_PRIORITY_DIB_DRV /* priority */
|
||||
};
|
||||
|
|
|
@ -670,11 +670,6 @@ static BOOL nulldrv_UnrealizePalette( HPALETTE palette )
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
static BOOL nulldrv_wglCopyContext( HGLRC ctx_src, HGLRC ctx_dst, UINT mask )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static HGLRC nulldrv_wglCreateContext( PHYSDEV dev )
|
||||
{
|
||||
return 0;
|
||||
|
@ -685,11 +680,6 @@ static HGLRC nulldrv_wglCreateContextAttribsARB( PHYSDEV dev, HGLRC share_ctx, c
|
|||
return 0;
|
||||
}
|
||||
|
||||
static BOOL nulldrv_wglDeleteContext( HGLRC ctx )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static PROC nulldrv_wglGetProcAddress( LPCSTR name )
|
||||
{
|
||||
return NULL;
|
||||
|
@ -710,21 +700,6 @@ static BOOL nulldrv_wglSetPixelFormatWINE( PHYSDEV dev, INT format, const PIXELF
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
static BOOL nulldrv_wglShareLists( HGLRC ctx1, HGLRC ctx2 )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static BOOL nulldrv_wglUseFontBitmapsA( PHYSDEV dev, DWORD start, DWORD count, DWORD base )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static BOOL nulldrv_wglUseFontBitmapsW( PHYSDEV dev, DWORD start, DWORD count, DWORD base )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
const struct gdi_dc_funcs null_driver =
|
||||
{
|
||||
nulldrv_AbortDoc, /* pAbortDoc */
|
||||
|
@ -858,17 +833,12 @@ const struct gdi_dc_funcs null_driver =
|
|||
nulldrv_SwapBuffers, /* pSwapBuffers */
|
||||
nulldrv_UnrealizePalette, /* pUnrealizePalette */
|
||||
nulldrv_WidenPath, /* pWidenPath */
|
||||
nulldrv_wglCopyContext, /* pwglCopyContext */
|
||||
nulldrv_wglCreateContext, /* pwglCreateContext */
|
||||
nulldrv_wglCreateContextAttribsARB, /* pwglCreateContextAttribsARB */
|
||||
nulldrv_wglDeleteContext, /* pwglDeleteContext */
|
||||
nulldrv_wglGetProcAddress, /* pwglGetProcAddress */
|
||||
nulldrv_wglMakeContextCurrentARB, /* pwglMakeContextCurrentARB */
|
||||
nulldrv_wglMakeCurrent, /* pwglMakeCurrent */
|
||||
nulldrv_wglSetPixelFormatWINE, /* pwglSetPixelFormatWINE */
|
||||
nulldrv_wglShareLists, /* pwglShareLists */
|
||||
nulldrv_wglUseFontBitmapsA, /* pwglUseFontBitmapsA */
|
||||
nulldrv_wglUseFontBitmapsW, /* pwglUseFontBitmapsW */
|
||||
|
||||
GDI_PRIORITY_NULL_DRV /* priority */
|
||||
};
|
||||
|
|
|
@ -167,17 +167,12 @@ static const struct gdi_dc_funcs EMFDRV_Funcs =
|
|||
NULL, /* pSwapBuffers */
|
||||
NULL, /* pUnrealizePalette */
|
||||
EMFDRV_WidenPath, /* pWidenPath */
|
||||
NULL, /* pwglCopyContext */
|
||||
NULL, /* pwglCreateContext */
|
||||
NULL, /* pwglCreateContextAttribsARB */
|
||||
NULL, /* pwglDeleteContext */
|
||||
NULL, /* pwglGetProcAddress */
|
||||
NULL, /* pwglMakeContextCurrentARB */
|
||||
NULL, /* pwglMakeCurrent */
|
||||
NULL, /* pwglSetPixelFormatWINE */
|
||||
NULL, /* pwglShareLists */
|
||||
NULL, /* pwglUseFontBitmapsA */
|
||||
NULL, /* pwglUseFontBitmapsW */
|
||||
GDI_PRIORITY_GRAPHICS_DRV /* priority */
|
||||
};
|
||||
|
||||
|
|
|
@ -7871,17 +7871,12 @@ static const struct gdi_dc_funcs freetype_funcs =
|
|||
NULL, /* pSwapBuffers */
|
||||
NULL, /* pUnrealizePalette */
|
||||
NULL, /* pWidenPath */
|
||||
NULL, /* pwglCopyContext */
|
||||
NULL, /* pwglCreateContext */
|
||||
NULL, /* pwglCreateContextAttribsARB */
|
||||
NULL, /* pwglDeleteContext */
|
||||
NULL, /* pwglGetProcAddress */
|
||||
NULL, /* pwglMakeContextCurrentARB */
|
||||
NULL, /* pwglMakeCurrent */
|
||||
NULL, /* pwglSetPixelFormatWINE */
|
||||
NULL, /* pwglShareLists */
|
||||
NULL, /* pwglUseFontBitmapsA */
|
||||
NULL, /* pwglUseFontBitmapsW */
|
||||
GDI_PRIORITY_FONT_DRV /* priority */
|
||||
};
|
||||
|
||||
|
|
|
@ -499,16 +499,9 @@
|
|||
################################################################
|
||||
# Wine extensions: OpenGL support
|
||||
#
|
||||
@ stdcall wglCopyContext(long long long)
|
||||
@ stdcall wglCreateContext(long)
|
||||
@ stdcall wglDeleteContext(long)
|
||||
@ stdcall wglGetCurrentContext()
|
||||
@ stdcall wglGetCurrentDC()
|
||||
@ stdcall -private wglGetProcAddress(str)
|
||||
@ stdcall wglMakeCurrent(long long)
|
||||
@ stdcall wglShareLists(long long)
|
||||
@ stdcall wglUseFontBitmapsA(long long long long)
|
||||
@ stdcall wglUseFontBitmapsW(long long long long)
|
||||
|
||||
################################################################
|
||||
# Wine extensions: Win16 functions that are needed by other dlls
|
||||
|
|
|
@ -230,17 +230,12 @@ static const struct gdi_dc_funcs MFDRV_Funcs =
|
|||
NULL, /* pSwapBuffers */
|
||||
NULL, /* pUnrealizePalette */
|
||||
MFDRV_WidenPath, /* pWidenPath */
|
||||
NULL, /* pwglCopyContext */
|
||||
NULL, /* pwglCreateContext */
|
||||
NULL, /* pwglCreateContextAttribsARB */
|
||||
NULL, /* pwglDeleteContext */
|
||||
NULL, /* pwglGetProcAddress */
|
||||
NULL, /* pwglMakeContextCurrentARB */
|
||||
NULL, /* pwglMakeCurrent */
|
||||
NULL, /* pwglSetPixelFormatWINE */
|
||||
NULL, /* pwglShareLists */
|
||||
NULL, /* pwglUseFontBitmapsA */
|
||||
NULL, /* pwglUseFontBitmapsW */
|
||||
GDI_PRIORITY_GRAPHICS_DRV /* priority */
|
||||
};
|
||||
|
||||
|
|
|
@ -40,11 +40,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(wgl);
|
|||
|
||||
static HDC default_hdc = 0;
|
||||
|
||||
typedef struct opengl_context
|
||||
{
|
||||
HDC hdc;
|
||||
} *OPENGL_Context;
|
||||
|
||||
/* We route all wgl functions from opengl32.dll through gdi32.dll to
|
||||
* the display driver. Various wgl calls have a hDC as one of their parameters.
|
||||
* Using get_dc_ptr we get access to the functions exported by the driver.
|
||||
|
@ -59,31 +54,6 @@ static DC* OPENGL_GetDefaultDC(void)
|
|||
return get_dc_ptr(default_hdc);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* wglCopyContext (OPENGL32.@)
|
||||
*/
|
||||
BOOL WINAPI wglCopyContext(HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask)
|
||||
{
|
||||
DC *dc;
|
||||
BOOL ret = FALSE;
|
||||
OPENGL_Context ctx = (OPENGL_Context)hglrcSrc;
|
||||
|
||||
TRACE("hglrcSrc: (%p), hglrcDst: (%p), mask: %#x\n", hglrcSrc, hglrcDst, mask);
|
||||
/* If no context is set, this call doesn't have a purpose */
|
||||
if(!hglrcSrc || !hglrcDst)
|
||||
return FALSE;
|
||||
|
||||
/* Retrieve the HDC associated with the context to access the display driver */
|
||||
dc = get_dc_ptr(ctx->hdc);
|
||||
if (dc)
|
||||
{
|
||||
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pwglCopyContext );
|
||||
ret = physdev->funcs->pwglCopyContext(hglrcSrc, hglrcDst, mask);
|
||||
release_dc_ptr( dc );
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* wglCreateContext (OPENGL32.@)
|
||||
*/
|
||||
|
@ -124,60 +94,6 @@ static HGLRC WINAPI wglCreateContextAttribsARB(HDC hdc, HGLRC hShareContext, con
|
|||
return ret;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* wglDeleteContext (OPENGL32.@)
|
||||
*/
|
||||
BOOL WINAPI wglDeleteContext(HGLRC hglrc)
|
||||
{
|
||||
DC *dc;
|
||||
BOOL ret = FALSE;
|
||||
OPENGL_Context ctx = (OPENGL_Context)hglrc;
|
||||
|
||||
TRACE("hglrc: (%p)\n", hglrc);
|
||||
if(ctx == NULL)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Retrieve the HDC associated with the context to access the display driver */
|
||||
dc = get_dc_ptr(ctx->hdc);
|
||||
if (dc)
|
||||
{
|
||||
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pwglDeleteContext );
|
||||
ret = physdev->funcs->pwglDeleteContext( hglrc );
|
||||
release_dc_ptr( dc );
|
||||
}
|
||||
else SetLastError(ERROR_INVALID_HANDLE);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* wglGetCurrentContext (OPENGL32.@)
|
||||
*/
|
||||
HGLRC WINAPI wglGetCurrentContext(void)
|
||||
{
|
||||
HGLRC ret = NtCurrentTeb()->glContext;
|
||||
TRACE(" returning %p\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* wglGetCurrentDC (OPENGL32.@)
|
||||
*/
|
||||
HDC WINAPI wglGetCurrentDC(void)
|
||||
{
|
||||
OPENGL_Context ctx = (OPENGL_Context)wglGetCurrentContext();
|
||||
|
||||
TRACE(" found context: %p\n", ctx);
|
||||
if(ctx == NULL)
|
||||
return NULL;
|
||||
|
||||
/* Retrieve the current DC from the active context */
|
||||
TRACE(" returning hdc: %p\n", ctx->hdc);
|
||||
return ctx->hdc;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* wglMakeCurrent (OPENGL32.@)
|
||||
*/
|
||||
|
@ -190,7 +106,7 @@ BOOL WINAPI wglMakeCurrent(HDC hdc, HGLRC hglrc)
|
|||
* In that case use the global hDC to get access to the driver. */
|
||||
if(hglrc == NULL)
|
||||
{
|
||||
if( hdc == NULL && !wglGetCurrentContext() )
|
||||
if (hdc == NULL && !NtCurrentTeb()->glContext)
|
||||
{
|
||||
WARN( "Current context is NULL\n");
|
||||
SetLastError( ERROR_INVALID_HANDLE );
|
||||
|
@ -267,68 +183,6 @@ static BOOL WINAPI wglSetPixelFormatWINE(HDC hdc, int iPixelFormat, const PIXELF
|
|||
return bRet;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* wglShareLists (OPENGL32.@)
|
||||
*/
|
||||
BOOL WINAPI wglShareLists(HGLRC hglrc1, HGLRC hglrc2)
|
||||
{
|
||||
DC *dc;
|
||||
BOOL ret = FALSE;
|
||||
OPENGL_Context ctx = (OPENGL_Context)hglrc1;
|
||||
|
||||
TRACE("hglrc1: (%p); hglrc: (%p)\n", hglrc1, hglrc2);
|
||||
if(ctx == NULL || hglrc2 == NULL)
|
||||
return FALSE;
|
||||
|
||||
/* Retrieve the HDC associated with the context to access the display driver */
|
||||
dc = get_dc_ptr(ctx->hdc);
|
||||
if (dc)
|
||||
{
|
||||
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pwglShareLists );
|
||||
ret = physdev->funcs->pwglShareLists( hglrc1, hglrc2 );
|
||||
release_dc_ptr( dc );
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* wglUseFontBitmapsA (OPENGL32.@)
|
||||
*/
|
||||
BOOL WINAPI wglUseFontBitmapsA(HDC hdc, DWORD first, DWORD count, DWORD listBase)
|
||||
{
|
||||
BOOL ret = FALSE;
|
||||
DC * dc = get_dc_ptr( hdc );
|
||||
|
||||
TRACE("(%p, %d, %d, %d)\n", hdc, first, count, listBase);
|
||||
|
||||
if (dc)
|
||||
{
|
||||
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pwglUseFontBitmapsA );
|
||||
ret = physdev->funcs->pwglUseFontBitmapsA( physdev, first, count, listBase );
|
||||
release_dc_ptr( dc );
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* wglUseFontBitmapsW (OPENGL32.@)
|
||||
*/
|
||||
BOOL WINAPI wglUseFontBitmapsW(HDC hdc, DWORD first, DWORD count, DWORD listBase)
|
||||
{
|
||||
BOOL ret = FALSE;
|
||||
DC * dc = get_dc_ptr( hdc );
|
||||
|
||||
TRACE("(%p, %d, %d, %d)\n", hdc, first, count, listBase);
|
||||
|
||||
if (dc)
|
||||
{
|
||||
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pwglUseFontBitmapsW );
|
||||
ret = physdev->funcs->pwglUseFontBitmapsW( physdev, first, count, listBase );
|
||||
release_dc_ptr( dc );
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* Internal wglGetProcAddress for retrieving WGL extensions
|
||||
*/
|
||||
|
|
|
@ -2364,16 +2364,11 @@ const struct gdi_dc_funcs path_driver =
|
|||
NULL, /* pSwapBuffers */
|
||||
NULL, /* pUnrealizePalette */
|
||||
NULL, /* pWidenPath */
|
||||
NULL, /* pwglCopyContext */
|
||||
NULL, /* pwglCreateContext */
|
||||
NULL, /* pwglCreateContextAttribsARB */
|
||||
NULL, /* pwglDeleteContext */
|
||||
NULL, /* pwglGetProcAddress */
|
||||
NULL, /* pwglMakeContextCurrentARB */
|
||||
NULL, /* pwglMakeCurrent */
|
||||
NULL, /* pwglSetPixelFormatWINE */
|
||||
NULL, /* pwglShareLists */
|
||||
NULL, /* pwglUseFontBitmapsA */
|
||||
NULL, /* pwglUseFontBitmapsW */
|
||||
GDI_PRIORITY_PATH_DRV /* priority */
|
||||
};
|
||||
|
|
|
@ -841,17 +841,12 @@ static const struct gdi_dc_funcs psdrv_funcs =
|
|||
NULL, /* pSwapBuffers */
|
||||
NULL, /* pUnrealizePalette */
|
||||
NULL, /* pWidenPath */
|
||||
NULL, /* pwglCopyContext */
|
||||
NULL, /* pwglCreateContext */
|
||||
NULL, /* pwglCreateContextAttribsARB */
|
||||
NULL, /* pwglDeleteContext */
|
||||
NULL, /* pwglGetProcAddress */
|
||||
NULL, /* pwglMakeContextCurrentARB */
|
||||
NULL, /* pwglMakeCurrent */
|
||||
NULL, /* pwglSetPixelFormatWINE */
|
||||
NULL, /* pwglShareLists */
|
||||
NULL, /* pwglUseFontBitmapsA */
|
||||
NULL, /* pwglUseFontBitmapsW */
|
||||
GDI_PRIORITY_GRAPHICS_DRV /* priority */
|
||||
};
|
||||
|
||||
|
|
|
@ -635,17 +635,12 @@ static const struct gdi_dc_funcs x11drv_funcs =
|
|||
NULL, /* pSwapBuffers */
|
||||
X11DRV_UnrealizePalette, /* pUnrealizePalette */
|
||||
NULL, /* pWidenPath */
|
||||
NULL, /* pwglCopyContext */
|
||||
X11DRV_wglCreateContext, /* pwglCreateContext */
|
||||
X11DRV_wglCreateContextAttribsARB, /* pwglCreateContextAttribsARB */
|
||||
NULL, /* pwglDeleteContext */
|
||||
X11DRV_wglGetProcAddress, /* pwglGetProcAddress */
|
||||
NULL, /* pwglMakeContextCurrentARB */
|
||||
NULL, /* pwglMakeCurrent */
|
||||
X11DRV_wglSetPixelFormatWINE, /* pwglSetPixelFormatWINE */
|
||||
NULL, /* pwglShareLists */
|
||||
NULL, /* pwglUseFontBitmapsA */
|
||||
NULL, /* pwglUseFontBitmapsW */
|
||||
GDI_PRIORITY_GRAPHICS_DRV /* priority */
|
||||
};
|
||||
|
||||
|
|
|
@ -3777,17 +3777,12 @@ static const struct gdi_dc_funcs glxdrv_funcs =
|
|||
glxdrv_SwapBuffers, /* pSwapBuffers */
|
||||
NULL, /* pUnrealizePalette */
|
||||
NULL, /* pWidenPath */
|
||||
NULL, /* pwglCopyContext */
|
||||
glxdrv_wglCreateContext, /* pwglCreateContext */
|
||||
glxdrv_wglCreateContextAttribsARB, /* pwglCreateContextAttribsARB */
|
||||
NULL, /* pwglDeleteContext */
|
||||
glxdrv_wglGetProcAddress, /* pwglGetProcAddress */
|
||||
glxdrv_wglMakeContextCurrentARB, /* pwglMakeContextCurrentARB */
|
||||
glxdrv_wglMakeCurrent, /* pwglMakeCurrent */
|
||||
glxdrv_wglSetPixelFormatWINE, /* pwglSetPixelFormatWINE */
|
||||
NULL, /* pwglShareLists */
|
||||
NULL, /* pwglUseFontBitmapsA */
|
||||
NULL, /* pwglUseFontBitmapsW */
|
||||
GDI_PRIORITY_GRAPHICS_DRV + 20 /* priority */
|
||||
};
|
||||
|
||||
|
|
|
@ -2597,17 +2597,12 @@ static const struct gdi_dc_funcs xrender_funcs =
|
|||
NULL, /* pSwapBuffers */
|
||||
NULL, /* pUnrealizePalette */
|
||||
NULL, /* pWidenPath */
|
||||
NULL, /* pwglCopyContext */
|
||||
NULL, /* pwglCreateContext */
|
||||
NULL, /* pwglCreateContextAttribsARB */
|
||||
NULL, /* pwglDeleteContext */
|
||||
NULL, /* pwglGetProcAddress */
|
||||
NULL, /* pwglMakeContextCurrentARB */
|
||||
NULL, /* pwglMakeCurrent */
|
||||
NULL, /* pwglSetPixelFormatWINE */
|
||||
NULL, /* pwglShareLists */
|
||||
NULL, /* pwglUseFontBitmapsA */
|
||||
NULL, /* pwglUseFontBitmapsW */
|
||||
GDI_PRIORITY_GRAPHICS_DRV + 10 /* priority */
|
||||
};
|
||||
|
||||
|
|
|
@ -192,24 +192,19 @@ struct gdi_dc_funcs
|
|||
BOOL (*pSwapBuffers)(PHYSDEV);
|
||||
BOOL (*pUnrealizePalette)(HPALETTE);
|
||||
BOOL (*pWidenPath)(PHYSDEV);
|
||||
BOOL (*pwglCopyContext)(HGLRC,HGLRC,UINT);
|
||||
HGLRC (*pwglCreateContext)(PHYSDEV);
|
||||
HGLRC (*pwglCreateContextAttribsARB)(PHYSDEV,HGLRC,const int*);
|
||||
BOOL (*pwglDeleteContext)(HGLRC);
|
||||
PROC (*pwglGetProcAddress)(LPCSTR);
|
||||
BOOL (*pwglMakeContextCurrentARB)(PHYSDEV,PHYSDEV,HGLRC);
|
||||
BOOL (*pwglMakeCurrent)(PHYSDEV,HGLRC);
|
||||
BOOL (*pwglSetPixelFormatWINE)(PHYSDEV,INT,const PIXELFORMATDESCRIPTOR*);
|
||||
BOOL (*pwglShareLists)(HGLRC,HGLRC);
|
||||
BOOL (*pwglUseFontBitmapsA)(PHYSDEV,DWORD,DWORD,DWORD);
|
||||
BOOL (*pwglUseFontBitmapsW)(PHYSDEV,DWORD,DWORD,DWORD);
|
||||
|
||||
/* priority order for the driver on the stack */
|
||||
UINT priority;
|
||||
};
|
||||
|
||||
/* increment this when you change the DC function table */
|
||||
#define WINE_GDI_DRIVER_VERSION 31
|
||||
#define WINE_GDI_DRIVER_VERSION 32
|
||||
|
||||
#define GDI_PRIORITY_NULL_DRV 0 /* null driver */
|
||||
#define GDI_PRIORITY_FONT_DRV 100 /* any font driver */
|
||||
|
|
Loading…
Reference in New Issue