diff --git a/dlls/wineps/graphics.c b/dlls/wineps/graphics.c index 1bf77a48f00..f8222c27d8c 100644 --- a/dlls/wineps/graphics.c +++ b/dlls/wineps/graphics.c @@ -98,7 +98,6 @@ BOOL PSDRV_Rectangle( PSDRV_PDEVICE *physDev, INT left, INT top, INT right, INT return TRUE; } - PSDRV_WriteSpool(physDev, "%Rectangle\n",11); PSDRV_SetPen(physDev); PSDRV_SetClip(physDev); @@ -414,3 +413,41 @@ COLORREF PSDRV_SetPixel( PSDRV_PDEVICE *physDev, INT x, INT y, COLORREF color ) PSDRV_ResetClip(physDev); return color; } + +/*********************************************************************** + * PSDRV_PaintRgn + */ +BOOL PSDRV_PaintRgn( PSDRV_PDEVICE *physDev, HRGN hrgn ) +{ + + RGNDATA *rgndata = NULL; + RECT *pRect; + DWORD size, i; + + TRACE("hdc=%p\n", physDev->hdc); + + size = GetRegionData(hrgn, 0, NULL); + rgndata = HeapAlloc( GetProcessHeap(), 0, size ); + if(!rgndata) { + ERR("Can't allocate buffer\n"); + return FALSE; + } + + GetRegionData(hrgn, size, rgndata); + if (rgndata->rdh.nCount == 0) + goto end; + + LPtoDP(physDev->hdc, (POINT*)rgndata->Buffer, rgndata->rdh.nCount * 2); + + PSDRV_SetClip(physDev); + PSDRV_WriteNewPath(physDev); + for(i = 0, pRect = (RECT*)rgndata->Buffer; i < rgndata->rdh.nCount; i++, pRect++) + PSDRV_WriteRectangle(physDev, pRect->left, pRect->top, pRect->right - pRect->left, pRect->bottom - pRect->top); + + PSDRV_Brush(physDev, 0); + PSDRV_ResetClip(physDev); + + end: + HeapFree(GetProcessHeap(), 0, rgndata); + return TRUE; +} diff --git a/dlls/wineps/wineps.spec b/dlls/wineps/wineps.spec index 37743698244..494e3af161b 100644 --- a/dlls/wineps/wineps.spec +++ b/dlls/wineps/wineps.spec @@ -17,6 +17,7 @@ @ cdecl GetTextExtentPoint(ptr ptr long ptr) PSDRV_GetTextExtentPoint @ cdecl GetTextMetrics(ptr ptr) PSDRV_GetTextMetrics @ cdecl LineTo(ptr long long) PSDRV_LineTo +@ cdecl PaintRgn(ptr long) PSDRV_PaintRgn @ cdecl PatBlt(ptr long long long long long) PSDRV_PatBlt @ cdecl Pie(ptr long long long long long long long long) PSDRV_Pie @ cdecl PolyPolygon(ptr ptr ptr long) PSDRV_PolyPolygon