From ee21554893176c0a90f4017afe000de30bfd2029 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 25 Jun 2012 12:02:13 +0200 Subject: [PATCH] gdi32: Remove OpenGL functions that don't use an HDC from the driver entry points. --- dlls/gdi32/dibdrv/dc.c | 5 -- dlls/gdi32/driver.c | 30 --------- dlls/gdi32/enhmfdrv/init.c | 5 -- dlls/gdi32/freetype.c | 5 -- dlls/gdi32/gdi32.spec | 7 --- dlls/gdi32/mfdrv/init.c | 5 -- dlls/gdi32/opengl.c | 148 +-------------------------------------------- dlls/gdi32/path.c | 5 -- dlls/wineps.drv/init.c | 5 -- dlls/winex11.drv/init.c | 5 -- dlls/winex11.drv/opengl.c | 5 -- dlls/winex11.drv/xrender.c | 5 -- include/wine/gdi_driver.h | 7 +-- 13 files changed, 2 insertions(+), 235 deletions(-) diff --git a/dlls/gdi32/dibdrv/dc.c b/dlls/gdi32/dibdrv/dc.c index df513327584..94a05736368 100644 --- a/dlls/gdi32/dibdrv/dc.c +++ b/dlls/gdi32/dibdrv/dc.c @@ -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 */ }; diff --git a/dlls/gdi32/driver.c b/dlls/gdi32/driver.c index 2b8059a57cb..bac2037bc17 100644 --- a/dlls/gdi32/driver.c +++ b/dlls/gdi32/driver.c @@ -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 */ }; diff --git a/dlls/gdi32/enhmfdrv/init.c b/dlls/gdi32/enhmfdrv/init.c index 7649e008eea..35ecaa9b7db 100644 --- a/dlls/gdi32/enhmfdrv/init.c +++ b/dlls/gdi32/enhmfdrv/init.c @@ -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 */ }; diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 35ba2c9dc13..6dfb3c88f4d 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -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 */ }; diff --git a/dlls/gdi32/gdi32.spec b/dlls/gdi32/gdi32.spec index 79c6f3c5e02..c723af3a011 100644 --- a/dlls/gdi32/gdi32.spec +++ b/dlls/gdi32/gdi32.spec @@ -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 diff --git a/dlls/gdi32/mfdrv/init.c b/dlls/gdi32/mfdrv/init.c index 029f12e9124..bf63be1292d 100644 --- a/dlls/gdi32/mfdrv/init.c +++ b/dlls/gdi32/mfdrv/init.c @@ -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 */ }; diff --git a/dlls/gdi32/opengl.c b/dlls/gdi32/opengl.c index 16889f20305..aa90e13bbc4 100644 --- a/dlls/gdi32/opengl.c +++ b/dlls/gdi32/opengl.c @@ -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. @@ -60,31 +55,6 @@ static DC* OPENGL_GetDefaultDC(void) } /*********************************************************************** - * 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.@) */ HGLRC WINAPI wglCreateContext(HDC hdc) @@ -125,60 +95,6 @@ static HGLRC WINAPI wglCreateContextAttribsARB(HDC hdc, HGLRC hShareContext, con } /*********************************************************************** - * 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.@) */ BOOL WINAPI wglMakeCurrent(HDC hdc, HGLRC hglrc) @@ -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 ); @@ -268,68 +184,6 @@ static BOOL WINAPI wglSetPixelFormatWINE(HDC hdc, int iPixelFormat, const PIXELF } /*********************************************************************** - * 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 */ PROC WINAPI wglGetProcAddress(LPCSTR func) diff --git a/dlls/gdi32/path.c b/dlls/gdi32/path.c index 9c845e6db3e..50157de478d 100644 --- a/dlls/gdi32/path.c +++ b/dlls/gdi32/path.c @@ -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 */ }; diff --git a/dlls/wineps.drv/init.c b/dlls/wineps.drv/init.c index 07d52d2e5b4..288d48ef076 100644 --- a/dlls/wineps.drv/init.c +++ b/dlls/wineps.drv/init.c @@ -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 */ }; diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c index 1225256c80d..46204d864fe 100644 --- a/dlls/winex11.drv/init.c +++ b/dlls/winex11.drv/init.c @@ -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 */ }; diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index d3118c2c68b..4db71a494ec 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -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 */ }; diff --git a/dlls/winex11.drv/xrender.c b/dlls/winex11.drv/xrender.c index 5108dfdf2e5..47322e03cd5 100644 --- a/dlls/winex11.drv/xrender.c +++ b/dlls/winex11.drv/xrender.c @@ -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 */ }; diff --git a/include/wine/gdi_driver.h b/include/wine/gdi_driver.h index 5568eaa67e0..ebb9ccec920 100644 --- a/include/wine/gdi_driver.h +++ b/include/wine/gdi_driver.h @@ -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 */ -- 2.11.4.GIT