Pass ROP4 instead of ROP3 to drivers

svn path=/trunk/; revision=13445
This commit is contained in:
Gé van Geldorp 2005-02-06 18:27:06 +00:00
parent 78a54aa150
commit bc7bba6f78
20 changed files with 141 additions and 147 deletions

View file

@ -188,20 +188,21 @@ VGADDI_BltBrush(SURFOBJ* Dest, SURFOBJ* Source, SURFOBJ* MaskSurf,
} }
/* Punt pattern fills. */ /* Punt pattern fills. */
if ((Rop4 == PATCOPY || Rop4 == PATINVERT) && if ((GET_OPINDEX_FROM_ROP4(Rop4) == GET_OPINDEX_FROM_ROP3(PATCOPY)
|| GET_OPINDEX_FROM_ROP4(Rop4) == GET_OPINDEX_FROM_ROP3(PATINVERT)) &&
Brush->iSolidColor == 0xFFFFFFFF) Brush->iSolidColor == 0xFFFFFFFF)
{ {
return(FALSE); return(FALSE);
} }
/* Get the brush colour. */ /* Get the brush colour. */
switch (Rop4) switch (GET_OPINDEX_FROM_ROP4(Rop4))
{ {
case PATCOPY: SolidColor = Brush->iSolidColor; break; case GET_OPINDEX_FROM_ROP3(PATCOPY): SolidColor = Brush->iSolidColor; break;
case PATINVERT: SolidColor = Brush->iSolidColor; RasterOp = VGA_XOR; break; case GET_OPINDEX_FROM_ROP3(PATINVERT): SolidColor = Brush->iSolidColor; RasterOp = VGA_XOR; break;
case WHITENESS: SolidColor = 0xF; break; case GET_OPINDEX_FROM_ROP3(WHITENESS): SolidColor = 0xF; break;
case BLACKNESS: SolidColor = 0x0; break; case GET_OPINDEX_FROM_ROP3(BLACKNESS): SolidColor = 0x0; break;
case DSTINVERT: SolidColor = 0xF; RasterOp = VGA_XOR; break; case GET_OPINDEX_FROM_ROP3(DSTINVERT): SolidColor = 0xF; RasterOp = VGA_XOR; break;
} }
/* Select write mode 3. */ /* Select write mode 3. */
@ -398,15 +399,15 @@ DrvBitBlt(SURFOBJ *Dest,
switch (rop4) switch (rop4)
{ {
case BLACKNESS: case ROP3_TO_ROP4(BLACKNESS):
case PATCOPY: case ROP3_TO_ROP4(PATCOPY):
case WHITENESS: case ROP3_TO_ROP4(WHITENESS):
case PATINVERT: case ROP3_TO_ROP4(PATINVERT):
case DSTINVERT: case ROP3_TO_ROP4(DSTINVERT):
BltRectFunc = VGADDI_BltBrush; BltRectFunc = VGADDI_BltBrush;
break; break;
case SRCCOPY: case ROP3_TO_ROP4(SRCCOPY):
if (BMF_4BPP == Source->iBitmapFormat && BMF_4BPP == Dest->iBitmapFormat) if (BMF_4BPP == Source->iBitmapFormat && BMF_4BPP == Dest->iBitmapFormat)
{ {
BltRectFunc = VGADDI_BltSrc; BltRectFunc = VGADDI_BltSrc;
@ -417,7 +418,7 @@ DrvBitBlt(SURFOBJ *Dest,
} }
break; break;
case 0xAACC: case R4_MASK:
BltRectFunc = VGADDI_BltMask; BltRectFunc = VGADDI_BltMask;
break; break;

View file

@ -20,3 +20,10 @@
#define BB_TARGET_ONLY 0x0002 #define BB_TARGET_ONLY 0x0002
#define BB_SOURCE_COPY 0x0004 #define BB_SOURCE_COPY 0x0004
#define BB_PATTERN_COPY 0x0008 #define BB_PATTERN_COPY 0x0008
#define GET_OPINDEX_FROM_ROP3(Rop3) (((Rop3) >> 16) & 0xff)
#define GET_OPINDEX_FROM_ROP4(Rop4) ((Rop4) & 0xff)
#define ROP3_TO_ROP4(Rop3) ((((Rop3) >> 8) & 0xff00) | (((Rop3) >> 16) & 0x00ff))
#define R3_OPINDEX_SRCCOPY 0xcc
#define R3_OPINDEX_NOOP 0xaa
#define R4_MASK ((R3_OPINDEX_NOOP << 8) | R3_OPINDEX_SRCCOPY)

View file

@ -156,25 +156,25 @@ DIB_DoRop(ULONG Rop, ULONG Dest, ULONG Source, ULONG Pattern)
/* Optimized code for the various named rop codes. */ /* Optimized code for the various named rop codes. */
switch (Rop) switch (Rop)
{ {
case BLACKNESS: return(0); case ROP3_TO_ROP4(BLACKNESS): return(0);
case NOTSRCERASE: return(~(Dest | Source)); case ROP3_TO_ROP4(NOTSRCERASE): return(~(Dest | Source));
case NOTSRCCOPY: return(~Source); case ROP3_TO_ROP4(NOTSRCCOPY): return(~Source);
case SRCERASE: return((~Dest) & Source); case ROP3_TO_ROP4(SRCERASE): return((~Dest) & Source);
case DSTINVERT: return(~Dest); case ROP3_TO_ROP4(DSTINVERT): return(~Dest);
case PATINVERT: return(Dest ^ Pattern); case ROP3_TO_ROP4(PATINVERT): return(Dest ^ Pattern);
case SRCINVERT: return(Dest ^ Source); case ROP3_TO_ROP4(SRCINVERT): return(Dest ^ Source);
case SRCAND: return(Dest & Source); case ROP3_TO_ROP4(SRCAND): return(Dest & Source);
case MERGEPAINT: return(Dest & (~Source)); case ROP3_TO_ROP4(MERGEPAINT): return(Dest & (~Source));
case SRCPAINT: return(Dest | Source); case ROP3_TO_ROP4(SRCPAINT): return(Dest | Source);
case MERGECOPY: return(Source & Pattern); case ROP3_TO_ROP4(MERGECOPY): return(Source & Pattern);
case SRCCOPY: return(Source); case ROP3_TO_ROP4(SRCCOPY): return(Source);
case PATCOPY: return(Pattern); case ROP3_TO_ROP4(PATCOPY): return(Pattern);
case PATPAINT: return(Dest | (~Source) | Pattern); case ROP3_TO_ROP4(PATPAINT): return(Dest | (~Source) | Pattern);
case WHITENESS: return(0xFFFFFFFF); case ROP3_TO_ROP4(WHITENESS): return(0xFFFFFFFF);
} }
/* Expand the ROP operation to all four bytes */ /* Expand the ROP operation to all four bytes */
Rop &= 0x00FF0000; Rop &= 0xFF;
Rop = (Rop << 8) | (Rop) | (Rop >> 8) | (Rop >> 16); Rop |= (Rop << 24) | (Rop << 16) | (Rop << 8);
/* Do the operation on four bits simultaneously. */ /* Do the operation on four bits simultaneously. */
Result = 0; Result = 0;
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++)

View file

@ -99,9 +99,6 @@ BOOLEAN DIB_32BPP_BitBltSrcCopy(PBLTINFO);
BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ*,SURFOBJ*,RECTL*,RECTL*,POINTL*,POINTL,CLIPOBJ*,XLATEOBJ*,ULONG); BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ*,SURFOBJ*,RECTL*,RECTL*,POINTL*,POINTL,CLIPOBJ*,XLATEOBJ*,ULONG);
BOOLEAN DIB_32BPP_TransparentBlt(SURFOBJ*,SURFOBJ*,RECTL*,POINTL*,XLATEOBJ*,ULONG); BOOLEAN DIB_32BPP_TransparentBlt(SURFOBJ*,SURFOBJ*,RECTL*,POINTL*,XLATEOBJ*,ULONG);
#define ROP_USES_SOURCE(Rop4) (((Rop4 & 0xCC0000) >> 2) != (Rop4 & 0x330000))
#define ROP_USES_PATTERN(Rop4) (((Rop4 & 0xF00000) >> 4) != (Rop4 & 0x0F0000))
extern unsigned char notmask[2]; extern unsigned char notmask[2];
extern unsigned char altnotmask[2]; extern unsigned char altnotmask[2];
#define MASK1BPP(x) (1<<(7-((x)&7))) #define MASK1BPP(x) (1<<(7-((x)&7)))

View file

@ -309,8 +309,8 @@ DIB_16BPP_BitBlt(PBLTINFO BltInfo)
PULONG DestBits; PULONG DestBits;
ULONG RoundedRight; ULONG RoundedRight;
UsesSource = ROP_USES_SOURCE(BltInfo->Rop4); UsesSource = ROP4_USES_SOURCE(BltInfo->Rop4);
UsesPattern = ROP_USES_PATTERN(BltInfo->Rop4); UsesPattern = ROP4_USES_PATTERN(BltInfo->Rop4);
RoundedRight = BltInfo->DestRect.right - RoundedRight = BltInfo->DestRect.right -
((BltInfo->DestRect.right - BltInfo->DestRect.left) & 0x1); ((BltInfo->DestRect.right - BltInfo->DestRect.left) & 0x1);

View file

@ -349,8 +349,8 @@ DIB_1BPP_BitBlt(PBLTINFO BltInfo)
ULONG RoundedRight; ULONG RoundedRight;
/* BYTE NoBits;*/ /* BYTE NoBits;*/
UsesSource = ROP_USES_SOURCE(BltInfo->Rop4); UsesSource = ROP4_USES_SOURCE(BltInfo->Rop4);
UsesPattern = ROP_USES_PATTERN(BltInfo->Rop4); UsesPattern = ROP4_USES_PATTERN(BltInfo->Rop4);
RoundedRight = BltInfo->DestRect.right - RoundedRight = BltInfo->DestRect.right -
((BltInfo->DestRect.right - BltInfo->DestRect.left) & 31); ((BltInfo->DestRect.right - BltInfo->DestRect.left) & 31);

View file

@ -244,8 +244,8 @@ DIB_24BPP_BitBlt(PBLTINFO BltInfo)
BOOL UsesPattern; BOOL UsesPattern;
PBYTE DestBits; PBYTE DestBits;
UsesSource = ROP_USES_SOURCE(BltInfo->Rop4); UsesSource = ROP4_USES_SOURCE(BltInfo->Rop4);
UsesPattern = ROP_USES_PATTERN(BltInfo->Rop4); UsesPattern = ROP4_USES_PATTERN(BltInfo->Rop4);
SourceY = BltInfo->SourcePoint.y; SourceY = BltInfo->SourcePoint.y;
DestBits = (PBYTE)( DestBits = (PBYTE)(

View file

@ -293,8 +293,8 @@ DIB_32BPP_BitBlt(PBLTINFO BltInfo)
BOOL UsesPattern; BOOL UsesPattern;
PULONG DestBits; PULONG DestBits;
UsesSource = ROP_USES_SOURCE(BltInfo->Rop4); UsesSource = ROP4_USES_SOURCE(BltInfo->Rop4);
UsesPattern = ROP_USES_PATTERN(BltInfo->Rop4); UsesPattern = ROP4_USES_PATTERN(BltInfo->Rop4);
SourceY = BltInfo->SourcePoint.y; SourceY = BltInfo->SourcePoint.y;
DestBits = (PULONG)( DestBits = (PULONG)(

View file

@ -251,8 +251,8 @@ DIB_4BPP_BitBlt(PBLTINFO BltInfo)
0xFFFFFFFF /* 15 */, 0xFFFFFFFF /* 15 */,
}; };
UsesSource = ROP_USES_SOURCE(BltInfo->Rop4); UsesSource = ROP4_USES_SOURCE(BltInfo->Rop4);
UsesPattern = ROP_USES_PATTERN(BltInfo->Rop4); UsesPattern = ROP4_USES_PATTERN(BltInfo->Rop4);
SourceY = BltInfo->SourcePoint.y; SourceY = BltInfo->SourcePoint.y;
RoundedRight = BltInfo->DestRect.right - RoundedRight = BltInfo->DestRect.right -

View file

@ -260,8 +260,8 @@ DIB_8BPP_BitBlt(PBLTINFO BltInfo)
PULONG DestBits; PULONG DestBits;
LONG RoundedRight; LONG RoundedRight;
UsesSource = ROP_USES_SOURCE(BltInfo->Rop4); UsesSource = ROP4_USES_SOURCE(BltInfo->Rop4);
UsesPattern = ROP_USES_PATTERN(BltInfo->Rop4); UsesPattern = ROP4_USES_PATTERN(BltInfo->Rop4);
SourceY = BltInfo->SourcePoint.y; SourceY = BltInfo->SourcePoint.y;
RoundedRight = BltInfo->DestRect.right - RoundedRight = BltInfo->DestRect.right -

View file

@ -213,7 +213,7 @@ CallDibBitBlt(SURFOBJ* OutputObj,
BltInfo.DestRect = *OutputRect; BltInfo.DestRect = *OutputRect;
BltInfo.SourcePoint = *InputPoint; BltInfo.SourcePoint = *InputPoint;
if (Rop4 == SRCCOPY) if (ROP3_TO_ROP4(SRCCOPY) == Rop4)
return DibFunctionsForBitmapFormat[OutputObj->iBitmapFormat].DIB_BitBltSrcCopy(&BltInfo); return DibFunctionsForBitmapFormat[OutputObj->iBitmapFormat].DIB_BitBltSrcCopy(&BltInfo);
BltInfo.XlatePatternToDest = NULL; BltInfo.XlatePatternToDest = NULL;
@ -222,7 +222,7 @@ CallDibBitBlt(SURFOBJ* OutputObj,
BltInfo.Rop4 = Rop4; BltInfo.Rop4 = Rop4;
/* Pattern brush */ /* Pattern brush */
if (ROP_USES_PATTERN(Rop4) && Brush->iSolidColor == 0xFFFFFFFF) if (ROP4_USES_PATTERN(Rop4) && Brush->iSolidColor == 0xFFFFFFFF)
{ {
GdiBrush = CONTAINING_RECORD(Brush, GDIBRUSHINST, BrushObject); GdiBrush = CONTAINING_RECORD(Brush, GDIBRUSHINST, BrushObject);
if((bmPattern = BITMAPOBJ_LockBitmap(GdiBrush->GdiBrushObject->hbmPattern))) if((bmPattern = BITMAPOBJ_LockBitmap(GdiBrush->GdiBrushObject->hbmPattern)))
@ -291,9 +291,9 @@ EngBitBlt(SURFOBJ *DestObj,
BOOL UsesPattern; BOOL UsesPattern;
POINTL AdjustedBrushOrigin; POINTL AdjustedBrushOrigin;
UsesSource = ((Rop4 & 0xCC0000) >> 2) != (Rop4 & 0x330000); UsesSource = ROP4_USES_SOURCE(Rop4);
UsesPattern = ((Rop4 & 0xF00000) >> 4) != (Rop4 & 0x0F0000); UsesPattern = ROP4_USES_PATTERN(Rop4);
if (ROP_NOOP == Rop4) if (R4_NOOP == Rop4)
{ {
/* Copy destination onto itself: nop */ /* Copy destination onto itself: nop */
return TRUE; return TRUE;
@ -392,20 +392,16 @@ EngBitBlt(SURFOBJ *DestObj,
clippingType = ClipRegion->iDComplexity; clippingType = ClipRegion->iDComplexity;
} }
if (0xaacc == Rop4) if (R4_MASK == Rop4)
{ {
BltRectFunc = BltMask; BltRectFunc = BltMask;
} }
else if (PATCOPY == Rop4) else if (ROP3_TO_ROP4(PATCOPY) == Rop4)
{ {
#if 0
BltRectFunc = BltPatCopy;
#else
if (Brush->iSolidColor == 0xFFFFFFFF) if (Brush->iSolidColor == 0xFFFFFFFF)
BltRectFunc = CallDibBitBlt; BltRectFunc = CallDibBitBlt;
else else
BltRectFunc = BltPatCopy; BltRectFunc = BltPatCopy;
#endif
} }
else else
{ {
@ -515,7 +511,7 @@ IntEngBitBlt(BITMAPOBJ *DestObj,
InputClippedRect.top = DestRect->bottom; InputClippedRect.top = DestRect->bottom;
InputClippedRect.bottom = DestRect->top; InputClippedRect.bottom = DestRect->top;
} }
UsesSource = ((Rop4 & 0xCC0000) >> 2) != (Rop4 & 0x330000); UsesSource = ROP4_USES_SOURCE(Rop4);
if (UsesSource) if (UsesSource)
{ {
if (NULL == SourcePoint || NULL == SourceSurf) if (NULL == SourcePoint || NULL == SourceSurf)
@ -833,40 +829,41 @@ AlphaBltMask(SURFOBJ* Dest,
tMask = Mask->pvScan0 + (SourcePoint->y * Mask->lDelta) + SourcePoint->x; tMask = Mask->pvScan0 + (SourcePoint->y * Mask->lDelta) + SourcePoint->x;
for (j = 0; j < dy; j++) for (j = 0; j < dy; j++)
{ {
lMask = tMask; lMask = tMask;
for (i = 0; i < dx; i++) for (i = 0; i < dx; i++)
{ {
if (*lMask > 0) if (*lMask > 0)
{ {
if(*lMask == 0xff) if (*lMask == 0xff)
{ {
DibFunctionsForBitmapFormat[Dest->iBitmapFormat].DIB_PutPixel( DibFunctionsForBitmapFormat[Dest->iBitmapFormat].DIB_PutPixel(
Dest, DestRect->left + i, DestRect->top + j, Brush->iSolidColor); Dest, DestRect->left + i, DestRect->top + j, Brush->iSolidColor);
} }
else else
{ {
Background = DIB_GetSource(Dest, DestRect->left + i, DestRect->top + j, SrcColorTranslation); Background = DIB_GetSource(Dest, DestRect->left + i, DestRect->top + j,
SrcColorTranslation);
NewColor = NewColor =
RGB((*lMask * (r - GetRValue(Background)) >> 8) + GetRValue(Background), RGB((*lMask * (r - GetRValue(Background)) >> 8) + GetRValue(Background),
(*lMask * (g - GetGValue(Background)) >> 8) + GetGValue(Background), (*lMask * (g - GetGValue(Background)) >> 8) + GetGValue(Background),
(*lMask * (b - GetBValue(Background)) >> 8) + GetBValue(Background)); (*lMask * (b - GetBValue(Background)) >> 8) + GetBValue(Background));
Background = XLATEOBJ_iXlate(ColorTranslation, NewColor); Background = XLATEOBJ_iXlate(ColorTranslation, NewColor);
DibFunctionsForBitmapFormat[Dest->iBitmapFormat].DIB_PutPixel( DibFunctionsForBitmapFormat[Dest->iBitmapFormat].DIB_PutPixel(
Dest, DestRect->left + i, DestRect->top + j, Background); Dest, DestRect->left + i, DestRect->top + j, Background);
} }
} }
lMask++; lMask++;
} }
tMask += Mask->lDelta; tMask += Mask->lDelta;
} }
return TRUE; return TRUE;
} }
else else
{ {
return FALSE; return FALSE;
} }
} }
@ -918,7 +915,7 @@ EngMaskBitBlt(SURFOBJ *DestObj,
InputRect.bottom = DestRect->bottom - DestRect->top; InputRect.bottom = DestRect->bottom - DestRect->top;
} }
if (! IntEngEnter(&EnterLeaveSource, NULL, &InputRect, TRUE, &Translate, &InputObj)) if (! IntEngEnter(&EnterLeaveSource, DestObj, &InputRect, TRUE, &Translate, &InputObj))
{ {
return FALSE; return FALSE;
} }
@ -1004,7 +1001,8 @@ EngMaskBitBlt(SURFOBJ *DestObj,
&OutputRect, &InputPoint, MaskOrigin, Brush, &AdjustedBrushOrigin); &OutputRect, &InputPoint, MaskOrigin, Brush, &AdjustedBrushOrigin);
else else
Ret = BltMask(OutputObj, InputObj, Mask, DestColorTranslation, Ret = BltMask(OutputObj, InputObj, Mask, DestColorTranslation,
&OutputRect, &InputPoint, MaskOrigin, Brush, &AdjustedBrushOrigin, 0xAACC); &OutputRect, &InputPoint, MaskOrigin, Brush, &AdjustedBrushOrigin,
R4_MASK);
break; break;
case DC_RECT: case DC_RECT:
// Clip the blt to the clip rectangle // Clip the blt to the clip rectangle
@ -1020,7 +1018,7 @@ EngMaskBitBlt(SURFOBJ *DestObj,
&CombinedRect, &Pt, MaskOrigin, Brush, &AdjustedBrushOrigin); &CombinedRect, &Pt, MaskOrigin, Brush, &AdjustedBrushOrigin);
else else
Ret = BltMask(OutputObj, InputObj, Mask, DestColorTranslation, Ret = BltMask(OutputObj, InputObj, Mask, DestColorTranslation,
&CombinedRect, &Pt, MaskOrigin, Brush, &AdjustedBrushOrigin, 0xAACC); &CombinedRect, &Pt, MaskOrigin, Brush, &AdjustedBrushOrigin, R4_MASK);
break; break;
case DC_COMPLEX: case DC_COMPLEX:
Ret = TRUE; Ret = TRUE;
@ -1058,7 +1056,7 @@ EngMaskBitBlt(SURFOBJ *DestObj,
&CombinedRect, &Pt, MaskOrigin, Brush, &AdjustedBrushOrigin) && Ret; &CombinedRect, &Pt, MaskOrigin, Brush, &AdjustedBrushOrigin) && Ret;
else else
Ret = BltMask(OutputObj, InputObj, Mask, DestColorTranslation, Ret = BltMask(OutputObj, InputObj, Mask, DestColorTranslation,
&CombinedRect, &Pt, MaskOrigin, Brush, &AdjustedBrushOrigin, 0xAACC) && Ret; &CombinedRect, &Pt, MaskOrigin, Brush, &AdjustedBrushOrigin, R4_MASK) && Ret;
} }
} }
while(EnumMore); while(EnumMore);
@ -1069,26 +1067,20 @@ EngMaskBitBlt(SURFOBJ *DestObj,
IntEngLeave(&EnterLeaveDest); IntEngLeave(&EnterLeaveDest);
IntEngLeave(&EnterLeaveSource); IntEngLeave(&EnterLeaveSource);
/* Dummy BitBlt to let driver know that something has changed.
0x00AA0029 is the Rop for D (no-op) */
/* FIXME: Remove the typecast! */
IntEngBitBlt((BITMAPOBJ*)DestObj, NULL, (BITMAPOBJ*)Mask, ClipRegion, DestColorTranslation,
DestRect, SourcePoint, MaskOrigin, Brush, BrushOrigin, ROP_NOOP);
return Ret; return Ret;
} }
BOOL STDCALL BOOL STDCALL
IntEngMaskBlt(SURFOBJ *DestObj, IntEngMaskBlt(SURFOBJ *DestObj,
SURFOBJ *Mask, SURFOBJ *Mask,
CLIPOBJ *ClipRegion, CLIPOBJ *ClipRegion,
XLATEOBJ *DestColorTranslation, XLATEOBJ *DestColorTranslation,
XLATEOBJ *SourceColorTranslation, XLATEOBJ *SourceColorTranslation,
RECTL *DestRect, RECTL *DestRect,
POINTL *SourcePoint, POINTL *SourcePoint,
POINTL *MaskOrigin, POINTL *MaskOrigin,
BRUSHOBJ *Brush, BRUSHOBJ *Brush,
POINTL *BrushOrigin) POINTL *BrushOrigin)
{ {
BOOLEAN ret; BOOLEAN ret;
RECTL OutputRect; RECTL OutputRect;
@ -1123,9 +1115,21 @@ IntEngMaskBlt(SURFOBJ *DestObj,
MouseSafetyOnDrawStart(DestObj, OutputRect.left, OutputRect.top, MouseSafetyOnDrawStart(DestObj, OutputRect.left, OutputRect.top,
OutputRect.right, OutputRect.bottom); OutputRect.right, OutputRect.bottom);
/* Dummy BitBlt to let driver know that it should flush its changes.
This should really be done using a call to DrvSynchronizeSurface,
but the VMware driver doesn't hook that call. */
/* FIXME: Remove the typecast! */
IntEngBitBlt((BITMAPOBJ*)DestObj, NULL, (BITMAPOBJ*)Mask, ClipRegion, DestColorTranslation,
DestRect, SourcePoint, MaskOrigin, Brush, BrushOrigin, R4_NOOP);
ret = EngMaskBitBlt(DestObj, Mask, ClipRegion, DestColorTranslation, SourceColorTranslation, ret = EngMaskBitBlt(DestObj, Mask, ClipRegion, DestColorTranslation, SourceColorTranslation,
&OutputRect, &InputPoint, MaskOrigin, Brush, BrushOrigin); &OutputRect, &InputPoint, MaskOrigin, Brush, BrushOrigin);
/* Dummy BitBlt to let driver know that something has changed. */
/* FIXME: Remove the typecast! */
IntEngBitBlt((BITMAPOBJ*)DestObj, NULL, (BITMAPOBJ*)Mask, ClipRegion, DestColorTranslation,
DestRect, SourcePoint, MaskOrigin, Brush, BrushOrigin, R4_NOOP);
MouseSafetyOnDrawEnd(DestObj); MouseSafetyOnDrawEnd(DestObj);
return ret; return ret;

View file

@ -98,7 +98,7 @@ EngCopyBits(SURFOBJ *Dest,
/* FIXME: Remove the typecast! */ /* FIXME: Remove the typecast! */
ret = IntEngBitBlt((BITMAPOBJ*)Dest, (BITMAPOBJ*)Source, ret = IntEngBitBlt((BITMAPOBJ*)Dest, (BITMAPOBJ*)Source,
NULL, Clip, ColorTranslation, DestRect, SourcePoint, NULL, Clip, ColorTranslation, DestRect, SourcePoint,
NULL, NULL, NULL, 0); NULL, NULL, NULL, ROP3_TO_ROP4(SRCCOPY));
MouseSafetyOnDrawEnd(Dest); MouseSafetyOnDrawEnd(Dest);
MouseSafetyOnDrawEnd(Source); MouseSafetyOnDrawEnd(Source);

View file

@ -541,7 +541,7 @@ IntEngGradientFill(
pco->rclBounds.top, pco->rclBounds.top,
pco->rclBounds.right, pco->rclBounds.right,
pco->rclBounds.bottom); pco->rclBounds.bottom);
if((psoDest->iType != STYPE_BITMAP) && (pboDest->flHooks & HOOK_GRADIENTFILL)) if(pboDest->flHooks & HOOK_GRADIENTFILL)
{ {
Ret = GDIDEVFUNCS(psoDest).GradientFill( Ret = GDIDEVFUNCS(psoDest).GradientFill(
psoDest, pco, pxlo, pVertex, nVertex, pMesh, nMesh, psoDest, pco, pxlo, pVertex, nVertex, pMesh, nMesh,
@ -551,19 +551,6 @@ IntEngGradientFill(
} }
Ret = EngGradientFill(psoDest, pco, pxlo, pVertex, nVertex, pMesh, nMesh, prclExtents, Ret = EngGradientFill(psoDest, pco, pxlo, pVertex, nVertex, pMesh, nMesh, prclExtents,
pptlDitherOrg, ulMode); pptlDitherOrg, ulMode);
if(Ret)
{
/* Dummy BitBlt to let driver know that something has changed.
0x00AA0029 is the Rop for D (no-op) */
if(pboDest->flHooks & HOOK_BITBLT)
{
GDIDEVFUNCS(psoDest).BitBlt(
psoDest, NULL, NULL, pco, pxlo,
prclExtents, pptlDitherOrg, NULL, NULL, NULL, ROP_NOOP);
MouseSafetyOnDrawEnd(psoDest);
return TRUE;
}
}
MouseSafetyOnDrawEnd(psoDest); MouseSafetyOnDrawEnd(psoDest);
return Ret; return Ret;
} }

View file

@ -178,7 +178,7 @@ IntHideMousePointer(GDIDEVICE *ppdev, SURFOBJ *DestSurface)
if((MaskSurface = EngLockSurface(pgp->MaskSurface))) if((MaskSurface = EngLockSurface(pgp->MaskSurface)))
{ {
EngBitBlt(DestSurface, SaveSurface, MaskSurface, NULL, NULL, EngBitBlt(DestSurface, SaveSurface, MaskSurface, NULL, NULL,
&DestRect, &SrcPoint, &SrcPoint, NULL, NULL, SRCCOPY); &DestRect, &SrcPoint, &SrcPoint, NULL, NULL, ROP3_TO_ROP4(SRCCOPY));
EngUnlockSurface(MaskSurface); EngUnlockSurface(MaskSurface);
} }
EngUnlockSurface(SaveSurface); EngUnlockSurface(SaveSurface);
@ -231,7 +231,7 @@ IntShowMousePointer(GDIDEVICE *ppdev, SURFOBJ *DestSurface)
DestSurface->sizlBitmap.cy - pt.y); DestSurface->sizlBitmap.cy - pt.y);
EngBitBlt(SaveSurface, DestSurface, NULL, NULL, NULL, EngBitBlt(SaveSurface, DestSurface, NULL, NULL, NULL,
&DestRect, &SrcPoint, NULL, NULL, NULL, SRCCOPY); &DestRect, &SrcPoint, NULL, NULL, NULL, ROP3_TO_ROP4(SRCCOPY));
EngUnlockSurface(SaveSurface); EngUnlockSurface(SaveSurface);
} }
@ -265,17 +265,17 @@ IntShowMousePointer(GDIDEVICE *ppdev, SURFOBJ *DestSurface)
if((ColorSurf = EngLockSurface(pgp->ColorSurface))) if((ColorSurf = EngLockSurface(pgp->ColorSurface)))
{ {
EngBitBlt(DestSurface, ColorSurf, MaskSurf, NULL, pgp->XlateObject, EngBitBlt(DestSurface, ColorSurf, MaskSurf, NULL, pgp->XlateObject,
&DestRect, &SrcPoint, &SrcPoint, NULL, NULL, 0xAACC); &DestRect, &SrcPoint, &SrcPoint, NULL, NULL, R4_MASK);
EngUnlockSurface(ColorSurf); EngUnlockSurface(ColorSurf);
} }
} }
else else
{ {
EngBitBlt(DestSurface, MaskSurf, NULL, NULL, pgp->XlateObject, EngBitBlt(DestSurface, MaskSurf, NULL, NULL, pgp->XlateObject,
&DestRect, &SrcPoint, NULL, NULL, NULL, SRCAND); &DestRect, &SrcPoint, NULL, NULL, NULL, ROP3_TO_ROP4(SRCAND));
SrcPoint.y += pgp->Size.cy; SrcPoint.y += pgp->Size.cy;
EngBitBlt(DestSurface, MaskSurf, NULL, NULL, pgp->XlateObject, EngBitBlt(DestSurface, MaskSurf, NULL, NULL, pgp->XlateObject,
&DestRect, &SrcPoint, NULL, NULL, NULL, SRCINVERT); &DestRect, &SrcPoint, NULL, NULL, NULL, ROP3_TO_ROP4(SRCINVERT));
} }
EngUnlockSurface(MaskSurf); EngUnlockSurface(MaskSurf);
} }

View file

@ -270,18 +270,6 @@ IntEngTransparentBlt(BITMAPOBJ *DestObj,
&OutputRect, SourceRect, iTransColor, Reserved); &OutputRect, SourceRect, iTransColor, Reserved);
} }
if(Ret)
{
/* Dummy BitBlt to let driver know that something has changed.
0x00AA0029 is the Rop for D (no-op) */
if (DestObj->flHooks & HOOK_BITBLT)
{
GDIDEVFUNCS(DestSurf).BitBlt(
DestSurf, NULL, NULL, Clip, ColorTranslation,
&OutputRect, NULL, NULL, NULL, NULL, ROP_NOOP);
}
}
MouseSafetyOnDrawEnd(DestSurf); MouseSafetyOnDrawEnd(DestSurf);
if(SourceSurf != DestSurf) if(SourceSurf != DestSurf)
{ {

View file

@ -18,7 +18,17 @@ typedef struct tagSPAN
ULONG Width; ULONG Width;
} SPAN, *PSPAN; } SPAN, *PSPAN;
#define ROP_NOOP 0x00AA0029 #define R3_OPINDEX_SRCCOPY 0xcc
#define R3_OPINDEX_NOOP 0xaa
#define R4_NOOP ((R3_OPINDEX_NOOP << 8) | R3_OPINDEX_NOOP)
#define R4_MASK ((R3_OPINDEX_NOOP << 8) | R3_OPINDEX_SRCCOPY)
#define ROP2_TO_MIX(Rop2) (((Rop2) << 8) | (Rop2))
#define ROP3_USES_SOURCE(Rop3) ((((Rop3) & 0xCC0000) >> 2) != ((Rop3) & 0x330000))
#define ROP4_USES_SOURCE(Rop4) (((((Rop4) & 0xCC) >> 2) != ((Rop4) & 0x33)) || ((((Rop4) & 0xCC00) >> 2) != ((Rop4) & 0x3300)))
#define ROP3_USES_PATTERN(Rop3) ((((Rop3) & 0xF00000) >> 4) != ((Rop3) & 0x0F0000))
#define ROP4_USES_PATTERN(Rop4) (((((Rop4) & 0xF0) >> 4) != ((Rop4) & 0x0F)) || ((((Rop4) & 0xF000) >> 4) != ((Rop4) & 0x0F00)))
#define ROP3_TO_ROP4(Rop3) ((((Rop3) >> 8) & 0xff00) | (((Rop3) >> 16) & 0x00ff))
/* Definitions of IntEngXxx functions */ /* Definitions of IntEngXxx functions */
@ -32,7 +42,6 @@ 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,

View file

@ -49,8 +49,8 @@ NtGdiBitBlt(
HPALETTE SourcePalette = 0, DestPalette = 0; HPALETTE SourcePalette = 0, DestPalette = 0;
PGDIBRUSHOBJ BrushObj; PGDIBRUSHOBJ BrushObj;
GDIBRUSHINST BrushInst; GDIBRUSHINST BrushInst;
BOOL UsesSource = ROP_USES_SOURCE(ROP); BOOL UsesSource = ROP3_USES_SOURCE(ROP);
BOOL UsesPattern = ROP_USES_PATTERN(ROP); BOOL UsesPattern = ROP3_USES_PATTERN(ROP);
DCDest = DC_LockDc(hDCDest); DCDest = DC_LockDc(hDCDest);
if (NULL == DCDest) if (NULL == DCDest)
@ -201,7 +201,8 @@ NtGdiBitBlt(
/* Perform the bitblt operation */ /* Perform the bitblt operation */
Status = IntEngBitBlt(BitmapDest, BitmapSrc, NULL, DCDest->CombinedClip, XlateObj, Status = IntEngBitBlt(BitmapDest, BitmapSrc, NULL, DCDest->CombinedClip, XlateObj,
&DestRect, &SourcePoint, NULL, BrushObj ? &BrushInst.BrushObject : NULL, &BrushOrigin, ROP); &DestRect, &SourcePoint, NULL, BrushObj ? &BrushInst.BrushObject : NULL,
&BrushOrigin, ROP3_TO_ROP4(ROP));
if (UsesSource && XlateObj != NULL) if (UsesSource && XlateObj != NULL)
EngDeleteXlate(XlateObj); EngDeleteXlate(XlateObj);

View file

@ -239,7 +239,7 @@ IntPatBlt(
NULL, NULL,
&BrushInst.BrushObject, &BrushInst.BrushObject,
&BrushOrigin, &BrushOrigin,
ROP); ROP3_TO_ROP4(ROP));
} }
BITMAPOBJ_UnlockBitmap(dc->w.hBitmap); BITMAPOBJ_UnlockBitmap(dc->w.hBitmap);

View file

@ -979,7 +979,7 @@ IntRectangle(PDC dc,
NULL, NULL,
&FillBrushInst.BrushObject, &FillBrushInst.BrushObject,
NULL, NULL,
PATCOPY); ROP3_TO_ROP4(PATCOPY));
} }
} }

View file

@ -1636,7 +1636,7 @@ NtGdiExtTextOut(
&SourcePoint, &SourcePoint,
&BrushBgInst.BrushObject, &BrushBgInst.BrushObject,
&BrushOrigin, &BrushOrigin,
PATCOPY); ROP3_TO_ROP4(PATCOPY));
fuOptions &= ~ETO_OPAQUE; fuOptions &= ~ETO_OPAQUE;
} }
else else
@ -1854,7 +1854,7 @@ NtGdiExtTextOut(
&SourcePoint, &SourcePoint,
&BrushBgInst.BrushObject, &BrushBgInst.BrushObject,
&BrushOrigin, &BrushOrigin,
PATCOPY); ROP3_TO_ROP4(PATCOPY));
BackgroundLeft = DestRect.right; BackgroundLeft = DestRect.right;
} }