Skip to content
Snippets Groups Projects
Commit 22ae3bd1 authored by Huw D. M. Davies's avatar Huw D. M. Davies Committed by Alexandre Julliard
Browse files

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

parent 4aa2c81d
No related branches found
No related tags found
No related merge requests found
......@@ -27,67 +27,73 @@ WINE_DEFAULT_DEBUG_CHANNEL(psdrv);
/***********************************************************************
* PSDRV_SetDeviceClipping
*/
VOID PSDRV_SetDeviceClipping( PSDRV_PDEVICE *physDev, HRGN hrgn )
VOID PSDRV_SetDeviceClipping( PSDRV_PDEVICE *physDev, HRGN ignored )
{
CHAR szArrayName[] = "clippath";
DWORD size;
RGNDATA *rgndata;
RGNDATA *rgndata = NULL;
HRGN hrgn = CreateRectRgn(0,0,0,0);
BOOL empty;
TRACE("hdc=%04x\n", physDev->hdc);
size = GetRegionData(hrgn, 0, NULL);
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);
empty = !GetClipRgn(physDev->hdc, hrgn);
/* We really shouldn't be using initclip */
PSDRV_WriteInitClip(physDev);
/* check for NULL region */
if (rgndata->rdh.nCount == 0)
{
/* set an empty clip path. */
PSDRV_WriteRectClip(physDev, 0, 0, 0, 0);
}
/* optimize when it is a simple region */
else if (rgndata->rdh.nCount == 1)
{
RECT *pRect = (RECT *)rgndata->Buffer;
if(!empty) {
size = GetRegionData(hrgn, 0, NULL);
if(!size) {
ERR("Invalid region\n");
goto end;
}
PSDRV_WriteRectClip(physDev, pRect->left, pRect->top,
pRect->right - pRect->left,
pRect->bottom - pRect->top);
}
else
{
INT i;
RECT *pRect = (RECT *)rgndata->Buffer;
rgndata = HeapAlloc( GetProcessHeap(), 0, size );
if(!rgndata) {
ERR("Can't allocate buffer\n");
goto end;
}
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,
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,
/* set an empty clip path. */
PSDRV_WriteRectClip(physDev, 0, 0, 0, 0);
}
/* 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,
pRect->right - pRect->left,
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 );
return;
for (i = 0; i < rgndata->rdh.nCount; i++, pRect++)
{
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);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment