Alexandre Julliard : winex11: Use an intermediate pixmap also for DDBs to handle format mismatches.

Alexandre Julliard julliard at winehq.org
Wed May 9 13:46:18 CDT 2012


Module: wine
Branch: master
Commit: b082b3acba54c69db0338b000fa9ceded9ed94c9
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=b082b3acba54c69db0338b000fa9ceded9ed94c9

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed May  9 17:35:09 2012 +0200

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 883deba..f00e530 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 1b5c7a9..95c1169 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 5533c76..82889c2 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 */




More information about the wine-cvs mailing list