From: Rémi Bernon rbernon@codeweavers.com
Internal pixel format is now fully hidden from applications and local to the context DC.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=58846 --- dlls/wined3d/context_gl.c | 42 --------------------------------------- dlls/wined3d/wined3d_gl.h | 2 -- 2 files changed, 44 deletions(-)
diff --git a/dlls/wined3d/context_gl.c b/dlls/wined3d/context_gl.c index ad2a50a66f1..61bf38cdafc 100644 --- a/dlls/wined3d/context_gl.c +++ b/dlls/wined3d/context_gl.c @@ -1162,38 +1162,6 @@ void wined3d_context_gl_texture_update(struct wined3d_context_gl *context_gl, } }
-static BOOL wined3d_context_gl_restore_pixel_format(struct wined3d_context_gl *context_gl) -{ - const struct wined3d_gl_info *gl_info = context_gl->gl_info; - BOOL ret = FALSE; - - if (context_gl->restore_pf && IsWindow(context_gl->restore_pf_win)) - { - if (gl_info->supported[WGL_WINE_PIXEL_FORMAT_PASSTHROUGH]) - { - HDC dc = GetDCEx(context_gl->restore_pf_win, 0, DCX_USESTYLE | DCX_CACHE); - if (dc) - { - if (!(ret = GL_EXTCALL(wglSetPixelFormatWINE(dc, context_gl->restore_pf)))) - { - ERR("Failed to restore pixel format %d on window %p.\n", - context_gl->restore_pf, context_gl->restore_pf_win); - } - ReleaseDC(context_gl->restore_pf_win, dc); - } - } - else - { - ERR("Unable to restore pixel format %d on window %p.\n", - context_gl->restore_pf, context_gl->restore_pf_win); - } - } - - context_gl->restore_pf = 0; - context_gl->restore_pf_win = NULL; - return ret; -} - static BOOL wined3d_context_gl_set_pixel_format(struct wined3d_context_gl *context_gl) { const struct wined3d_gl_info *gl_info = context_gl->gl_info; @@ -1201,7 +1169,6 @@ static BOOL wined3d_context_gl_set_pixel_format(struct wined3d_context_gl *conte int format = context_gl->pixel_format; HDC dc = context_gl->dc; int current; - HWND win;
if (private && context_gl->dc_has_format) return TRUE; @@ -1246,12 +1213,6 @@ static BOOL wined3d_context_gl_set_pixel_format(struct wined3d_context_gl *conte return FALSE; }
- win = private ? NULL : WindowFromDC(dc); - if (win != context_gl->restore_pf_win) - wined3d_context_gl_restore_pixel_format(context_gl); - context_gl->restore_pf = private ? 0 : current; - context_gl->restore_pf_win = win; - success: if (private) context_gl->dc_has_format = TRUE; @@ -1546,7 +1507,6 @@ static void wined3d_context_gl_cleanup(struct wined3d_context_gl *context_gl)
free(context_gl->texture_type);
- wined3d_context_gl_restore_pixel_format(context_gl); if (restore_ctx) context_restore_gl_context(gl_info, restore_dc, restore_ctx); else if (wglGetCurrentContext() && !wglMakeCurrent(NULL, NULL)) @@ -1654,8 +1614,6 @@ void wined3d_context_gl_release(struct wined3d_context_gl *context_gl)
if (!--context_gl->level) { - if (wined3d_context_gl_restore_pixel_format(context_gl)) - context_gl->needs_set = 1; if (context_gl->restore_ctx) { TRACE("Restoring GL context %p on device context %p.\n", context_gl->restore_ctx, context_gl->restore_dc); diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h index 5e35e723958..a3d54fe5c19 100644 --- a/dlls/wined3d/wined3d_gl.h +++ b/dlls/wined3d/wined3d_gl.h @@ -644,8 +644,6 @@ struct wined3d_context_gl unsigned int level; HGLRC restore_ctx; HDC restore_dc; - int restore_pf; - HWND restore_pf_win; HGLRC gl_ctx; HDC dc; int pixel_format;