Commit 8a7bf0a2 authored by Alexandre Julliard's avatar Alexandre Julliard

gdi32: Push a path driver on the DC stack when a path is opened.

parent 97a261d5
......@@ -675,7 +675,7 @@ static HGDIOBJ BITMAP_SelectObject( HGDIOBJ handle, HDC hdc )
HGDIOBJ ret;
BITMAPOBJ *bitmap;
DC *dc;
PHYSDEV physdev = NULL, old_physdev = NULL;
PHYSDEV physdev = NULL, old_physdev = NULL, pathdev = NULL;
if (!(dc = get_dc_ptr( hdc ))) return 0;
......@@ -701,6 +701,8 @@ static HGDIOBJ BITMAP_SelectObject( HGDIOBJ handle, HDC hdc )
goto done;
}
if (dc->physDev->funcs == &path_driver) pathdev = pop_dc_driver( &dc->physDev );
old_physdev = GET_DC_PHYSDEV( dc, pSelectBitmap );
if(old_physdev == dc->dibdrv)
old_physdev = pop_dc_driver( &dc->physDev );
......@@ -752,6 +754,7 @@ static HGDIOBJ BITMAP_SelectObject( HGDIOBJ handle, HDC hdc )
if (old_physdev && old_physdev == dc->dibdrv)
push_dc_driver( &dc->physDev, old_physdev, old_physdev->funcs );
}
if (pathdev) push_dc_driver( &dc->physDev, pathdev, pathdev->funcs );
release_dc_ptr( dc );
return ret;
}
......
......@@ -416,8 +416,6 @@ INT nulldrv_SaveDC( PHYSDEV dev )
newdc->BoundsRect = dc->BoundsRect;
newdc->gdiFont = dc->gdiFont;
PATH_InitGdiPath( &newdc->path );
/* Get/SetDCState() don't change hVisRgn field ("Undoc. Windows" p.559). */
newdc->hVisRgn = 0;
......@@ -437,7 +435,7 @@ INT nulldrv_SaveDC( PHYSDEV dev )
/* don't bother recomputing hMetaClipRgn, we'll do that in SetDCState */
if (!PATH_AssignGdiPath( &newdc->path, &dc->path ))
if (!PATH_SavePath( newdc, dc ))
{
release_dc_ptr( dc );
free_dc_state( newdc );
......@@ -468,7 +466,7 @@ BOOL nulldrv_RestoreDC( PHYSDEV dev, INT level )
/* restore the state */
if (!PATH_AssignGdiPath( &dc->path, &dcs->path )) return FALSE;
if (!PATH_RestorePath( dc, dcs )) return FALSE;
dc->flags = dcs->flags;
dc->layout = dcs->layout;
......@@ -799,6 +797,7 @@ BOOL WINAPI DeleteDC( HDC hdc )
free_dc_state( dcs );
}
AbortPath( hdc );
SelectObject( hdc, GetStockObject(BLACK_PEN) );
SelectObject( hdc, GetStockObject(WHITE_BRUSH) );
SelectObject( hdc, GetStockObject(SYSTEM_FONT) );
......
......@@ -270,6 +270,7 @@ extern DWORD blend_bitmapinfo( const BITMAPINFO *src_info, void *src_bits, struc
/* driver.c */
extern const struct gdi_dc_funcs null_driver DECLSPEC_HIDDEN;
extern const struct gdi_dc_funcs dib_driver DECLSPEC_HIDDEN;
extern const struct gdi_dc_funcs path_driver DECLSPEC_HIDDEN;
extern const struct gdi_dc_funcs *font_driver DECLSPEC_HIDDEN;
extern const struct gdi_dc_funcs *DRIVER_load_driver( LPCWSTR name ) DECLSPEC_HIDDEN;
extern BOOL DRIVER_GetDriverName( LPCWSTR device, LPWSTR driver, DWORD size ) DECLSPEC_HIDDEN;
......@@ -321,7 +322,8 @@ extern METAHEADER *MF_CreateMetaHeaderDisk(METAHEADER *mr, LPCVOID filename, BOO
extern void PATH_InitGdiPath(GdiPath *pPath) DECLSPEC_HIDDEN;
extern void PATH_DestroyGdiPath(GdiPath *pPath) DECLSPEC_HIDDEN;
extern BOOL PATH_AssignGdiPath(GdiPath *pPathDest, const GdiPath *pPathSrc) DECLSPEC_HIDDEN;
extern BOOL PATH_SavePath( DC *dst, DC *src ) DECLSPEC_HIDDEN;
extern BOOL PATH_RestorePath( DC *dst, DC *src ) DECLSPEC_HIDDEN;
extern BOOL PATH_MoveTo(DC *dc) DECLSPEC_HIDDEN;
extern BOOL PATH_LineTo(DC *dc, INT x, INT y) DECLSPEC_HIDDEN;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment