mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 02:25:17 +00:00
Convert ROP2 to MIX when calling driver
svn path=/trunk/; revision=13420
This commit is contained in:
parent
a1c0a3b1d6
commit
7cd9c86676
5 changed files with 20 additions and 17 deletions
|
@ -488,7 +488,7 @@ IntEngLineTo(BITMAPOBJ *DestObj,
|
||||||
LONG x2,
|
LONG x2,
|
||||||
LONG y2,
|
LONG y2,
|
||||||
RECTL *RectBounds,
|
RECTL *RectBounds,
|
||||||
MIX mix)
|
MIX Mix)
|
||||||
{
|
{
|
||||||
BOOLEAN ret;
|
BOOLEAN ret;
|
||||||
SURFOBJ *DestSurf;
|
SURFOBJ *DestSurf;
|
||||||
|
@ -524,7 +524,7 @@ IntEngLineTo(BITMAPOBJ *DestObj,
|
||||||
{
|
{
|
||||||
/* Call the driver's DrvLineTo */
|
/* Call the driver's DrvLineTo */
|
||||||
ret = GDIDEVFUNCS(DestSurf).LineTo(
|
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
|
#if 0
|
||||||
|
@ -536,7 +536,7 @@ IntEngLineTo(BITMAPOBJ *DestObj,
|
||||||
|
|
||||||
if (! ret)
|
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);
|
MouseSafetyOnDrawEnd(DestSurf);
|
||||||
|
@ -550,7 +550,7 @@ IntEngPolyline(BITMAPOBJ *DestObj,
|
||||||
BRUSHOBJ *Brush,
|
BRUSHOBJ *Brush,
|
||||||
CONST LPPOINT pt,
|
CONST LPPOINT pt,
|
||||||
LONG dCount,
|
LONG dCount,
|
||||||
MIX mix)
|
MIX Mix)
|
||||||
{
|
{
|
||||||
LONG i;
|
LONG i;
|
||||||
RECTL rect;
|
RECTL rect;
|
||||||
|
@ -571,7 +571,7 @@ IntEngPolyline(BITMAPOBJ *DestObj,
|
||||||
pt[i].x,
|
pt[i].x,
|
||||||
pt[i].y,
|
pt[i].y,
|
||||||
&rect,
|
&rect,
|
||||||
mix);
|
Mix);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -32,7 +32,7 @@ VOID FASTCALL
|
||||||
IntEngCleanupDriverObjs(struct _EPROCESS *Process,
|
IntEngCleanupDriverObjs(struct _EPROCESS *Process,
|
||||||
PW32PROCESS Win32Process);
|
PW32PROCESS Win32Process);
|
||||||
|
|
||||||
|
#define ROP2_TO_MIX(Rop2) (((Rop2) << 8) | (Rop2))
|
||||||
BOOL STDCALL
|
BOOL STDCALL
|
||||||
IntEngLineTo(BITMAPOBJ *Surface,
|
IntEngLineTo(BITMAPOBJ *Surface,
|
||||||
CLIPOBJ *Clip,
|
CLIPOBJ *Clip,
|
||||||
|
|
|
@ -212,6 +212,7 @@ NtGdiCreateCompatableDC(HDC hDC)
|
||||||
NewDC->w.textAlign = OrigDC->w.textAlign;
|
NewDC->w.textAlign = OrigDC->w.textAlign;
|
||||||
NewDC->w.backgroundColor = OrigDC->w.backgroundColor;
|
NewDC->w.backgroundColor = OrigDC->w.backgroundColor;
|
||||||
NewDC->w.backgroundMode = OrigDC->w.backgroundMode;
|
NewDC->w.backgroundMode = OrigDC->w.backgroundMode;
|
||||||
|
NewDC->w.ROPmode = OrigDC->w.ROPmode;
|
||||||
DC_UnlockDc( hDC );
|
DC_UnlockDc( hDC );
|
||||||
if (NULL != DisplayDC)
|
if (NULL != DisplayDC)
|
||||||
{
|
{
|
||||||
|
@ -774,8 +775,8 @@ IntGdiCreateDC(PUNICODE_STRING Driver,
|
||||||
NewDC->DMW.dmDisplayFrequency = 0;
|
NewDC->DMW.dmDisplayFrequency = 0;
|
||||||
|
|
||||||
NewDC->w.bitsPerPixel = NewDC->DMW.dmBitsPerPel; // FIXME: set this here??
|
NewDC->w.bitsPerPixel = NewDC->DMW.dmBitsPerPel; // FIXME: set this here??
|
||||||
|
|
||||||
NewDC->w.hPalette = NewDC->DevInfo->hpalDefault;
|
NewDC->w.hPalette = NewDC->DevInfo->hpalDefault;
|
||||||
|
NewDC->w.ROPmode = R2_COPYPEN;
|
||||||
|
|
||||||
DPRINT("Bits per pel: %u\n", NewDC->w.bitsPerPixel);
|
DPRINT("Bits per pel: %u\n", NewDC->w.bitsPerPixel);
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
&BrushInst.BrushObject, \
|
&BrushInst.BrushObject, \
|
||||||
x, y, (x)+1, y, \
|
x, y, (x)+1, y, \
|
||||||
&RectBounds, \
|
&RectBounds, \
|
||||||
dc->w.ROPmode);
|
ROP2_TO_MIX(dc->w.ROPmode));
|
||||||
|
|
||||||
#define PUTLINE(x1,y1,x2,y2,BrushInst) \
|
#define PUTLINE(x1,y1,x2,y2,BrushInst) \
|
||||||
ret = ret && IntEngLineTo(BitmapObj, \
|
ret = ret && IntEngLineTo(BitmapObj, \
|
||||||
|
@ -36,7 +36,7 @@
|
||||||
&BrushInst.BrushObject, \
|
&BrushInst.BrushObject, \
|
||||||
x1, y1, x2, y2, \
|
x1, y1, x2, y2, \
|
||||||
&RectBounds, \
|
&RectBounds, \
|
||||||
dc->w.ROPmode);
|
ROP2_TO_MIX(dc->w.ROPmode));
|
||||||
|
|
||||||
BOOL FASTCALL
|
BOOL FASTCALL
|
||||||
IntGdiPolygon(PDC dc,
|
IntGdiPolygon(PDC dc,
|
||||||
|
@ -93,7 +93,7 @@ IntGdiPolygon(PDC dc,
|
||||||
if (!(FillBrushObj->flAttrs & GDIBRUSH_IS_NULL))
|
if (!(FillBrushObj->flAttrs & GDIBRUSH_IS_NULL))
|
||||||
{
|
{
|
||||||
IntGdiInitBrushInstance(&FillBrushInst, FillBrushObj, dc->XlateBrush);
|
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);
|
BRUSHOBJ_UnlockBrush(dc->w.hBrush);
|
||||||
|
|
||||||
|
@ -128,7 +128,7 @@ IntGdiPolygon(PDC dc,
|
||||||
To.x,
|
To.x,
|
||||||
To.y,
|
To.y,
|
||||||
&DestRect,
|
&DestRect,
|
||||||
dc->w.ROPmode); /* MIX */
|
ROP2_TO_MIX(dc->w.ROPmode)); /* MIX */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PENOBJ_UnlockPen( dc->w.hPen );
|
PENOBJ_UnlockPen( dc->w.hPen );
|
||||||
|
@ -939,6 +939,7 @@ IntRectangle(PDC dc,
|
||||||
GDIBRUSHINST PenBrushInst, FillBrushInst;
|
GDIBRUSHINST PenBrushInst, FillBrushInst;
|
||||||
BOOL ret = FALSE; // default to failure
|
BOOL ret = FALSE; // default to failure
|
||||||
RECTL DestRect;
|
RECTL DestRect;
|
||||||
|
MIX Mix;
|
||||||
|
|
||||||
ASSERT ( dc ); // caller's responsibility to set this up
|
ASSERT ( dc ); // caller's responsibility to set this up
|
||||||
/* FIXME - BitmapObj can be NULL!!! Don't assert but handle this case gracefully! */
|
/* 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))
|
if (!(PenBrushObj->flAttrs & GDIBRUSH_IS_NULL))
|
||||||
{
|
{
|
||||||
|
Mix = ROP2_TO_MIX(dc->w.ROPmode);
|
||||||
ret = ret && IntEngLineTo(BitmapObj,
|
ret = ret && IntEngLineTo(BitmapObj,
|
||||||
dc->CombinedClip,
|
dc->CombinedClip,
|
||||||
&PenBrushInst.BrushObject,
|
&PenBrushInst.BrushObject,
|
||||||
LeftRect, TopRect, RightRect, TopRect,
|
LeftRect, TopRect, RightRect, TopRect,
|
||||||
&DestRect, // Bounding rectangle
|
&DestRect, // Bounding rectangle
|
||||||
dc->w.ROPmode); // MIX
|
Mix);
|
||||||
|
|
||||||
ret = ret && IntEngLineTo(BitmapObj,
|
ret = ret && IntEngLineTo(BitmapObj,
|
||||||
dc->CombinedClip,
|
dc->CombinedClip,
|
||||||
&PenBrushInst.BrushObject,
|
&PenBrushInst.BrushObject,
|
||||||
RightRect, TopRect, RightRect, BottomRect,
|
RightRect, TopRect, RightRect, BottomRect,
|
||||||
&DestRect, // Bounding rectangle
|
&DestRect, // Bounding rectangle
|
||||||
dc->w.ROPmode); // MIX
|
Mix);
|
||||||
|
|
||||||
ret = ret && IntEngLineTo(BitmapObj,
|
ret = ret && IntEngLineTo(BitmapObj,
|
||||||
dc->CombinedClip,
|
dc->CombinedClip,
|
||||||
&PenBrushInst.BrushObject,
|
&PenBrushInst.BrushObject,
|
||||||
RightRect, BottomRect, LeftRect, BottomRect,
|
RightRect, BottomRect, LeftRect, BottomRect,
|
||||||
&DestRect, // Bounding rectangle
|
&DestRect, // Bounding rectangle
|
||||||
dc->w.ROPmode); // MIX
|
Mix);
|
||||||
|
|
||||||
ret = ret && IntEngLineTo(BitmapObj,
|
ret = ret && IntEngLineTo(BitmapObj,
|
||||||
dc->CombinedClip,
|
dc->CombinedClip,
|
||||||
&PenBrushInst.BrushObject,
|
&PenBrushInst.BrushObject,
|
||||||
LeftRect, BottomRect, LeftRect, TopRect,
|
LeftRect, BottomRect, LeftRect, TopRect,
|
||||||
&DestRect, // Bounding rectangle
|
&DestRect, // Bounding rectangle
|
||||||
dc->w.ROPmode); // MIX */
|
Mix);
|
||||||
}
|
}
|
||||||
|
|
||||||
PENOBJ_UnlockPen(dc->w.hPen);
|
PENOBJ_UnlockPen(dc->w.hPen);
|
||||||
|
|
|
@ -110,7 +110,7 @@ IntGdiLineTo(DC *dc,
|
||||||
Points[0].x, Points[0].y,
|
Points[0].x, Points[0].y,
|
||||||
Points[1].x, Points[1].y,
|
Points[1].x, Points[1].y,
|
||||||
&Bounds,
|
&Bounds,
|
||||||
dc->w.ROPmode);
|
ROP2_TO_MIX(dc->w.ROPmode));
|
||||||
}
|
}
|
||||||
|
|
||||||
BITMAPOBJ_UnlockBitmap ( dc->w.hBitmap );
|
BITMAPOBJ_UnlockBitmap ( dc->w.hBitmap );
|
||||||
|
@ -228,7 +228,7 @@ IntGdiPolyline(DC *dc,
|
||||||
IntGdiInitBrushInstance(&PenBrushInst, PenBrushObj, dc->XlatePen);
|
IntGdiInitBrushInstance(&PenBrushInst, PenBrushObj, dc->XlatePen);
|
||||||
Ret = IntEngPolyline(BitmapObj, dc->CombinedClip,
|
Ret = IntEngPolyline(BitmapObj, dc->CombinedClip,
|
||||||
&PenBrushInst.BrushObject, Points, Count,
|
&PenBrushInst.BrushObject, Points, Count,
|
||||||
dc->w.ROPmode);
|
ROP2_TO_MIX(dc->w.ROPmode));
|
||||||
|
|
||||||
BITMAPOBJ_UnlockBitmap(dc->w.hBitmap);
|
BITMAPOBJ_UnlockBitmap(dc->w.hBitmap);
|
||||||
EngFreeMem(Points);
|
EngFreeMem(Points);
|
||||||
|
|
Loading…
Reference in a new issue