diff --git a/reactos/subsys/win32k/eng/lineto.c b/reactos/subsys/win32k/eng/lineto.c index dd473ec49ef..27785358a2d 100644 --- a/reactos/subsys/win32k/eng/lineto.c +++ b/reactos/subsys/win32k/eng/lineto.c @@ -488,7 +488,7 @@ IntEngLineTo(BITMAPOBJ *DestObj, LONG x2, LONG y2, RECTL *RectBounds, - MIX mix) + MIX Mix) { BOOLEAN ret; SURFOBJ *DestSurf; @@ -524,7 +524,7 @@ IntEngLineTo(BITMAPOBJ *DestObj, { /* Call the driver's DrvLineTo */ ret = GDIDEVFUNCS(DestSurf).LineTo( - DestSurf, Clip, Brush, x1, y1, x2, y2, /*RectBounds*/&b, mix); + DestSurf, Clip, Brush, x1, y1, x2, y2, /*RectBounds*/&b, Mix); } #if 0 @@ -536,7 +536,7 @@ IntEngLineTo(BITMAPOBJ *DestObj, if (! ret) { - ret = EngLineTo(DestSurf, Clip, Brush, x1, y1, x2, y2, RectBounds, mix); + ret = EngLineTo(DestSurf, Clip, Brush, x1, y1, x2, y2, RectBounds, Mix); } MouseSafetyOnDrawEnd(DestSurf); @@ -550,7 +550,7 @@ IntEngPolyline(BITMAPOBJ *DestObj, BRUSHOBJ *Brush, CONST LPPOINT pt, LONG dCount, - MIX mix) + MIX Mix) { LONG i; RECTL rect; @@ -571,7 +571,7 @@ IntEngPolyline(BITMAPOBJ *DestObj, pt[i].x, pt[i].y, &rect, - mix); + Mix); if (!ret) { break; diff --git a/reactos/subsys/win32k/include/inteng.h b/reactos/subsys/win32k/include/inteng.h index 7d7bd75ffc4..63e31a7ce4c 100644 --- a/reactos/subsys/win32k/include/inteng.h +++ b/reactos/subsys/win32k/include/inteng.h @@ -32,7 +32,7 @@ VOID FASTCALL IntEngCleanupDriverObjs(struct _EPROCESS *Process, PW32PROCESS Win32Process); - +#define ROP2_TO_MIX(Rop2) (((Rop2) << 8) | (Rop2)) BOOL STDCALL IntEngLineTo(BITMAPOBJ *Surface, CLIPOBJ *Clip, diff --git a/reactos/subsys/win32k/objects/dc.c b/reactos/subsys/win32k/objects/dc.c index 65c9cd3e170..ad19cee6efd 100644 --- a/reactos/subsys/win32k/objects/dc.c +++ b/reactos/subsys/win32k/objects/dc.c @@ -212,6 +212,7 @@ NtGdiCreateCompatableDC(HDC hDC) NewDC->w.textAlign = OrigDC->w.textAlign; NewDC->w.backgroundColor = OrigDC->w.backgroundColor; NewDC->w.backgroundMode = OrigDC->w.backgroundMode; + NewDC->w.ROPmode = OrigDC->w.ROPmode; DC_UnlockDc( hDC ); if (NULL != DisplayDC) { @@ -774,8 +775,8 @@ IntGdiCreateDC(PUNICODE_STRING Driver, NewDC->DMW.dmDisplayFrequency = 0; NewDC->w.bitsPerPixel = NewDC->DMW.dmBitsPerPel; // FIXME: set this here?? - NewDC->w.hPalette = NewDC->DevInfo->hpalDefault; + NewDC->w.ROPmode = R2_COPYPEN; DPRINT("Bits per pel: %u\n", NewDC->w.bitsPerPixel); diff --git a/reactos/subsys/win32k/objects/fillshap.c b/reactos/subsys/win32k/objects/fillshap.c index 7f0bd87dff9..3c9ef6e7e35 100644 --- a/reactos/subsys/win32k/objects/fillshap.c +++ b/reactos/subsys/win32k/objects/fillshap.c @@ -28,7 +28,7 @@ &BrushInst.BrushObject, \ x, y, (x)+1, y, \ &RectBounds, \ - dc->w.ROPmode); + ROP2_TO_MIX(dc->w.ROPmode)); #define PUTLINE(x1,y1,x2,y2,BrushInst) \ ret = ret && IntEngLineTo(BitmapObj, \ @@ -36,7 +36,7 @@ &BrushInst.BrushObject, \ x1, y1, x2, y2, \ &RectBounds, \ - dc->w.ROPmode); + ROP2_TO_MIX(dc->w.ROPmode)); BOOL FASTCALL IntGdiPolygon(PDC dc, @@ -93,7 +93,7 @@ IntGdiPolygon(PDC dc, if (!(FillBrushObj->flAttrs & GDIBRUSH_IS_NULL)) { IntGdiInitBrushInstance(&FillBrushInst, FillBrushObj, dc->XlateBrush); - ret = FillPolygon ( dc, BitmapObj, &FillBrushInst.BrushObject, dc->w.ROPmode, UnsafePoints, Count, DestRect ); + ret = FillPolygon ( dc, BitmapObj, &FillBrushInst.BrushObject, ROP2_TO_MIX(dc->w.ROPmode), UnsafePoints, Count, DestRect ); } BRUSHOBJ_UnlockBrush(dc->w.hBrush); @@ -128,7 +128,7 @@ IntGdiPolygon(PDC dc, To.x, To.y, &DestRect, - dc->w.ROPmode); /* MIX */ + ROP2_TO_MIX(dc->w.ROPmode)); /* MIX */ } } PENOBJ_UnlockPen( dc->w.hPen ); @@ -939,6 +939,7 @@ IntRectangle(PDC dc, GDIBRUSHINST PenBrushInst, FillBrushInst; BOOL ret = FALSE; // default to failure RECTL DestRect; + MIX Mix; ASSERT ( dc ); // caller's responsibility to set this up /* FIXME - BitmapObj can be NULL!!! Don't assert but handle this case gracefully! */ @@ -1001,33 +1002,34 @@ IntRectangle(PDC dc, if (!(PenBrushObj->flAttrs & GDIBRUSH_IS_NULL)) { + Mix = ROP2_TO_MIX(dc->w.ROPmode); ret = ret && IntEngLineTo(BitmapObj, dc->CombinedClip, &PenBrushInst.BrushObject, LeftRect, TopRect, RightRect, TopRect, &DestRect, // Bounding rectangle - dc->w.ROPmode); // MIX + Mix); ret = ret && IntEngLineTo(BitmapObj, dc->CombinedClip, &PenBrushInst.BrushObject, RightRect, TopRect, RightRect, BottomRect, &DestRect, // Bounding rectangle - dc->w.ROPmode); // MIX + Mix); ret = ret && IntEngLineTo(BitmapObj, dc->CombinedClip, &PenBrushInst.BrushObject, RightRect, BottomRect, LeftRect, BottomRect, &DestRect, // Bounding rectangle - dc->w.ROPmode); // MIX + Mix); ret = ret && IntEngLineTo(BitmapObj, dc->CombinedClip, &PenBrushInst.BrushObject, LeftRect, BottomRect, LeftRect, TopRect, &DestRect, // Bounding rectangle - dc->w.ROPmode); // MIX */ + Mix); } PENOBJ_UnlockPen(dc->w.hPen); diff --git a/reactos/subsys/win32k/objects/line.c b/reactos/subsys/win32k/objects/line.c index 05b71b734ff..866e04ff0cb 100644 --- a/reactos/subsys/win32k/objects/line.c +++ b/reactos/subsys/win32k/objects/line.c @@ -110,7 +110,7 @@ IntGdiLineTo(DC *dc, Points[0].x, Points[0].y, Points[1].x, Points[1].y, &Bounds, - dc->w.ROPmode); + ROP2_TO_MIX(dc->w.ROPmode)); } BITMAPOBJ_UnlockBitmap ( dc->w.hBitmap ); @@ -228,7 +228,7 @@ IntGdiPolyline(DC *dc, IntGdiInitBrushInstance(&PenBrushInst, PenBrushObj, dc->XlatePen); Ret = IntEngPolyline(BitmapObj, dc->CombinedClip, &PenBrushInst.BrushObject, Points, Count, - dc->w.ROPmode); + ROP2_TO_MIX(dc->w.ROPmode)); BITMAPOBJ_UnlockBitmap(dc->w.hBitmap); EngFreeMem(Points);