Alexandre Julliard : gdi32: Leave it up to the driver to push the new device on the DC stack in CreateDC .
Alexandre Julliard
julliard at winehq.org
Wed Sep 7 12:35:30 CDT 2011
Module: wine
Branch: master
Commit: a28ddddcbcd3307e58a8de42a8e4d488080353e5
URL: http://source.winehq.org/git/wine.git/?a=commit;h=a28ddddcbcd3307e58a8de42a8e4d488080353e5
Author: Alexandre Julliard <julliard at winehq.org>
Date: Wed Sep 7 17:01:29 2011 +0200
gdi32: Leave it up to the driver to push the new device on the DC stack in CreateDC.
---
dlls/gdi32/dc.c | 4 +---
dlls/gdi32/driver.c | 2 +-
dlls/wineps.drv/init.c | 8 ++++----
dlls/winex11.drv/init.c | 6 +++---
include/wine/gdi_driver.h | 4 ++--
5 files changed, 11 insertions(+), 13 deletions(-)
diff --git a/dlls/gdi32/dc.c b/dlls/gdi32/dc.c
index 7c1ebc0..5ba4e59 100644
--- a/dlls/gdi32/dc.c
+++ b/dlls/gdi32/dc.c
@@ -628,13 +628,11 @@ HDC WINAPI CreateDCW( LPCWSTR driver, LPCWSTR device, LPCWSTR output,
if (funcs->pCreateDC)
{
- PHYSDEV physdev;
- if (!funcs->pCreateDC( hdc, &physdev, buf, device, output, initData ))
+ if (!funcs->pCreateDC( &dc->physDev, buf, device, output, initData ))
{
WARN("creation aborted by device\n" );
goto error;
}
- push_dc_driver( &dc->physDev, physdev, funcs );
}
dc->vis_rect.left = 0;
diff --git a/dlls/gdi32/driver.c b/dlls/gdi32/driver.c
index 4d1054e..51e241f 100644
--- a/dlls/gdi32/driver.c
+++ b/dlls/gdi32/driver.c
@@ -224,7 +224,7 @@ static BOOL nulldrv_CreateCompatibleDC( PHYSDEV orig, PHYSDEV *pdev )
return display_driver->funcs->pCreateCompatibleDC( NULL, pdev );
}
-static BOOL nulldrv_CreateDC( HDC hdc, PHYSDEV *dev, LPCWSTR driver, LPCWSTR device,
+static BOOL nulldrv_CreateDC( PHYSDEV *dev, LPCWSTR driver, LPCWSTR device,
LPCWSTR output, const DEVMODEW *devmode )
{
assert(0); /* should never be called */
diff --git a/dlls/wineps.drv/init.c b/dlls/wineps.drv/init.c
index a1ed1a2..e7e545e 100644
--- a/dlls/wineps.drv/init.c
+++ b/dlls/wineps.drv/init.c
@@ -323,8 +323,8 @@ static PSDRV_PDEVICE *create_psdrv_physdev( PRINTERINFO *pi )
/**********************************************************************
* PSDRV_CreateDC
*/
-static BOOL PSDRV_CreateDC( HDC hdc, PHYSDEV *pdev, LPCWSTR driver, LPCWSTR device,
- LPCWSTR output, const DEVMODEW* initData )
+static BOOL PSDRV_CreateDC( PHYSDEV *pdev, LPCWSTR driver, LPCWSTR device,
+ LPCWSTR output, const DEVMODEW* initData )
{
PSDRV_PDEVICE *physDev;
PRINTERINFO *pi;
@@ -354,7 +354,6 @@ static BOOL PSDRV_CreateDC( HDC hdc, PHYSDEV *pdev, LPCWSTR driver, LPCWSTR devi
}
if (!(physDev = create_psdrv_physdev( pi ))) return FALSE;
- *pdev = &physDev->dev;
if (output && *output) {
INT len = WideCharToMultiByte( CP_ACP, 0, output, -1, NULL, 0, NULL, NULL );
@@ -369,7 +368,8 @@ static BOOL PSDRV_CreateDC( HDC hdc, PHYSDEV *pdev, LPCWSTR driver, LPCWSTR devi
}
PSDRV_UpdateDevCaps(physDev);
- SelectObject( hdc, PSDRV_DefaultFont );
+ SelectObject( (*pdev)->hdc, PSDRV_DefaultFont );
+ push_dc_driver( pdev, &physDev->dev, &psdrv_funcs );
return TRUE;
}
diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c
index ea96d0c..2b0df17 100644
--- a/dlls/winex11.drv/init.c
+++ b/dlls/winex11.drv/init.c
@@ -144,8 +144,8 @@ static X11DRV_PDEVICE *create_x11_physdev( Drawable drawable )
/**********************************************************************
* X11DRV_CreateDC
*/
-static BOOL X11DRV_CreateDC( HDC hdc, PHYSDEV *pdev, LPCWSTR driver, LPCWSTR device,
- LPCWSTR output, const DEVMODEW* initData )
+static BOOL X11DRV_CreateDC( PHYSDEV *pdev, LPCWSTR driver, LPCWSTR device,
+ LPCWSTR output, const DEVMODEW* initData )
{
X11DRV_PDEVICE *physDev = create_x11_physdev( root_window );
@@ -156,7 +156,7 @@ static BOOL X11DRV_CreateDC( HDC hdc, PHYSDEV *pdev, LPCWSTR driver, LPCWSTR dev
physDev->drawable_rect = virtual_screen_rect;
SetRect( &physDev->dc_rect, 0, 0, virtual_screen_rect.right - virtual_screen_rect.left,
virtual_screen_rect.bottom - virtual_screen_rect.top );
- *pdev = &physDev->dev;
+ push_dc_driver( pdev, &physDev->dev, &x11drv_funcs );
return TRUE;
}
diff --git a/include/wine/gdi_driver.h b/include/wine/gdi_driver.h
index 3f67d81..1e7ebdb 100644
--- a/include/wine/gdi_driver.h
+++ b/include/wine/gdi_driver.h
@@ -66,7 +66,7 @@ struct gdi_dc_funcs
BOOL (*pCloseFigure)(PHYSDEV);
BOOL (*pCreateBitmap)(PHYSDEV,HBITMAP);
BOOL (*pCreateCompatibleDC)(PHYSDEV,PHYSDEV*);
- BOOL (*pCreateDC)(HDC,PHYSDEV *,LPCWSTR,LPCWSTR,LPCWSTR,const DEVMODEW*);
+ BOOL (*pCreateDC)(PHYSDEV*,LPCWSTR,LPCWSTR,LPCWSTR,const DEVMODEW*);
HBITMAP (*pCreateDIBSection)(PHYSDEV,HBITMAP,BITMAPINFO *,UINT);
BOOL (*pDeleteBitmap)(HBITMAP);
BOOL (*pDeleteDC)(PHYSDEV);
@@ -189,7 +189,7 @@ struct gdi_dc_funcs
};
/* increment this when you change the DC function table */
-#define WINE_GDI_DRIVER_VERSION 12
+#define WINE_GDI_DRIVER_VERSION 13
static inline PHYSDEV get_physdev_entry_point( PHYSDEV dev, size_t offset )
{
More information about the wine-cvs
mailing list