Author: mkupfer
Date: Wed Mar 4 19:25:22 2009
New Revision: 39870
URL:
http://svn.reactos.org/svn/reactos?rev=39870&view=rev
Log:
Evgeniy Boltik <bstsoft AT narod DOT ru>
- Fix if param Brush == NULL.
- See issue #4220 for details.
Modified:
trunk/reactos/subsystems/win32/win32k/dib/dib1bpp.c
trunk/reactos/subsystems/win32/win32k/dib/dib24bpp.c
trunk/reactos/subsystems/win32/win32k/dib/dib4bpp.c
trunk/reactos/subsystems/win32/win32k/eng/bitblt.c
trunk/reactos/tools/gendib/gendib.c
Modified: trunk/reactos/subsystems/win32/win32k/dib/dib1bpp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/di…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/dib/dib1bpp.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/dib/dib1bpp.c [iso-8859-1] Wed Mar 4 19:25:22
2009
@@ -369,7 +369,8 @@
else
{
/* FIXME: Shouldn't it be expanded? */
- Pattern = BltInfo->Brush->iSolidColor;
+ if (BltInfo->Brush)
+ Pattern = BltInfo->Brush->iSolidColor;
}
}
Modified: trunk/reactos/subsystems/win32/win32k/dib/dib24bpp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/di…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/dib/dib24bpp.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/dib/dib24bpp.c [iso-8859-1] Wed Mar 4 19:25:22
2009
@@ -263,7 +263,8 @@
}
else
{
- Pattern = BltInfo->Brush->iSolidColor;
+ if (BltInfo->Brush)
+ Pattern = BltInfo->Brush->iSolidColor;
}
}
Modified: trunk/reactos/subsystems/win32/win32k/dib/dib4bpp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/di…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/dib/dib4bpp.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/dib/dib4bpp.c [iso-8859-1] Wed Mar 4 19:25:22
2009
@@ -271,7 +271,8 @@
}
else
{
- Pattern = ExpandSolidColor[BltInfo->Brush->iSolidColor];
+ if (BltInfo->Brush)
+ Pattern = ExpandSolidColor[BltInfo->Brush->iSolidColor];
}
}
Modified: trunk/reactos/subsystems/win32/win32k/eng/bitblt.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/en…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/eng/bitblt.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/eng/bitblt.c [iso-8859-1] Wed Mar 4 19:25:22
2009
@@ -106,7 +106,7 @@
dx = DestRect->right - DestRect->left;
dy = DestRect->bottom - DestRect->top;
- if (Brush->iSolidColor == 0xFFFFFFFF)
+ if (Brush && Brush->iSolidColor == 0xFFFFFFFF)
{
GdiBrush = CONTAINING_RECORD(
Brush,
@@ -140,13 +140,13 @@
if (psurfPattern == NULL)
{
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
{
DibFunctionsForBitmapFormat[Dest->iBitmapFormat].DIB_PutPixel(
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++;
@@ -180,7 +180,7 @@
// These functions are assigned if we're working with a 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;
}
@@ -218,7 +218,7 @@
BltInfo.Rop4 = Rop4;
/* 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);
if ((psurfPattern =
SURFACE_LockSurface(GdiBrush->GdiBrushObject->hbmPattern)))
@@ -488,7 +488,7 @@
}
else if (ROP3_TO_ROP4(PATCOPY) == Rop4)
{
- if (Brush->iSolidColor == 0xFFFFFFFF)
+ if (Brush && Brush->iSolidColor == 0xFFFFFFFF)
BltRectFunc = CallDibBitBlt;
else
BltRectFunc = BltPatCopy;
@@ -1547,7 +1547,7 @@
if (Mask != NULL)
{
- BrushColor = XLATEOBJ_iXlate(SrcColorTranslation, Brush->iSolidColor);
+ BrushColor = XLATEOBJ_iXlate(SrcColorTranslation, Brush ? Brush->iSolidColor :
0);
r = (int)GetRValue(BrushColor);
g = (int)GetGValue(BrushColor);
b = (int)GetBValue(BrushColor);
@@ -1563,7 +1563,7 @@
if (*lMask == 0xff)
{
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
{
Modified: trunk/reactos/tools/gendib/gendib.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/gendib/gendib.c?rev=…
==============================================================================
--- trunk/reactos/tools/gendib/gendib.c [iso-8859-1] (original)
+++ trunk/reactos/tools/gendib/gendib.c [iso-8859-1] Wed Mar 4 19:25:22 2009
@@ -877,6 +877,12 @@
{
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");
}
else
@@ -887,6 +893,7 @@
if (32 / Bpp <= Partial + 1)
{
Output(Out, ";\n");
+ Output(Out, "}\n");
}
else
{