From b082b3acba54c69db0338b000fa9ceded9ed94c9 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 9 May 2012 17:35:09 +0200 Subject: [PATCH] winex11: Use an intermediate pixmap also for DDBs to handle format mismatches. --- dlls/winex11.drv/bitmap.c | 2 -- dlls/winex11.drv/opengl.c | 56 ++--------------------------------------------- dlls/winex11.drv/x11drv.h | 1 - 3 files changed, 2 insertions(+), 57 deletions(-) diff --git a/dlls/winex11.drv/bitmap.c b/dlls/winex11.drv/bitmap.c index 883debaf775..f00e53040b0 100644 --- a/dlls/winex11.drv/bitmap.c +++ b/dlls/winex11.drv/bitmap.c @@ -239,8 +239,6 @@ BOOL X11DRV_DeleteBitmap( HBITMAP hbitmap ) if (physBitmap) { - if (physBitmap->glxpixmap) - destroy_glxpixmap( gdi_display, physBitmap->glxpixmap ); wine_tsx11_lock(); if (physBitmap->pixmap) XFreePixmap( gdi_display, physBitmap->pixmap ); XDeleteContext( gdi_display, (XID)hbitmap, bitmap_context ); diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index 1b5c7a9adb4..95c11696e6f 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -1172,24 +1172,6 @@ Drawable create_glxpixmap(Display *display, XVisualInfo *vis, Pixmap parent) } -static XID create_bitmap_glxpixmap(X11DRV_PDEVICE *physDev, WineGLPixelFormat *fmt) -{ - GLXPixmap ret = 0; - XVisualInfo *vis; - - wine_tsx11_lock(); - - vis = pglXGetVisualFromFBConfig(gdi_display, fmt->fbconfig); - if(vis) { - if(vis->depth == physDev->bitmap->depth) - ret = pglXCreateGLXPixmap(gdi_display, vis, physDev->bitmap->pixmap); - XFree(vis); - } - wine_tsx11_unlock(); - TRACE("return %lx\n", ret); - return ret; -} - /** * glxdrv_ChoosePixelFormat * @@ -1610,16 +1592,6 @@ static BOOL internal_SetPixelFormat( struct glx_physdev *physdev, return FALSE; } - if (physdev->x11dev->bitmap->hbitmap == GetCurrentObject( physdev->dev.hdc, OBJ_BITMAP )) - { - physdev->x11dev->bitmap->glxpixmap = create_bitmap_glxpixmap(physdev->x11dev, fmt); - if(!physdev->x11dev->bitmap->glxpixmap) { - WARN("Couldn't create glxpixmap for pixel format %d\n", iPixelFormat); - return FALSE; - } - } - /* otherwise we have a DIB section */ - physdev->pixel_format = iPixelFormat; physdev->type = DC_GL_BITMAP; } @@ -1830,17 +1802,11 @@ static PROC glxdrv_wglGetProcAddress(LPCSTR lpszProc) static GLXPixmap get_context_pixmap( struct glx_physdev *physdev, struct wine_glcontext *ctx ) { - HBITMAP bitmap = GetCurrentObject( physdev->dev.hdc, OBJ_BITMAP ); - - if (physdev->x11dev->bitmap->hbitmap == bitmap) return physdev->x11dev->bitmap->glxpixmap; - - /* otherwise we have a DIB section */ - if (!ctx->pixmap) { BITMAP bmp; - GetObjectW( bitmap, sizeof(bmp), &bmp ); + GetObjectW( GetCurrentObject( physdev->dev.hdc, OBJ_BITMAP ), sizeof(bmp), &bmp ); wine_tsx11_lock(); ctx->pixmap = XCreatePixmap( gdi_display, root_window, @@ -3974,24 +3940,6 @@ static BOOL glxdrv_DeleteDC( PHYSDEV dev ) return TRUE; } -/*********************************************************************** - * glxdrv_SelectBitmap - */ -static HBITMAP glxdrv_SelectBitmap( PHYSDEV dev, HBITMAP hbitmap ) -{ - HBITMAP ret; - struct glx_physdev *physdev = get_glxdrv_dev( dev ); - - dev = GET_NEXT_PHYSDEV( dev, pSelectBitmap ); - ret = dev->funcs->pSelectBitmap( dev, hbitmap ); - if (ret) - { - if (hbitmap == BITMAP_stock_phys_bitmap.hbitmap) physdev->drawable = 0; - else physdev->drawable = X11DRV_get_phys_bitmap(hbitmap)->glxpixmap; - } - return ret; -} - /********************************************************************** * glxdrv_ExtEscape */ @@ -4122,7 +4070,7 @@ static const struct gdi_dc_funcs glxdrv_funcs = NULL, /* pSaveDC */ NULL, /* pScaleViewportExt */ NULL, /* pScaleWindowExt */ - glxdrv_SelectBitmap, /* pSelectBitmap */ + NULL, /* pSelectBitmap */ NULL, /* pSelectBrush */ NULL, /* pSelectClipPath */ NULL, /* pSelectFont */ diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 5533c760414..82889c2412c 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -108,7 +108,6 @@ typedef struct { HBITMAP hbitmap; Pixmap pixmap; - XID glxpixmap; int depth; /* depth of the X pixmap */ int format; /* color format (used by XRender) */ ColorShifts color_shifts; /* color shifts of the X pixmap */ -- 2.11.4.GIT