diff --git a/dlls/wineps/bitblt.c b/dlls/wineps/bitblt.c index f19f3d0a6ca..1c1d87f604c 100644 --- a/dlls/wineps/bitblt.c +++ b/dlls/wineps/bitblt.c @@ -41,10 +41,12 @@ BOOL PSDRV_PatBlt(PSDRV_PDEVICE *physDev, INT x, INT y, INT width, INT height, D switch(dwRop) { case PATCOPY: + PSDRV_SetClip(physDev); PSDRV_WriteGSave(physDev); PSDRV_WriteRectangle(physDev, pt[0].x, pt[0].y, pt[1].x - pt[0].x, pt[1].y - pt[0].y ); PSDRV_Brush(physDev, FALSE); PSDRV_WriteGRestore(physDev); + PSDRV_ResetClip(physDev); return TRUE; case BLACKNESS: @@ -52,6 +54,7 @@ BOOL PSDRV_PatBlt(PSDRV_PDEVICE *physDev, INT x, INT y, INT width, INT height, D { PSCOLOR pscol; + PSDRV_SetClip(physDev); PSDRV_WriteGSave(physDev); PSDRV_WriteRectangle(physDev, pt[0].x, pt[0].y, pt[1].x - pt[0].x, pt[1].y - pt[0].y ); PSDRV_CreateColor( physDev, &pscol, (dwRop == BLACKNESS) ? @@ -59,6 +62,7 @@ BOOL PSDRV_PatBlt(PSDRV_PDEVICE *physDev, INT x, INT y, INT width, INT height, D PSDRV_WriteSetColor(physDev, &pscol); PSDRV_WriteFill(physDev); PSDRV_WriteGRestore(physDev); + PSDRV_ResetClip(physDev); return TRUE; } default: diff --git a/dlls/wineps/bitmap.c b/dlls/wineps/bitmap.c index 0e69ff2cb8c..fa654ffb8c8 100644 --- a/dlls/wineps/bitmap.c +++ b/dlls/wineps/bitmap.c @@ -18,6 +18,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "psdrv.h" #include "winbase.h" #include "wine/debug.h" @@ -147,7 +149,57 @@ static BOOL PSDRV_WriteImageHeader(PSDRV_PDEVICE *physDev, const BITMAPINFO *inf } PSDRV_WriteImageDict(physDev, info->bmiHeader.biBitCount, xDst, yDst, - widthDst, heightDst, widthSrc, heightSrc, NULL); + widthDst, heightDst, widthSrc, heightSrc, NULL, FALSE); + return TRUE; +} + + +/*************************************************************************** + * PSDRV_WriteImageMaskHeader + * + * Helper for PSDRV_StretchDIBits + * + * We use the imagemask operator for 1bpp bitmaps since the output + * takes much less time for the printer to render. + * + * BUGS + * Uses level 2 PostScript + */ + +static BOOL PSDRV_WriteImageMaskHeader(PSDRV_PDEVICE *physDev, const BITMAPINFO *info, INT xDst, + INT yDst, INT widthDst, INT heightDst, + INT widthSrc, INT heightSrc) +{ + COLORREF map[2]; + PSCOLOR bkgnd, foregnd; + int i; + + assert(info->bmiHeader.biBitCount == 1); + + for(i = 0; i < 2; i++) { + map[i] = info->bmiColors[i].rgbRed | + info->bmiColors[i].rgbGreen << 8 | + info->bmiColors[i].rgbBlue << 16; + } + + /* We'll write the mask with -ve polarity so that + the foregnd color corresponds to a bit equal to + 0 in the bitmap. + */ + PSDRV_CreateColor(physDev, &foregnd, map[0]); + PSDRV_CreateColor(physDev, &bkgnd, map[1]); + + PSDRV_WriteGSave(physDev); + PSDRV_WriteNewPath(physDev); + PSDRV_WriteRectangle(physDev, xDst, yDst, widthDst, heightDst); + PSDRV_WriteSetColor(physDev, &bkgnd); + PSDRV_WriteFill(physDev); + PSDRV_WriteGRestore(physDev); + + PSDRV_WriteSetColor(physDev, &foregnd); + PSDRV_WriteImageDict(physDev, 1, xDst, yDst, widthDst, heightDst, + widthSrc, heightSrc, NULL, TRUE); + return TRUE; } @@ -180,8 +232,8 @@ INT PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT widthDs widthbytes = get_dib_width_bytes(fullSrcWidth, bpp); - TRACE("full size=%ldx%ld bpp=%d compression=%d\n", fullSrcWidth, - fullSrcHeight, bpp, compression); + TRACE("full size=%ldx%ld bpp=%d compression=%d rop=%08lx\n", fullSrcWidth, + fullSrcHeight, bpp, compression, dwRop); if(compression != BI_RGB) { @@ -202,9 +254,12 @@ INT PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT widthDs switch(bpp) { case 1: + PSDRV_SetClip(physDev); PSDRV_WriteGSave(physDev); - PSDRV_WriteImageHeader(physDev, info, xDst, yDst, widthDst, heightDst, - widthSrc, heightSrc); + + /* Use imagemask rather than image */ + PSDRV_WriteImageMaskHeader(physDev, info, xDst, yDst, widthDst, heightDst, + widthSrc, heightSrc); ptr = bits; ptr += (ySrc * widthbytes); if(xSrc & 7) @@ -214,6 +269,7 @@ INT PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT widthDs break; case 4: + PSDRV_SetClip(physDev); PSDRV_WriteGSave(physDev); PSDRV_WriteImageHeader(physDev, info, xDst, yDst, widthDst, heightDst, widthSrc, heightSrc); @@ -226,6 +282,7 @@ INT PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT widthDs break; case 8: + PSDRV_SetClip(physDev); PSDRV_WriteGSave(physDev); PSDRV_WriteImageHeader(physDev, info, xDst, yDst, widthDst, heightDst, widthSrc, heightSrc); @@ -237,6 +294,7 @@ INT PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT widthDs case 15: case 16: + PSDRV_SetClip(physDev); PSDRV_WriteGSave(physDev); PSDRV_WriteImageHeader(physDev, info, xDst, yDst, widthDst, heightDst, widthSrc, heightSrc); @@ -248,6 +306,7 @@ INT PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT widthDs break; case 24: + PSDRV_SetClip(physDev); PSDRV_WriteGSave(physDev); PSDRV_WriteImageHeader(physDev, info, xDst, yDst, widthDst, heightDst, widthSrc, heightSrc); @@ -259,6 +318,7 @@ INT PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT widthDs break; case 32: + PSDRV_SetClip(physDev); PSDRV_WriteGSave(physDev); PSDRV_WriteImageHeader(physDev, info, xDst, yDst, widthDst, heightDst, widthSrc, heightSrc); @@ -276,11 +336,6 @@ INT PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT widthDs } PSDRV_WriteSpool(physDev, ">\n", 2); /* End-of-Data for /HexASCIIDecodeFilter */ PSDRV_WriteGRestore(physDev); + PSDRV_ResetClip(physDev); return TRUE; } - - - - - - diff --git a/dlls/wineps/brush.c b/dlls/wineps/brush.c index eb656744abe..7f9b2515501 100644 --- a/dlls/wineps/brush.c +++ b/dlls/wineps/brush.c @@ -145,19 +145,20 @@ BOOL PSDRV_Brush(PSDRV_PDEVICE *physDev, BOOL EO) switch (logbrush.lbStyle) { case BS_SOLID: - PSDRV_SetBrush(physDev); PSDRV_WriteGSave(physDev); + PSDRV_SetBrush(physDev); PSDRV_Fill(physDev, EO); PSDRV_WriteGRestore(physDev); break; case BS_HATCHED: + PSDRV_WriteGSave(physDev); PSDRV_SetBrush(physDev); switch(logbrush.lbHatch) { case HS_VERTICAL: case HS_CROSS: - PSDRV_WriteGSave(physDev); + PSDRV_WriteGSave(physDev); PSDRV_Clip(physDev, EO); PSDRV_WriteHatch(physDev); PSDRV_WriteStroke(physDev); @@ -167,7 +168,7 @@ BOOL PSDRV_Brush(PSDRV_PDEVICE *physDev, BOOL EO) /* else fallthrough for HS_CROSS */ case HS_HORIZONTAL: - PSDRV_WriteGSave(physDev); + PSDRV_WriteGSave(physDev); PSDRV_Clip(physDev, EO); PSDRV_WriteRotate(physDev, 90.0); PSDRV_WriteHatch(physDev); @@ -201,6 +202,7 @@ BOOL PSDRV_Brush(PSDRV_PDEVICE *physDev, BOOL EO) ret = FALSE; break; } + PSDRV_WriteGRestore(physDev); break; case BS_NULL: diff --git a/dlls/wineps/clipping.c b/dlls/wineps/clipping.c index e6f46e7adca..2dfa37c650a 100644 --- a/dlls/wineps/clipping.c +++ b/dlls/wineps/clipping.c @@ -28,6 +28,23 @@ WINE_DEFAULT_DEBUG_CHANNEL(psdrv); * PSDRV_SetDeviceClipping */ VOID PSDRV_SetDeviceClipping( PSDRV_PDEVICE *physDev, HRGN ignored ) +{ + /* We could set a dirty flag here to speed up PSDRV_SetClip */ + return; +} + +/*********************************************************************** + * PSDRV_SetClip + * + * The idea here is that every graphics operation should bracket + * output in PSDRV_SetClip/ResetClip calls. The clip path outside + * these calls will be empty; the reason for this is that it is + * impossible in PostScript to cleanly make the clip path larger than + * the current one. Also Photoshop assumes that despite having set a + * small clip area in the printer dc that it can still write raw + * PostScript to the driver and expect this code not to be clipped. + */ +void PSDRV_SetClip( PSDRV_PDEVICE *physDev ) { CHAR szArrayName[] = "clippath"; DWORD size; @@ -39,9 +56,6 @@ VOID PSDRV_SetDeviceClipping( PSDRV_PDEVICE *physDev, HRGN ignored ) empty = !GetClipRgn(physDev->hdc, hrgn); - /* We really shouldn't be using initclip */ - PSDRV_WriteInitClip(physDev); - if(!empty) { size = GetRegionData(hrgn, 0, NULL); if(!size) { @@ -57,6 +71,8 @@ VOID PSDRV_SetDeviceClipping( PSDRV_PDEVICE *physDev, HRGN ignored ) GetRegionData(hrgn, size, rgndata); + PSDRV_WriteGSave(physDev); + /* check for NULL region */ if (rgndata->rdh.nCount == 0) { @@ -97,3 +113,18 @@ end: if(rgndata) HeapFree( GetProcessHeap(), 0, rgndata ); DeleteObject(hrgn); } + + +/*********************************************************************** + * PSDRV_ResetClip + */ +void PSDRV_ResetClip( PSDRV_PDEVICE *physDev ) +{ + HRGN hrgn = CreateRectRgn(0,0,0,0); + BOOL empty; + + empty = !GetClipRgn(physDev->hdc, hrgn); + if(!empty) + PSDRV_WriteGRestore(physDev); + DeleteObject(hrgn); +} diff --git a/dlls/wineps/graphics.c b/dlls/wineps/graphics.c index f9f39a59224..1bf77a48f00 100644 --- a/dlls/wineps/graphics.c +++ b/dlls/wineps/graphics.c @@ -20,6 +20,7 @@ #include "config.h" +#include #include #include #if defined(HAVE_FLOAT_H) @@ -34,6 +35,19 @@ WINE_DEFAULT_DEBUG_CHANNEL(psdrv); +/*********************************************************************** + * PSDRV_DrawLine + */ +static void PSDRV_DrawLine( PSDRV_PDEVICE *physDev ) +{ + if(physDev->pathdepth) + return; + + if (physDev->pen.style == PS_NULL) + PSDRV_WriteNewPath(physDev); + else + PSDRV_WriteStroke(physDev); +} /*********************************************************************** * PSDRV_LineTo @@ -50,9 +64,12 @@ BOOL PSDRV_LineTo(PSDRV_PDEVICE *physDev, INT x, INT y) LPtoDP( physDev->hdc, pt, 2 ); PSDRV_SetPen(physDev); + + PSDRV_SetClip(physDev); PSDRV_WriteMoveTo(physDev, pt[0].x, pt[0].y ); PSDRV_WriteLineTo(physDev, pt[1].x, pt[1].y ); PSDRV_DrawLine(physDev); + PSDRV_ResetClip(physDev); return TRUE; } @@ -73,11 +90,23 @@ BOOL PSDRV_Rectangle( PSDRV_PDEVICE *physDev, INT left, INT top, INT right, INT rect.bottom = bottom; LPtoDP( physDev->hdc, (POINT *)&rect, 2 ); + /* HACK to get inserted eps files printing from Office 2k */ + if(GetROP2(physDev->hdc) == R2_NOP) { + char buf[256]; + sprintf(buf, "%ld %ld %ld %ld B\n", rect.right - rect.left, rect.bottom - rect.top, rect.left, rect.top); + PSDRV_WriteSpool(physDev, buf, strlen(buf)); + return TRUE; + } + + PSDRV_WriteSpool(physDev, "%Rectangle\n",11); + PSDRV_SetPen(physDev); + + PSDRV_SetClip(physDev); PSDRV_WriteRectangle(physDev, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top ); PSDRV_Brush(physDev,0); - PSDRV_SetPen(physDev); PSDRV_DrawLine(physDev); + PSDRV_ResetClip(physDev); return TRUE; } @@ -112,6 +141,10 @@ BOOL PSDRV_RoundRect( PSDRV_PDEVICE *physDev, INT left, INT top, INT right, if (ell_width > right - left) ell_width = right - left; if (ell_height > bottom - top) ell_height = bottom - top; + PSDRV_WriteSpool(physDev, "%RoundRect\n",11); + PSDRV_SetPen(physDev); + + PSDRV_SetClip(physDev); PSDRV_WriteMoveTo( physDev, left, top + ell_height/2 ); PSDRV_WriteArc( physDev, left + ell_width/2, top + ell_height/2, ell_width, ell_height, 90.0, 180.0); @@ -127,8 +160,8 @@ BOOL PSDRV_RoundRect( PSDRV_PDEVICE *physDev, INT left, INT top, INT right, PSDRV_WriteClosePath( physDev ); PSDRV_Brush(physDev,0); - PSDRV_SetPen(physDev); PSDRV_DrawLine(physDev); + PSDRV_ResetClip(physDev); return TRUE; } @@ -176,6 +209,10 @@ static BOOL PSDRV_DrawArc( PSDRV_PDEVICE *physDev, INT left, INT top, start_angle *= 180.0 / PI; end_angle *= 180.0 / PI; + PSDRV_WriteSpool(physDev,"%DrawArc\n", 9); + PSDRV_SetPen(physDev); + + PSDRV_SetClip(physDev); if(lines == 2) /* pie */ PSDRV_WriteMoveTo(physDev, x, y); else @@ -186,8 +223,9 @@ static BOOL PSDRV_DrawArc( PSDRV_PDEVICE *physDev, INT left, INT top, PSDRV_WriteClosePath(physDev); PSDRV_Brush(physDev,0); } - PSDRV_SetPen(physDev); PSDRV_DrawLine(physDev); + PSDRV_ResetClip(physDev); + return TRUE; } @@ -242,12 +280,16 @@ BOOL PSDRV_Ellipse( PSDRV_PDEVICE *physDev, INT left, INT top, INT right, INT bo w = rect.right - rect.left; h = rect.bottom - rect.top; + PSDRV_WriteSpool(physDev, "%Ellipse\n", 9); + PSDRV_SetPen(physDev); + + PSDRV_SetClip(physDev); PSDRV_WriteNewPath(physDev); PSDRV_WriteArc(physDev, x, y, w, h, 0.0, 360.0); PSDRV_WriteClosePath(physDev); PSDRV_Brush(physDev,0); - PSDRV_SetPen(physDev); PSDRV_DrawLine(physDev); + PSDRV_ResetClip(physDev); return TRUE; } @@ -269,6 +311,11 @@ BOOL PSDRV_PolyPolyline( PSDRV_PDEVICE *physDev, const POINT* pts, const DWORD* LPtoDP( physDev->hdc, dev_pts, total ); pt = dev_pts; + + PSDRV_WriteSpool(physDev, "%PolyPolyline\n",14); + PSDRV_SetPen(physDev); + PSDRV_SetClip(physDev); + for(polyline = 0; polyline < polylines; polyline++) { PSDRV_WriteMoveTo(physDev, pt->x, pt->y); pt++; @@ -276,8 +323,9 @@ BOOL PSDRV_PolyPolyline( PSDRV_PDEVICE *physDev, const POINT* pts, const DWORD* PSDRV_WriteLineTo(physDev, pt->x, pt->y); } HeapFree( GetProcessHeap(), 0, dev_pts ); - PSDRV_SetPen(physDev); + PSDRV_DrawLine(physDev); + PSDRV_ResetClip(physDev); return TRUE; } @@ -308,6 +356,11 @@ BOOL PSDRV_PolyPolygon( PSDRV_PDEVICE *physDev, const POINT* pts, const INT* cou LPtoDP( physDev->hdc, dev_pts, total ); pt = dev_pts; + + PSDRV_WriteSpool(physDev, "%PolyPolygon\n",13); + PSDRV_SetPen(physDev); + PSDRV_SetClip(physDev); + for(polygon = 0; polygon < polygons; polygon++) { PSDRV_WriteMoveTo(physDev, pt->x, pt->y); pt++; @@ -321,8 +374,9 @@ BOOL PSDRV_PolyPolygon( PSDRV_PDEVICE *physDev, const POINT* pts, const INT* cou PSDRV_Brush(physDev, 1); else /* WINDING */ PSDRV_Brush(physDev, 0); - PSDRV_SetPen(physDev); + PSDRV_DrawLine(physDev); + PSDRV_ResetClip(physDev); return TRUE; } @@ -348,24 +402,15 @@ COLORREF PSDRV_SetPixel( PSDRV_PDEVICE *physDev, INT x, INT y, COLORREF color ) pt.y = y; LPtoDP( physDev->hdc, &pt, 1 ); + PSDRV_SetClip(physDev); + /* we bracket the setcolor in gsave/grestore so that we don't trash + the current pen colour */ + PSDRV_WriteGSave(physDev); PSDRV_WriteRectangle( physDev, pt.x, pt.y, 0, 0 ); PSDRV_CreateColor( physDev, &pscolor, color ); PSDRV_WriteSetColor( physDev, &pscolor ); PSDRV_WriteFill( physDev ); + PSDRV_WriteGRestore(physDev); + PSDRV_ResetClip(physDev); return color; } - - -/*********************************************************************** - * PSDRV_DrawLine - */ -VOID PSDRV_DrawLine( PSDRV_PDEVICE *physDev ) -{ - if(physDev->pathdepth) - return; - - if (physDev->pen.style == PS_NULL) - PSDRV_WriteNewPath(physDev); - else - PSDRV_WriteStroke(physDev); -} diff --git a/dlls/wineps/ps.c b/dlls/wineps/ps.c index 08d503624e2..b0fd400a42f 100644 --- a/dlls/wineps/ps.c +++ b/dlls/wineps/ps.c @@ -603,7 +603,7 @@ BOOL PSDRV_WriteRGB(PSDRV_PDEVICE *physDev, COLORREF *map, int number) BOOL PSDRV_WriteImageDict(PSDRV_PDEVICE *physDev, WORD depth, INT xDst, INT yDst, INT widthDst, INT heightDst, INT widthSrc, - INT heightSrc, char *bits) + INT heightSrc, char *bits, BOOL mask) { char start[] = "%d %d translate\n%d %d scale\n<<\n" " /ImageType 1\n /Width %d\n /Height %d\n /BitsPerComponent %d\n" @@ -613,6 +613,8 @@ BOOL PSDRV_WriteImageDict(PSDRV_PDEVICE *physDev, WORD depth, INT xDst, INT yDst char decode3[] = " /Decode [0 1 0 1 0 1]\n"; char end[] = " /DataSource currentfile /ASCIIHexDecode filter\n>> image\n"; + char endmask[] = " /DataSource currentfile /ASCIIHexDecode filter\n>> imagemask\n"; + char endbits[] = " /DataSource <%s>\n>> image\n"; char *buf = HeapAlloc(PSDRV_Heap, 0, 1000); @@ -642,9 +644,12 @@ BOOL PSDRV_WriteImageDict(PSDRV_PDEVICE *physDev, WORD depth, INT xDst, INT yDst PSDRV_WriteSpool(physDev, buf, strlen(buf)); - if(!bits) - PSDRV_WriteSpool(physDev, end, sizeof(end) - 1); - else { + if(!bits) { + if(!mask) + PSDRV_WriteSpool(physDev, end, sizeof(end) - 1); + else + PSDRV_WriteSpool(physDev, endmask, sizeof(endmask) - 1); + } else { sprintf(buf, endbits, bits); PSDRV_WriteSpool(physDev, buf, strlen(buf)); } @@ -810,7 +815,7 @@ BOOL PSDRV_WritePatternDict(PSDRV_PDEVICE *physDev, BITMAP *bm, BYTE *bits) ptr += 2; } } - PSDRV_WriteImageDict(physDev, 1, 0, 0, 8, 8, 8, 8, buf); + PSDRV_WriteImageDict(physDev, 1, 0, 0, 8, 8, 8, 8, buf, FALSE); PSDRV_WriteSpool(physDev, end, sizeof(end) - 1); HeapFree(PSDRV_Heap, 0, buf); return TRUE; @@ -858,7 +863,7 @@ BOOL PSDRV_WriteDIBPatternDict(PSDRV_PDEVICE *physDev, BITMAPINFO *bmi, UINT usa ptr += 2; } } - PSDRV_WriteImageDict(physDev, 1, 0, 0, 8, 8, 8, 8, buf); + PSDRV_WriteImageDict(physDev, 1, 0, 0, 8, 8, 8, 8, buf, FALSE); PSDRV_WriteSpool(physDev, end, sizeof(end) - 1); HeapFree(PSDRV_Heap, 0, buf); return TRUE; diff --git a/dlls/wineps/psdrv.h b/dlls/wineps/psdrv.h index 4fcc245ecee..adfb6d49091 100644 --- a/dlls/wineps/psdrv.h +++ b/dlls/wineps/psdrv.h @@ -384,6 +384,9 @@ extern BOOL PSDRV_Brush(PSDRV_PDEVICE *physDev, BOOL EO); extern BOOL PSDRV_SetFont( PSDRV_PDEVICE *physDev ); extern BOOL PSDRV_SetPen( PSDRV_PDEVICE *physDev ); +extern void PSDRV_SetClip(PSDRV_PDEVICE* phyDev); +extern void PSDRV_ResetClip(PSDRV_PDEVICE* phyDev); + extern BOOL PSDRV_CmpColor(PSCOLOR *col1, PSCOLOR *col2); extern BOOL PSDRV_CopyColor(PSCOLOR *col1, PSCOLOR *col2); extern void PSDRV_CreateColor( PSDRV_PDEVICE *physDev, PSCOLOR *pscolor, @@ -427,7 +430,7 @@ extern BOOL PSDRV_WriteIndexColorSpaceEnd(PSDRV_PDEVICE *physDev); extern BOOL PSDRV_WriteRGB(PSDRV_PDEVICE *physDev, COLORREF *map, int number); extern BOOL PSDRV_WriteImageDict(PSDRV_PDEVICE *physDev, WORD depth, INT xDst, INT yDst, INT widthDst, INT heightDst, INT widthSrc, - INT heightSrc, char *bits); + INT heightSrc, char *bits, BOOL mask); extern BOOL PSDRV_WriteBytes(PSDRV_PDEVICE *physDev, const BYTE *bytes, int number); extern BOOL PSDRV_WriteDIBits16(PSDRV_PDEVICE *physDev, const WORD *words, int number); extern BOOL PSDRV_WriteDIBits24(PSDRV_PDEVICE *physDev, const BYTE *bits, int number); @@ -491,8 +494,7 @@ extern INT PSDRV_ExtDeviceMode(LPSTR lpszDriver, HWND hwnd, extern DWORD PSDRV_DeviceCapabilities(LPSTR lpszDriver, LPCSTR lpszDevice, LPCSTR lpszPort, WORD fwCapability, LPSTR lpszOutput, - LPDEVMODEA lpDevMode); -VOID PSDRV_DrawLine( PSDRV_PDEVICE *physDev ); + LPDEVMODEA lpdm); INT PSDRV_GlyphListInit(void); const GLYPHNAME *PSDRV_GlyphName(LPCSTR szName); VOID PSDRV_IndexGlyphList(void); diff --git a/dlls/wineps/text.c b/dlls/wineps/text.c index de639a99275..c85b105558b 100644 --- a/dlls/wineps/text.c +++ b/dlls/wineps/text.c @@ -47,6 +47,8 @@ BOOL PSDRV_ExtTextOut( PSDRV_PDEVICE *physDev, INT x, INT y, UINT flags, /* write font if not already written */ PSDRV_SetFont(physDev); + PSDRV_SetClip(physDev); + /* set clipping and/or draw background */ if ((flags & (ETO_CLIPPED | ETO_OPAQUE)) && (lprect != NULL)) { @@ -79,6 +81,7 @@ BOOL PSDRV_ExtTextOut( PSDRV_PDEVICE *physDev, INT x, INT y, UINT flags, bResult = PSDRV_Text(physDev, x, y, flags, str, count, TRUE, lpDx); } + PSDRV_ResetClip(physDev); return bResult; }