From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winex11.drv/opengl.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index 8dcc1b1b24a..a5fd7bcb26c 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -197,13 +197,8 @@ struct glx_pixel_format struct gl_drawable { struct opengl_drawable base; - RECT rect; /* current size of the GL drawable */ GLXDrawable drawable; /* drawable for rendering with GL */ Colormap colormap; /* colormap for the client window */ - Pixmap pixmap; /* base pixmap if drawable is a GLXPixmap */ - BOOL offscreen; - HDC hdc_src; - HDC hdc_dst; };
static struct gl_drawable *impl_from_opengl_drawable( struct opengl_drawable *base ) @@ -498,7 +493,6 @@ static BOOL x11drv_egl_surface_create( HWND hwnd, int format, struct opengl_draw gl = opengl_drawable_create( sizeof(*gl), &x11drv_egl_surface_funcs, format, client ); client_surface_release( client ); if (!gl) return FALSE; - gl->rect = rect;
if (!(gl->base.surface = funcs->p_eglCreateWindowSurface( egl->display, egl_config_for_format( format ), (void *)window, NULL ))) @@ -869,8 +863,6 @@ static void x11drv_surface_destroy( struct opengl_drawable *base )
if (gl->drawable) pglXDestroyWindow( gdi_display, gl->drawable ); if (gl->colormap) XFreeColormap( gdi_display, gl->colormap ); - if (gl->hdc_src) NtGdiDeleteObjectApp( gl->hdc_src ); - if (gl->hdc_dst) NtGdiDeleteObjectApp( gl->hdc_dst ); }
static BOOL set_swap_interval( struct gl_drawable *gl, int interval ) @@ -946,7 +938,6 @@ static BOOL x11drv_surface_create( HWND hwnd, int format, struct opengl_drawable gl = opengl_drawable_create( sizeof(*gl), &x11drv_surface_funcs, format, client ); client_surface_release( client ); if (!gl) goto failed; - gl->rect = rect; gl->colormap = colormap;
if (!(gl->drawable = pglXCreateWindow( gdi_display, fmt->fbconfig, window, NULL ))) @@ -1448,10 +1439,12 @@ static BOOL x11drv_surface_swap( struct opengl_drawable *base ) GLXContext ctx = NtCurrentTeb()->glReserved2; struct gl_drawable *gl = impl_from_opengl_drawable( base ); INT64 ust, msc, sbc, target_sbc = 0; + BOOL offscreen;
TRACE( "drawable %s\n", debugstr_opengl_drawable( base ) );
- if (!ctx || gl->offscreen || !pglXSwapBuffersMscOML) pglXSwapBuffers( gdi_display, gl->drawable ); + if ((offscreen = InterlockedCompareExchange( &base->client->offscreen, 0, 0 )) || + !ctx || !pglXSwapBuffersMscOML) pglXSwapBuffers( gdi_display, gl->drawable ); else { funcs->p_glFlush(); @@ -1459,7 +1452,7 @@ static BOOL x11drv_surface_swap( struct opengl_drawable *base ) if (pglXWaitForSbcOML) pglXWaitForSbcOML( gdi_display, gl->drawable, target_sbc, &ust, &msc, &sbc ); }
- if (InterlockedCompareExchange( &base->client->offscreen, 0, 0 )) + if (offscreen) { if (!pglXWaitForSbcOML) XFlush( gdi_display ); client_surface_present( base->client );