gdi32: Get rid of the BitBlt driver entry point.
authorAlexandre Julliard <julliard@winehq.org>
Thu, 17 Mar 2011 14:01:11 +0000 (15:01 +0100)
committerAlexandre Julliard <julliard@winehq.org>
Thu, 17 Mar 2011 14:01:11 +0000 (15:01 +0100)
dlls/gdi32/bitblt.c
dlls/gdi32/driver.c
dlls/gdi32/enhmfdrv/bitblt.c
dlls/gdi32/enhmfdrv/init.c
dlls/gdi32/gdi_private.h
dlls/gdi32/mfdrv/init.c

index 6586f4100325f470613171354a424c88bf88a673..daf29cd25bbc85e9cef81fd6bb2bef68430ae2b2 100644 (file)
@@ -68,80 +68,9 @@ BOOL WINAPI PatBlt( HDC hdc, INT left, INT top, INT width, INT height, DWORD rop
 BOOL WINAPI BitBlt( HDC hdcDst, INT xDst, INT yDst, INT width,
                     INT height, HDC hdcSrc, INT xSrc, INT ySrc, DWORD rop )
 {
-    BOOL ret = FALSE;
-    DC *dcDst, *dcSrc;
-
     if (!rop_uses_src( rop )) return PatBlt( hdcDst, xDst, yDst, width, height, rop );
-
-    TRACE("hdcSrc=%p %d,%d -> hdcDest=%p %d,%d %dx%d rop=%06x\n",
-          hdcSrc, xSrc, ySrc, hdcDst, xDst, yDst, width, height, rop);
-
-    if (!(dcDst = get_dc_ptr( hdcDst ))) return FALSE;
-    update_dc( dcDst );
-
-    if (dcDst->funcs->pBitBlt || dcDst->funcs->pStretchBlt)
-    {
-        dcSrc = get_dc_ptr( hdcSrc );
-        if (dcSrc) update_dc( dcSrc );
-
-        if (dcDst->funcs->pBitBlt)
-            ret = dcDst->funcs->pBitBlt( dcDst->physDev, xDst, yDst, width, height,
-                                         dcSrc ? dcSrc->physDev : NULL, xSrc, ySrc, rop );
-        else
-            ret = dcDst->funcs->pStretchBlt( dcDst->physDev, xDst, yDst, width, height,
-                                             dcSrc ? dcSrc->physDev : NULL, xSrc, ySrc,
-                                             width, height, rop );
-
-        release_dc_ptr( dcDst );
-        if (dcSrc) release_dc_ptr( dcSrc );
-    }
-    else if (dcDst->funcs->pStretchDIBits)
-    {
-        BITMAP bm;
-        BITMAPINFOHEADER info_hdr;
-        HBITMAP hbm;
-        LPVOID bits;
-        INT lines;
-
-        release_dc_ptr( dcDst );
-
-        if(GetObjectType( hdcSrc ) != OBJ_MEMDC)
-        {
-            FIXME("hdcSrc isn't a memory dc.  Don't yet cope with this\n");
-            return FALSE;
-        }
-
-        GetObjectW(GetCurrentObject(hdcSrc, OBJ_BITMAP), sizeof(bm), &bm);
-        info_hdr.biSize = sizeof(info_hdr);
-        info_hdr.biWidth = bm.bmWidth;
-        info_hdr.biHeight = bm.bmHeight;
-        info_hdr.biPlanes = 1;
-        info_hdr.biBitCount = 32;
-        info_hdr.biCompression = BI_RGB;
-        info_hdr.biSizeImage = 0;
-        info_hdr.biXPelsPerMeter = 0;
-        info_hdr.biYPelsPerMeter = 0;
-        info_hdr.biClrUsed = 0;
-        info_hdr.biClrImportant = 0;
-
-        if(!(bits = HeapAlloc(GetProcessHeap(), 0, bm.bmHeight * bm.bmWidth * 4)))
-            return FALSE;
-
-        /* Select out the src bitmap before calling GetDIBits */
-        hbm = SelectObject(hdcSrc, GetStockObject(DEFAULT_BITMAP));
-        GetDIBits(hdcSrc, hbm, 0, bm.bmHeight, bits, (BITMAPINFO*)&info_hdr, DIB_RGB_COLORS);
-        SelectObject(hdcSrc, hbm);
-
-        lines = StretchDIBits(hdcDst, xDst, yDst, width, height, xSrc, bm.bmHeight - height - ySrc,
-                              width, height, bits, (BITMAPINFO*)&info_hdr, DIB_RGB_COLORS, rop);
-
-        HeapFree(GetProcessHeap(), 0, bits);
-        return (lines == height);
-    }
-    else release_dc_ptr( dcDst );
-
-    return ret;
+    else return StretchBlt( hdcDst, xDst, yDst, width, height,
+                            hdcSrc, xSrc, ySrc, width, height, rop );
 }
 
 
index 57f3117c530c71acc86f6b5216a3e5dd0dca2441..f70293dd171a41d8df5f1e48d4ffe1fc080905c7 100644 (file)
@@ -81,7 +81,6 @@ static struct graphics_driver *create_driver( HMODULE module )
         GET_FUNC(Arc);
         GET_FUNC(ArcTo);
         GET_FUNC(BeginPath);
-        GET_FUNC(BitBlt);
         GET_FUNC(ChoosePixelFormat);
         GET_FUNC(Chord);
         GET_FUNC(CloseFigure);
@@ -794,7 +793,6 @@ const DC_FUNCTIONS null_driver =
     nulldrv_Arc,                        /* pArc */
     nulldrv_ArcTo,                      /* pArcTo */
     nulldrv_BeginPath,                  /* pBeginPath */
-    NULL,                               /* pBitBlt */
     nulldrv_ChoosePixelFormat,          /* pChoosePixelFormat */
     nulldrv_Chord,                      /* pChord */
     nulldrv_CloseFigure,                /* pCloseFigure */
index f56e8ac0ebc153f409afa4d30de72847d2c3ee9d..377efad763f33203f8cac16d596d72998950ecbd 100644 (file)
@@ -65,12 +65,8 @@ BOOL CDECL EMFDRV_PatBlt( PHYSDEV dev, INT left, INT top,
     return ret;
 }
 
-/* Utilitarian function used by EMFDRV_BitBlt and EMFDRV_StretchBlt */
-
-static BOOL EMFDRV_BitBlockTransfer( 
-    PHYSDEV devDst, INT xDst, INT yDst, INT widthDst, INT heightDst,  
-    PHYSDEV devSrc, INT xSrc, INT ySrc, INT widthSrc, INT heightSrc, DWORD rop,
-    DWORD emrType)
+BOOL CDECL EMFDRV_StretchBlt( PHYSDEV devDst, INT xDst, INT yDst, INT widthDst, INT heightDst,
+                              PHYSDEV devSrc, INT xSrc, INT ySrc, INT widthSrc, INT heightSrc, DWORD rop )
 {
     BOOL ret;
     PEMRBITBLT pEMR;
@@ -83,13 +79,18 @@ static BOOL EMFDRV_BitBlockTransfer(
     LPBITMAPINFOHEADER lpBmiH;
     EMFDRV_PDEVICE* physDevSrc = (EMFDRV_PDEVICE*)devSrc;
     HBITMAP hBitmap = NULL;
+    DWORD emrType;
 
-    if (emrType == EMR_BITBLT)
+    if (widthSrc == widthDst && heightSrc == heightDst)
+    {
+        emrType = EMR_BITBLT;
         emrSize = sizeof(EMRBITBLT);
-    else if (emrType == EMR_STRETCHBLT)
-        emrSize = sizeof(EMRSTRETCHBLT);
+    }
     else
-        return FALSE;
+    {
+        emrType = EMR_STRETCHBLT;
+        emrSize = sizeof(EMRSTRETCHBLT);
+    }
 
     hBitmap = GetCurrentObject(physDevSrc->hdc, OBJ_BITMAP);
 
@@ -168,24 +169,6 @@ static BOOL EMFDRV_BitBlockTransfer(
     return ret;
 }
 
-BOOL CDECL EMFDRV_BitBlt(
-    PHYSDEV devDst, INT xDst, INT yDst, INT width, INT height,
-    PHYSDEV devSrc, INT xSrc, INT ySrc, DWORD rop)
-{
-    return EMFDRV_BitBlockTransfer( devDst, xDst, yDst, width, height,  
-                                    devSrc, xSrc, ySrc, width, height, 
-                                    rop, EMR_BITBLT );
-}
-
-BOOL CDECL EMFDRV_StretchBlt(
-    PHYSDEV devDst, INT xDst, INT yDst, INT widthDst, INT heightDst,  
-    PHYSDEV devSrc, INT xSrc, INT ySrc, INT widthSrc, INT heightSrc, DWORD rop )
-{
-    return EMFDRV_BitBlockTransfer( devDst, xDst, yDst, widthDst, heightDst,  
-                                    devSrc, xSrc, ySrc, widthSrc, heightSrc, 
-                                    rop, EMR_STRETCHBLT );
-}
-
 INT CDECL EMFDRV_StretchDIBits( PHYSDEV dev, INT xDst, INT yDst, INT widthDst,
                                       INT heightDst, INT xSrc, INT ySrc,
                                       INT widthSrc, INT heightSrc,
index ac3fa4f3e3925128bbc370223497ee810a5c1b06..c31496b6606decd31de3e2c04cdbf95ecab637ec 100644 (file)
@@ -43,7 +43,6 @@ static const DC_FUNCTIONS EMFDRV_Funcs =
     EMFDRV_Arc,                      /* pArc */
     NULL,                            /* pArcTo */
     EMFDRV_BeginPath,                /* pBeginPath */
-    EMFDRV_BitBlt,                   /* pBitBlt */
     NULL,                            /* pChoosePixelFormat */
     EMFDRV_Chord,                    /* pChord */
     EMFDRV_CloseFigure,              /* pCloseFigure */
index 9db7c3291f0dc7c5851545276e80354e648c292d..01f2c1b31e30922e02b3bc00dccc8d29d1cef8c2 100644 (file)
@@ -88,7 +88,6 @@ typedef struct tagDC_FUNCS
     BOOL     (CDECL *pArc)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT);
     BOOL     (CDECL *pArcTo)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT);
     BOOL     (CDECL *pBeginPath)(PHYSDEV);
-    BOOL     (CDECL *pBitBlt)(PHYSDEV,INT,INT,INT,INT,PHYSDEV,INT,INT,DWORD);
     INT      (CDECL *pChoosePixelFormat)(PHYSDEV,const PIXELFORMATDESCRIPTOR *);
     BOOL     (CDECL *pChord)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT);
     BOOL     (CDECL *pCloseFigure)(PHYSDEV);
index 03af2e8885af0767ae402b7a8413d358b56d1246..2cd3ff86a63afa6acf81c09b0a0b1c346ee031fa 100644 (file)
@@ -41,7 +41,6 @@ static const DC_FUNCTIONS MFDRV_Funcs =
     MFDRV_Arc,                       /* pArc */
     NULL,                            /* pArcTo */
     MFDRV_BeginPath,                 /* pBeginPath */
-    NULL,                            /* pBitBlt */
     NULL,                            /* pChoosePixelFormat */
     MFDRV_Chord,                     /* pChord */
     MFDRV_CloseFigure,               /* pCloseFigure */