- Use a global trivial CLIPOBJ if a NULL one is passed
- Don't pass a pointer to uninitialized memory to DrvBitBlt

svn path=/trunk/; revision=57007
This commit is contained in:
Timo Kreuzer 2012-07-31 18:53:17 +00:00
parent 1896c7326a
commit 299f58b5fa
4 changed files with 26 additions and 6 deletions

View file

@ -12,6 +12,12 @@
#define NDEBUG
#include <debug.h>
XCLIPOBJ gxcoTrivial =
{
{0, {LONG_MIN, LONG_MIN, LONG_MAX, LONG_MAX}, DC_TRIVIAL, FC_RECT, TC_RECTANGLES, 0},
0, 0, 0
};
typedef BOOLEAN (APIENTRY *PBLTRECTFUNC)(SURFOBJ* OutputObj,
SURFOBJ* InputObj,
SURFOBJ* Mask,
@ -590,6 +596,8 @@ IntEngBitBlt(
if (pco->iDComplexity == DC_RECT)
pco = NULL;
}
else
pco = &gxcoTrivial.ClipObj;
if (ROP4_USES_SOURCE(Rop4))
{
@ -601,6 +609,7 @@ IntEngBitBlt(
rclSrc.top = pptlSrc->y + rclClipped.top - prclTrg->top;
rclSrc.right = rclSrc.left + rclClipped.right - rclClipped.left;
rclSrc.bottom = rclSrc.top + rclClipped.bottom - rclClipped.top;
pptlSrc = (PPOINTL)&rclSrc;
}
else
{
@ -647,7 +656,7 @@ IntEngBitBlt(
pco,
pxlo,
&rclClipped,
(POINTL*)&rclSrc,
pptlSrc,
pptlMask,
pbo,
pptlBrush ? &ptlBrush : NULL,

View file

@ -5,9 +5,12 @@ DBG_DEFAULT_CHANNEL(GdiFont);
#define SURFOBJ_flags(pso) (CONTAINING_RECORD(pso, SURFACE, SurfObj)->flags)
#define XCLIPOBJ CLIPGDI
XCLIPOBJ gxcoTrivial;
// FIXME this needs to be updated, once we use the new structure
XCLIPOBJ gxcoTrivial =
{
{0, {LONG_MIN, LONG_MIN, LONG_MAX, LONG_MAX}, DC_TRIVIAL, FC_RECT, TC_RECTANGLES, 0},
0, 0, 0
};
static

View file

@ -75,6 +75,11 @@ typedef struct _CLIPGDI {
ENUMRECTS EnumRects;
} CLIPGDI, *PCLIPGDI;
// HACK, until we use the original structure
#define XCLIPOBJ CLIPGDI
extern XCLIPOBJ gxcoTrivial;
/*ei What is this for? */
typedef struct _DRVFUNCTIONSGDI {
HDEV hdev;

View file

@ -1,4 +1,4 @@
/*
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* PURPOSE: GDI TransparentBlt Function
@ -226,6 +226,9 @@ IntEngTransparentBlt(SURFOBJ *psoDest,
ASSERT(psurfDest);
ASSERT(psurfSource);
/* If no clip object is given, use trivial one */
if (!Clip) Clip = &gxcoTrivial.ClipObj;
InputClippedRect = *DestRect;
if(InputClippedRect.right < InputClippedRect.left)
{
@ -241,7 +244,7 @@ IntEngTransparentBlt(SURFOBJ *psoDest,
InputRect = *SourceRect;
/* Clip against the bounds of the clipping region so we won't try to write
* outside the surface */
if(Clip)
if (Clip->iDComplexity != DC_TRIVIAL)
{
if(!RECTL_bIntersectRect(&OutputRect, &InputClippedRect, &Clip->rclBounds))
{