Evgeniy Boltik <bstsoft AT narod DOT ru>

- Fix if param Brush == NULL.
- See issue #4220 for details.

svn path=/trunk/; revision=39870
This commit is contained in:
Matthias Kupfer 2009-03-04 16:25:22 +00:00
parent b6d8ca9259
commit 4ae3c614b0
5 changed files with 21 additions and 11 deletions

View file

@ -369,7 +369,8 @@ DIB_1BPP_BitBlt(PBLTINFO BltInfo)
else else
{ {
/* FIXME: Shouldn't it be expanded? */ /* FIXME: Shouldn't it be expanded? */
Pattern = BltInfo->Brush->iSolidColor; if (BltInfo->Brush)
Pattern = BltInfo->Brush->iSolidColor;
} }
} }

View file

@ -263,7 +263,8 @@ DIB_24BPP_BitBlt(PBLTINFO BltInfo)
} }
else else
{ {
Pattern = BltInfo->Brush->iSolidColor; if (BltInfo->Brush)
Pattern = BltInfo->Brush->iSolidColor;
} }
} }

View file

@ -271,7 +271,8 @@ DIB_4BPP_BitBlt(PBLTINFO BltInfo)
} }
else else
{ {
Pattern = ExpandSolidColor[BltInfo->Brush->iSolidColor]; if (BltInfo->Brush)
Pattern = ExpandSolidColor[BltInfo->Brush->iSolidColor];
} }
} }

View file

@ -106,7 +106,7 @@ BltMask(SURFOBJ* Dest,
dx = DestRect->right - DestRect->left; dx = DestRect->right - DestRect->left;
dy = DestRect->bottom - DestRect->top; dy = DestRect->bottom - DestRect->top;
if (Brush->iSolidColor == 0xFFFFFFFF) if (Brush && Brush->iSolidColor == 0xFFFFFFFF)
{ {
GdiBrush = CONTAINING_RECORD( GdiBrush = CONTAINING_RECORD(
Brush, Brush,
@ -140,13 +140,13 @@ BltMask(SURFOBJ* Dest,
if (psurfPattern == NULL) if (psurfPattern == NULL)
{ {
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 ? Brush->iSolidColor : 0);
} }
else else
{ {
DibFunctionsForBitmapFormat[Dest->iBitmapFormat].DIB_PutPixel( DibFunctionsForBitmapFormat[Dest->iBitmapFormat].DIB_PutPixel(
Dest, DestRect->left + i, DestRect->top + j, Dest, DestRect->left + i, DestRect->top + j,
DIB_GetSource(psoPattern, (DestRect->left + i) % PatternWidth, PatternY, GdiBrush->XlateObject)); DIB_GetSource(psoPattern, (DestRect->left + i) % PatternWidth, PatternY, GdiBrush ? GdiBrush->XlateObject : NULL));
} }
} }
c8++; c8++;
@ -180,7 +180,7 @@ BltPatCopy(SURFOBJ* Dest,
// These functions are assigned if we're working with a DIB // These functions are assigned if we're working with a DIB
// The assigned functions depend on the bitsPerPixel of the DIB // The assigned functions depend on the bitsPerPixel of the DIB
DibFunctionsForBitmapFormat[Dest->iBitmapFormat].DIB_ColorFill(Dest, DestRect, Brush->iSolidColor); DibFunctionsForBitmapFormat[Dest->iBitmapFormat].DIB_ColorFill(Dest, DestRect, Brush ? Brush->iSolidColor : 0);
return TRUE; return TRUE;
} }
@ -218,7 +218,7 @@ CallDibBitBlt(SURFOBJ* OutputObj,
BltInfo.Rop4 = Rop4; BltInfo.Rop4 = Rop4;
/* Pattern brush */ /* Pattern brush */
if (ROP4_USES_PATTERN(Rop4) && Brush->iSolidColor == 0xFFFFFFFF) if (ROP4_USES_PATTERN(Rop4) && Brush && Brush->iSolidColor == 0xFFFFFFFF)
{ {
GdiBrush = CONTAINING_RECORD(Brush, GDIBRUSHINST, BrushObject); GdiBrush = CONTAINING_RECORD(Brush, GDIBRUSHINST, BrushObject);
if ((psurfPattern = SURFACE_LockSurface(GdiBrush->GdiBrushObject->hbmPattern))) if ((psurfPattern = SURFACE_LockSurface(GdiBrush->GdiBrushObject->hbmPattern)))
@ -488,7 +488,7 @@ EngBitBlt(SURFOBJ *DestObj,
} }
else if (ROP3_TO_ROP4(PATCOPY) == Rop4) else if (ROP3_TO_ROP4(PATCOPY) == Rop4)
{ {
if (Brush->iSolidColor == 0xFFFFFFFF) if (Brush && Brush->iSolidColor == 0xFFFFFFFF)
BltRectFunc = CallDibBitBlt; BltRectFunc = CallDibBitBlt;
else else
BltRectFunc = BltPatCopy; BltRectFunc = BltPatCopy;
@ -1547,7 +1547,7 @@ AlphaBltMask(SURFOBJ* psoDest,
if (Mask != NULL) if (Mask != NULL)
{ {
BrushColor = XLATEOBJ_iXlate(SrcColorTranslation, Brush->iSolidColor); BrushColor = XLATEOBJ_iXlate(SrcColorTranslation, Brush ? Brush->iSolidColor : 0);
r = (int)GetRValue(BrushColor); r = (int)GetRValue(BrushColor);
g = (int)GetGValue(BrushColor); g = (int)GetGValue(BrushColor);
b = (int)GetBValue(BrushColor); b = (int)GetBValue(BrushColor);
@ -1563,7 +1563,7 @@ AlphaBltMask(SURFOBJ* psoDest,
if (*lMask == 0xff) if (*lMask == 0xff)
{ {
DibFunctionsForBitmapFormat[psoDest->iBitmapFormat].DIB_PutPixel( DibFunctionsForBitmapFormat[psoDest->iBitmapFormat].DIB_PutPixel(
psoDest, DestRect->left + i, DestRect->top + j, Brush->iSolidColor); psoDest, DestRect->left + i, DestRect->top + j, Brush ? Brush->iSolidColor : 0);
} }
else else
{ {

View file

@ -877,6 +877,12 @@ CreatePrimitive(FILE *Out, unsigned Bpp, PROPINFO RopInfo)
{ {
if (0 == Partial) if (0 == Partial)
{ {
Output(Out, "if (!BltInfo->Brush)\n");
Output(Out, "{\n");
Output(Out, "Pattern = 0;\n");
Output(Out, "}\n");
Output(Out, "else\n");
Output(Out, "{\n");
Output(Out, "Pattern = BltInfo->Brush->iSolidColor"); Output(Out, "Pattern = BltInfo->Brush->iSolidColor");
} }
else else
@ -887,6 +893,7 @@ CreatePrimitive(FILE *Out, unsigned Bpp, PROPINFO RopInfo)
if (32 / Bpp <= Partial + 1) if (32 / Bpp <= Partial + 1)
{ {
Output(Out, ";\n"); Output(Out, ";\n");
Output(Out, "}\n");
} }
else else
{ {