gdi32: Leave it up to the driver to push the new device on the DC stack in CreateDC.

This commit is contained in:
Alexandre Julliard 2011-09-07 17:01:29 +02:00
parent c331a1a6cd
commit a28ddddcbc
5 changed files with 11 additions and 13 deletions

View File

@ -628,13 +628,11 @@ HDC WINAPI CreateDCW( LPCWSTR driver, LPCWSTR device, LPCWSTR output,
if (funcs->pCreateDC) if (funcs->pCreateDC)
{ {
PHYSDEV physdev; if (!funcs->pCreateDC( &dc->physDev, buf, device, output, initData ))
if (!funcs->pCreateDC( hdc, &physdev, buf, device, output, initData ))
{ {
WARN("creation aborted by device\n" ); WARN("creation aborted by device\n" );
goto error; goto error;
} }
push_dc_driver( &dc->physDev, physdev, funcs );
} }
dc->vis_rect.left = 0; dc->vis_rect.left = 0;

View File

@ -224,7 +224,7 @@ static BOOL nulldrv_CreateCompatibleDC( PHYSDEV orig, PHYSDEV *pdev )
return display_driver->funcs->pCreateCompatibleDC( NULL, 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 ) LPCWSTR output, const DEVMODEW *devmode )
{ {
assert(0); /* should never be called */ assert(0); /* should never be called */

View File

@ -323,8 +323,8 @@ static PSDRV_PDEVICE *create_psdrv_physdev( PRINTERINFO *pi )
/********************************************************************** /**********************************************************************
* PSDRV_CreateDC * PSDRV_CreateDC
*/ */
static BOOL PSDRV_CreateDC( HDC hdc, PHYSDEV *pdev, LPCWSTR driver, LPCWSTR device, static BOOL PSDRV_CreateDC( PHYSDEV *pdev, LPCWSTR driver, LPCWSTR device,
LPCWSTR output, const DEVMODEW* initData ) LPCWSTR output, const DEVMODEW* initData )
{ {
PSDRV_PDEVICE *physDev; PSDRV_PDEVICE *physDev;
PRINTERINFO *pi; 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; if (!(physDev = create_psdrv_physdev( pi ))) return FALSE;
*pdev = &physDev->dev;
if (output && *output) { if (output && *output) {
INT len = WideCharToMultiByte( CP_ACP, 0, output, -1, NULL, 0, NULL, NULL ); 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); PSDRV_UpdateDevCaps(physDev);
SelectObject( hdc, PSDRV_DefaultFont ); SelectObject( (*pdev)->hdc, PSDRV_DefaultFont );
push_dc_driver( pdev, &physDev->dev, &psdrv_funcs );
return TRUE; return TRUE;
} }

View File

@ -144,8 +144,8 @@ static X11DRV_PDEVICE *create_x11_physdev( Drawable drawable )
/********************************************************************** /**********************************************************************
* X11DRV_CreateDC * X11DRV_CreateDC
*/ */
static BOOL X11DRV_CreateDC( HDC hdc, PHYSDEV *pdev, LPCWSTR driver, LPCWSTR device, static BOOL X11DRV_CreateDC( PHYSDEV *pdev, LPCWSTR driver, LPCWSTR device,
LPCWSTR output, const DEVMODEW* initData ) LPCWSTR output, const DEVMODEW* initData )
{ {
X11DRV_PDEVICE *physDev = create_x11_physdev( root_window ); 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; physDev->drawable_rect = virtual_screen_rect;
SetRect( &physDev->dc_rect, 0, 0, virtual_screen_rect.right - virtual_screen_rect.left, SetRect( &physDev->dc_rect, 0, 0, virtual_screen_rect.right - virtual_screen_rect.left,
virtual_screen_rect.bottom - virtual_screen_rect.top ); virtual_screen_rect.bottom - virtual_screen_rect.top );
*pdev = &physDev->dev; push_dc_driver( pdev, &physDev->dev, &x11drv_funcs );
return TRUE; return TRUE;
} }

View File

@ -66,7 +66,7 @@ struct gdi_dc_funcs
BOOL (*pCloseFigure)(PHYSDEV); BOOL (*pCloseFigure)(PHYSDEV);
BOOL (*pCreateBitmap)(PHYSDEV,HBITMAP); BOOL (*pCreateBitmap)(PHYSDEV,HBITMAP);
BOOL (*pCreateCompatibleDC)(PHYSDEV,PHYSDEV*); 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); HBITMAP (*pCreateDIBSection)(PHYSDEV,HBITMAP,BITMAPINFO *,UINT);
BOOL (*pDeleteBitmap)(HBITMAP); BOOL (*pDeleteBitmap)(HBITMAP);
BOOL (*pDeleteDC)(PHYSDEV); BOOL (*pDeleteDC)(PHYSDEV);
@ -189,7 +189,7 @@ struct gdi_dc_funcs
}; };
/* increment this when you change the DC function table */ /* 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 ) static inline PHYSDEV get_physdev_entry_point( PHYSDEV dev, size_t offset )
{ {