gdi32: Use the hdc from the generic physdev structure in metafiles.
This commit is contained in:
parent
65ba77bd5c
commit
edb68487f4
|
@ -181,7 +181,6 @@ static DC *MFDRV_AllocMetaFile(void)
|
|||
}
|
||||
|
||||
push_dc_driver( dc, &physDev->dev, &MFDRV_Funcs );
|
||||
physDev->hdc = dc->hSelf;
|
||||
|
||||
physDev->handles = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, HANDLE_LIST_INC * sizeof(physDev->handles[0]));
|
||||
physDev->handles_size = HANDLE_LIST_INC;
|
||||
|
@ -196,7 +195,7 @@ static DC *MFDRV_AllocMetaFile(void)
|
|||
physDev->mh->mtMaxRecord = 0;
|
||||
physDev->mh->mtNoParameters = 0;
|
||||
|
||||
SetVirtualResolution(dc->hSelf, 0, 0, 0, 0);
|
||||
SetVirtualResolution( physDev->dev.hdc, 0, 0, 0, 0);
|
||||
|
||||
return dc;
|
||||
}
|
||||
|
@ -213,7 +212,7 @@ static BOOL CDECL MFDRV_DeleteDC( PHYSDEV dev )
|
|||
HeapFree( GetProcessHeap(), 0, physDev->mh );
|
||||
for(index = 0; index < physDev->handles_size; index++)
|
||||
if(physDev->handles[index])
|
||||
GDI_hdc_not_using_object(physDev->handles[index], physDev->hdc);
|
||||
GDI_hdc_not_using_object(physDev->handles[index], dev->hdc);
|
||||
HeapFree( GetProcessHeap(), 0, physDev->handles );
|
||||
HeapFree( GetProcessHeap(), 0, physDev );
|
||||
return TRUE;
|
||||
|
@ -265,8 +264,8 @@ HDC WINAPI CreateMetaFileW( LPCWSTR filename )
|
|||
else /* memory based metafile */
|
||||
physDev->mh->mtType = METAFILE_MEMORY;
|
||||
|
||||
TRACE("returning %p\n", dc->hSelf);
|
||||
ret = dc->hSelf;
|
||||
TRACE("returning %p\n", physDev->dev.hdc);
|
||||
ret = physDev->dev.hdc;
|
||||
release_dc_ptr( dc );
|
||||
return ret;
|
||||
}
|
||||
|
@ -314,7 +313,7 @@ static DC *MFDRV_CloseMetaFile( HDC hdc )
|
|||
}
|
||||
if (dc->refcount != 1)
|
||||
{
|
||||
FIXME( "not deleting busy DC %p refcount %u\n", dc->hSelf, dc->refcount );
|
||||
FIXME( "not deleting busy DC %p refcount %u\n", hdc, dc->refcount );
|
||||
release_dc_ptr( dc );
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
typedef struct
|
||||
{
|
||||
struct gdi_physdev dev;
|
||||
HDC hdc;
|
||||
METAHEADER *mh; /* Pointer to metafile header */
|
||||
UINT handles_size, cur_handles;
|
||||
HGDIOBJ *handles;
|
||||
|
|
|
@ -214,7 +214,6 @@ INT16 MFDRV_CreateBrushIndirect(PHYSDEV dev, HBRUSH hBrush )
|
|||
DWORD size;
|
||||
METARECORD *mr;
|
||||
LOGBRUSH logbrush;
|
||||
METAFILEDRV_PDEVICE *physDev = (METAFILEDRV_PDEVICE *)dev;
|
||||
BOOL r;
|
||||
|
||||
if (!GetObjectA( hBrush, sizeof(logbrush), &logbrush )) return -1;
|
||||
|
@ -282,12 +281,12 @@ INT16 MFDRV_CreateBrushIndirect(PHYSDEV dev, HBRUSH hBrush )
|
|||
MFDRV_Reverse((LPBYTE)info + sizeof(BITMAPINFO) + sizeof(RGBQUAD),
|
||||
bm.bmWidth, bm.bmHeight);
|
||||
|
||||
cref = GetTextColor(physDev->hdc);
|
||||
cref = GetTextColor( dev->hdc );
|
||||
info->bmiColors[0].rgbRed = GetRValue(cref);
|
||||
info->bmiColors[0].rgbGreen = GetGValue(cref);
|
||||
info->bmiColors[0].rgbBlue = GetBValue(cref);
|
||||
info->bmiColors[0].rgbReserved = 0;
|
||||
cref = GetBkColor(physDev->hdc);
|
||||
cref = GetBkColor( dev->hdc );
|
||||
info->bmiColors[1].rgbRed = GetRValue(cref);
|
||||
info->bmiColors[1].rgbGreen = GetGValue(cref);
|
||||
info->bmiColors[1].rgbBlue = GetBValue(cref);
|
||||
|
@ -341,7 +340,6 @@ done:
|
|||
*/
|
||||
HBRUSH CDECL MFDRV_SelectBrush( PHYSDEV dev, HBRUSH hbrush )
|
||||
{
|
||||
METAFILEDRV_PDEVICE *physDev = (METAFILEDRV_PDEVICE *)dev;
|
||||
INT16 index;
|
||||
|
||||
index = MFDRV_FindObject(dev, hbrush);
|
||||
|
@ -350,7 +348,7 @@ HBRUSH CDECL MFDRV_SelectBrush( PHYSDEV dev, HBRUSH hbrush )
|
|||
index = MFDRV_CreateBrushIndirect( dev, hbrush );
|
||||
if( index < 0 )
|
||||
return 0;
|
||||
GDI_hdc_using_object(hbrush, physDev->hdc);
|
||||
GDI_hdc_using_object(hbrush, dev->hdc);
|
||||
}
|
||||
return MFDRV_SelectObject( dev, index ) ? hbrush : HGDI_ERROR;
|
||||
}
|
||||
|
@ -398,7 +396,6 @@ static UINT16 MFDRV_CreateFontIndirect(PHYSDEV dev, HFONT hFont, LOGFONTW *logfo
|
|||
*/
|
||||
HFONT CDECL MFDRV_SelectFont( PHYSDEV dev, HFONT hfont, HANDLE gdiFont )
|
||||
{
|
||||
METAFILEDRV_PDEVICE *physDev = (METAFILEDRV_PDEVICE *)dev;
|
||||
LOGFONTW font;
|
||||
INT16 index;
|
||||
|
||||
|
@ -410,7 +407,7 @@ HFONT CDECL MFDRV_SelectFont( PHYSDEV dev, HFONT hfont, HANDLE gdiFont )
|
|||
index = MFDRV_CreateFontIndirect(dev, hfont, &font);
|
||||
if( index < 0 )
|
||||
return HGDI_ERROR;
|
||||
GDI_hdc_using_object(hfont, physDev->hdc);
|
||||
GDI_hdc_using_object(hfont, dev->hdc);
|
||||
}
|
||||
return MFDRV_SelectObject( dev, index ) ? hfont : HGDI_ERROR;
|
||||
}
|
||||
|
@ -437,7 +434,6 @@ static UINT16 MFDRV_CreatePenIndirect(PHYSDEV dev, HPEN hPen, LOGPEN16 *logpen)
|
|||
*/
|
||||
HPEN CDECL MFDRV_SelectPen( PHYSDEV dev, HPEN hpen )
|
||||
{
|
||||
METAFILEDRV_PDEVICE *physDev = (METAFILEDRV_PDEVICE *)dev;
|
||||
LOGPEN16 logpen;
|
||||
INT16 index;
|
||||
|
||||
|
@ -476,7 +472,7 @@ HPEN CDECL MFDRV_SelectPen( PHYSDEV dev, HPEN hpen )
|
|||
index = MFDRV_CreatePenIndirect( dev, hpen, &logpen );
|
||||
if( index < 0 )
|
||||
return 0;
|
||||
GDI_hdc_using_object(hpen, physDev->hdc);
|
||||
GDI_hdc_using_object(hpen, dev->hdc);
|
||||
}
|
||||
return MFDRV_SelectObject( dev, index ) ? hpen : HGDI_ERROR;
|
||||
}
|
||||
|
|
|
@ -84,8 +84,7 @@ MFDRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
|
|||
LPSTR ascii;
|
||||
DWORD len;
|
||||
CHARSETINFO csi;
|
||||
METAFILEDRV_PDEVICE *physDev = (METAFILEDRV_PDEVICE *)dev;
|
||||
int charset = GetTextCharset(physDev->hdc);
|
||||
int charset = GetTextCharset( dev->hdc );
|
||||
UINT cp = CP_ACP;
|
||||
|
||||
if(TranslateCharsetInfo(ULongToPtr(charset), &csi, TCI_SRCCHARSET))
|
||||
|
|
Loading…
Reference in New Issue