Commit 22ae3bd1 authored by Huw D M Davies's avatar Huw D M Davies Committed by Alexandre Julliard

psdrv doesn't care about hGCClipRgn, just use GetClipRgn instead.

parent 4aa2c81d
...@@ -27,67 +27,73 @@ WINE_DEFAULT_DEBUG_CHANNEL(psdrv); ...@@ -27,67 +27,73 @@ WINE_DEFAULT_DEBUG_CHANNEL(psdrv);
/*********************************************************************** /***********************************************************************
* PSDRV_SetDeviceClipping * PSDRV_SetDeviceClipping
*/ */
VOID PSDRV_SetDeviceClipping( PSDRV_PDEVICE *physDev, HRGN hrgn ) VOID PSDRV_SetDeviceClipping( PSDRV_PDEVICE *physDev, HRGN ignored )
{ {
CHAR szArrayName[] = "clippath"; CHAR szArrayName[] = "clippath";
DWORD size; DWORD size;
RGNDATA *rgndata; RGNDATA *rgndata = NULL;
HRGN hrgn = CreateRectRgn(0,0,0,0);
BOOL empty;
TRACE("hdc=%04x\n", physDev->hdc); TRACE("hdc=%04x\n", physDev->hdc);
size = GetRegionData(hrgn, 0, NULL); empty = !GetClipRgn(physDev->hdc, hrgn);
if(!size) {
ERR("Invalid region\n");
return;
}
rgndata = HeapAlloc( GetProcessHeap(), 0, size );
if(!rgndata) {
ERR("Can't allocate buffer\n");
return;
}
GetRegionData(hrgn, size, rgndata);
/* We really shouldn't be using initclip */
PSDRV_WriteInitClip(physDev); PSDRV_WriteInitClip(physDev);
/* check for NULL region */ if(!empty) {
if (rgndata->rdh.nCount == 0) size = GetRegionData(hrgn, 0, NULL);
{ if(!size) {
/* set an empty clip path. */ ERR("Invalid region\n");
PSDRV_WriteRectClip(physDev, 0, 0, 0, 0); goto end;
} }
/* optimize when it is a simple region */
else if (rgndata->rdh.nCount == 1)
{
RECT *pRect = (RECT *)rgndata->Buffer;
PSDRV_WriteRectClip(physDev, pRect->left, pRect->top, rgndata = HeapAlloc( GetProcessHeap(), 0, size );
pRect->right - pRect->left, if(!rgndata) {
pRect->bottom - pRect->top); ERR("Can't allocate buffer\n");
} goto end;
else }
{
INT i;
RECT *pRect = (RECT *)rgndata->Buffer;
PSDRV_WriteArrayDef(physDev, szArrayName, rgndata->rdh.nCount * 4); GetRegionData(hrgn, size, rgndata);
for (i = 0; i < rgndata->rdh.nCount; i++, pRect++) /* check for NULL region */
if (rgndata->rdh.nCount == 0)
{ {
PSDRV_WriteArrayPut(physDev, szArrayName, i * 4, /* set an empty clip path. */
pRect->left); PSDRV_WriteRectClip(physDev, 0, 0, 0, 0);
PSDRV_WriteArrayPut(physDev, szArrayName, i * 4 + 1, }
pRect->top); /* optimize when it is a simple region */
PSDRV_WriteArrayPut(physDev, szArrayName, i * 4 + 2, else if (rgndata->rdh.nCount == 1)
pRect->right - pRect->left); {
PSDRV_WriteArrayPut(physDev, szArrayName, i * 4 + 3, RECT *pRect = (RECT *)rgndata->Buffer;
PSDRV_WriteRectClip(physDev, pRect->left, pRect->top,
pRect->right - pRect->left,
pRect->bottom - pRect->top); pRect->bottom - pRect->top);
} }
else
{
INT i;
RECT *pRect = (RECT *)rgndata->Buffer;
PSDRV_WriteRectClip2(physDev, szArrayName); PSDRV_WriteArrayDef(physDev, szArrayName, rgndata->rdh.nCount * 4);
}
HeapFree( GetProcessHeap(), 0, rgndata ); for (i = 0; i < rgndata->rdh.nCount; i++, pRect++)
return; {
PSDRV_WriteArrayPut(physDev, szArrayName, i * 4,
pRect->left);
PSDRV_WriteArrayPut(physDev, szArrayName, i * 4 + 1,
pRect->top);
PSDRV_WriteArrayPut(physDev, szArrayName, i * 4 + 2,
pRect->right - pRect->left);
PSDRV_WriteArrayPut(physDev, szArrayName, i * 4 + 3,
pRect->bottom - pRect->top);
}
PSDRV_WriteRectClip2(physDev, szArrayName);
}
}
end:
if(rgndata) HeapFree( GetProcessHeap(), 0, rgndata );
DeleteObject(hrgn);
} }
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