Alexandre Julliard : winex11: Get rid of the GetPixel implementation, use the null driver fallback instead.

Alexandre Julliard julliard at winehq.org
Tue Dec 13 13:01:24 CST 2011


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Dec 12 21:21:28 2011 +0100

winex11: Get rid of the GetPixel implementation, use the null driver fallback instead.

---

 dlls/winex11.drv/graphics.c |   52 -------------------------------------------
 dlls/winex11.drv/init.c     |    2 +-
 dlls/winex11.drv/x11drv.h   |    1 -
 3 files changed, 1 insertions(+), 54 deletions(-)

diff --git a/dlls/winex11.drv/graphics.c b/dlls/winex11.drv/graphics.c
index 0f72389..163afd2 100644
--- a/dlls/winex11.drv/graphics.c
+++ b/dlls/winex11.drv/graphics.c
@@ -1093,58 +1093,6 @@ COLORREF X11DRV_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color )
 
 
 /***********************************************************************
- *           X11DRV_GetPixel
- */
-COLORREF X11DRV_GetPixel( PHYSDEV dev, INT x, INT y )
-{
-    static Pixmap pixmap = 0;
-    X11DRV_PDEVICE *physDev = get_x11drv_dev( dev );
-    XImage * image;
-    int pixel;
-    POINT pt;
-    BOOL memdc = (GetObjectType(dev->hdc) == OBJ_MEMDC);
-
-    pt.x = x;
-    pt.y = y;
-    LPtoDP( dev->hdc, &pt, 1 );
-
-    /* Update the pixmap from the DIB section */
-    X11DRV_LockDIBSection(physDev, DIB_Status_GdiMod);
-
-    wine_tsx11_lock();
-    if (memdc)
-    {
-        image = XGetImage( gdi_display, physDev->drawable,
-                           physDev->dc_rect.left + pt.x, physDev->dc_rect.top + pt.y,
-                           1, 1, AllPlanes, ZPixmap );
-    }
-    else
-    {
-        /* If we are reading from the screen, use a temporary copy */
-        /* to avoid a BadMatch error */
-        if (!pixmap) pixmap = XCreatePixmap( gdi_display, root_window,
-                                             1, 1, physDev->depth );
-        XCopyArea( gdi_display, physDev->drawable, pixmap, get_bitmap_gc(physDev->depth),
-                   physDev->dc_rect.left + pt.x, physDev->dc_rect.top + pt.y, 1, 1, 0, 0 );
-        image = XGetImage( gdi_display, pixmap, 0, 0, 1, 1, AllPlanes, ZPixmap );
-    }
-    pixel = XGetPixel( image, 0, 0 );
-    XDestroyImage( image );
-    wine_tsx11_unlock();
-
-    /* Update the DIBSection from the pixmap */
-    X11DRV_UnlockDIBSection(physDev, FALSE);
-    if( physDev->depth > 1)
-        pixel = X11DRV_PALETTE_ToLogical(physDev, pixel);
-    else
-        /* monochrome bitmaps return black or white */
-        if( pixel) pixel = 0xffffff;
-    return pixel;
-
-}
-
-
-/***********************************************************************
  *           X11DRV_PaintRgn
  */
 BOOL X11DRV_PaintRgn( PHYSDEV dev, HRGN hrgn )
diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c
index 39a57b5..b094e0a 100644
--- a/dlls/winex11.drv/init.c
+++ b/dlls/winex11.drv/init.c
@@ -512,7 +512,7 @@ static const struct gdi_dc_funcs x11drv_funcs =
     NULL,                               /* pGetKerningPairs */
     X11DRV_GetNearestColor,             /* pGetNearestColor */
     NULL,                               /* pGetOutlineTextMetrics */
-    X11DRV_GetPixel,                    /* pGetPixel */
+    NULL,                               /* pGetPixel */
     X11DRV_GetPixelFormat,              /* pGetPixelFormat */
     X11DRV_GetSystemPaletteEntries,     /* pGetSystemPaletteEntries */
     NULL,                               /* pGetTextCharsetInfo */
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
index 7c12360..922aa9a 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
@@ -198,7 +198,6 @@ extern BOOL X11DRV_GetICMProfile( PHYSDEV dev, LPDWORD size, LPWSTR filename ) D
 extern DWORD X11DRV_GetImage( PHYSDEV dev, HBITMAP hbitmap, BITMAPINFO *info,
                               struct gdi_image_bits *bits, struct bitblt_coords *src ) DECLSPEC_HIDDEN;
 extern COLORREF X11DRV_GetNearestColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
-extern COLORREF X11DRV_GetPixel( PHYSDEV dev, INT x, INT y) DECLSPEC_HIDDEN;
 extern UINT X11DRV_GetSystemPaletteEntries( PHYSDEV dev, UINT start, UINT count, LPPALETTEENTRY entries ) DECLSPEC_HIDDEN;
 extern BOOL X11DRV_GetTextExtentExPoint( PHYSDEV dev, LPCWSTR str, INT count, INT maxExt,
                                          LPINT lpnFit, LPINT alpDx, LPSIZE size ) DECLSPEC_HIDDEN;




More information about the wine-cvs mailing list