mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 06:33:01 +00:00
Exclusively lock surface bits before reading or writing them
svn path=/trunk/; revision=16143
This commit is contained in:
parent
113cab2be5
commit
59057f2e70
20 changed files with 367 additions and 187 deletions
|
@ -11,10 +11,12 @@ typedef struct _BITMAPOBJ
|
||||||
SURFOBJ SurfObj;
|
SURFOBJ SurfObj;
|
||||||
FLONG flHooks;
|
FLONG flHooks;
|
||||||
FLONG flFlags;
|
FLONG flFlags;
|
||||||
SIZE dimension; /* For SetBitmapDimension(), do NOT use
|
SIZE dimension; /* For SetBitmapDimension(), do NOT use
|
||||||
to get width/height of bitmap, use
|
to get width/height of bitmap, use
|
||||||
bitmap.bmWidth/bitmap.bmHeight for
|
bitmap.bmWidth/bitmap.bmHeight for
|
||||||
that */
|
that */
|
||||||
|
PFAST_MUTEX BitsLock; /* You need to hold this lock before you touch
|
||||||
|
the actual bits in the bitmap */
|
||||||
|
|
||||||
/* For device-independent bitmaps: */
|
/* For device-independent bitmaps: */
|
||||||
DIBSECTION *dib;
|
DIBSECTION *dib;
|
||||||
|
@ -34,6 +36,11 @@ typedef struct _BITMAPOBJ
|
||||||
#define BITMAPOBJ_UnlockBitmap(pBMObj) EngUnlockSurface(&pBMObj->SurfObj)
|
#define BITMAPOBJ_UnlockBitmap(pBMObj) EngUnlockSurface(&pBMObj->SurfObj)
|
||||||
BOOL INTERNAL_CALL BITMAP_Cleanup(PVOID ObjectBody);
|
BOOL INTERNAL_CALL BITMAP_Cleanup(PVOID ObjectBody);
|
||||||
|
|
||||||
|
BOOL INTERNAL_CALL BITMAPOBJ_InitBitsLock(BITMAPOBJ *pBMObj);
|
||||||
|
#define BITMAPOBJ_LockBitmapBits(pBMObj) ExAcquireFastMutex((pBMObj)->BitsLock)
|
||||||
|
#define BITMAPOBJ_UnlockBitmapBits(pBMObj) ExReleaseFastMutex((pBMObj)->BitsLock)
|
||||||
|
void INTERNAL_CALL BITMAPOBJ_CleanupBitsLock(BITMAPOBJ *pBMObj);
|
||||||
|
|
||||||
INT FASTCALL BITMAPOBJ_GetWidthBytes (INT bmWidth, INT bpp);
|
INT FASTCALL BITMAPOBJ_GetWidthBytes (INT bmWidth, INT bpp);
|
||||||
HBITMAP FASTCALL BITMAPOBJ_CopyBitmap (HBITMAP hBitmap);
|
HBITMAP FASTCALL BITMAPOBJ_CopyBitmap (HBITMAP hBitmap);
|
||||||
INT FASTCALL DIB_GetDIBWidthBytes (INT width, INT depth);
|
INT FASTCALL DIB_GetDIBWidthBytes (INT width, INT depth);
|
||||||
|
|
|
@ -526,30 +526,30 @@ EngBitBlt(SURFOBJ *DestObj,
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL STDCALL
|
BOOL STDCALL
|
||||||
IntEngBitBlt(BITMAPOBJ *DestObj,
|
IntEngBitBltEx(SURFOBJ *DestSurf,
|
||||||
BITMAPOBJ *SourceObj,
|
SURFOBJ *SourceSurf,
|
||||||
BITMAPOBJ *MaskObj,
|
SURFOBJ *MaskSurf,
|
||||||
CLIPOBJ *ClipRegion,
|
CLIPOBJ *ClipRegion,
|
||||||
XLATEOBJ *ColorTranslation,
|
XLATEOBJ *ColorTranslation,
|
||||||
RECTL *DestRect,
|
RECTL *DestRect,
|
||||||
POINTL *SourcePoint,
|
POINTL *SourcePoint,
|
||||||
POINTL *MaskOrigin,
|
POINTL *MaskOrigin,
|
||||||
BRUSHOBJ *Brush,
|
BRUSHOBJ *Brush,
|
||||||
POINTL *BrushOrigin,
|
POINTL *BrushOrigin,
|
||||||
ROP4 Rop4)
|
ROP4 Rop4,
|
||||||
|
BOOL RemoveMouse)
|
||||||
{
|
{
|
||||||
BOOLEAN ret;
|
BOOLEAN ret;
|
||||||
RECTL InputClippedRect;
|
RECTL InputClippedRect;
|
||||||
RECTL OutputRect;
|
RECTL OutputRect;
|
||||||
POINTL InputPoint;
|
POINTL InputPoint;
|
||||||
BOOLEAN UsesSource;
|
BOOLEAN UsesSource;
|
||||||
SURFOBJ *DestSurf;
|
BITMAPOBJ *DestObj;
|
||||||
SURFOBJ *SourceSurf = SourceObj ? &SourceObj->SurfObj : NULL;
|
BITMAPOBJ *SourceObj = NULL;
|
||||||
SURFOBJ *MaskSurf = MaskObj ? &MaskObj->SurfObj : NULL;
|
|
||||||
|
|
||||||
ASSERT(DestObj);
|
|
||||||
DestSurf = &DestObj->SurfObj;
|
|
||||||
ASSERT(DestSurf);
|
ASSERT(DestSurf);
|
||||||
|
DestObj = CONTAINING_RECORD(DestSurf, BITMAPOBJ, SurfObj);
|
||||||
|
ASSERT(DestObj);
|
||||||
|
|
||||||
InputClippedRect = *DestRect;
|
InputClippedRect = *DestRect;
|
||||||
if (InputClippedRect.right < InputClippedRect.left)
|
if (InputClippedRect.right < InputClippedRect.left)
|
||||||
|
@ -623,17 +623,27 @@ IntEngBitBlt(BITMAPOBJ *DestObj,
|
||||||
OutputRect = InputClippedRect;
|
OutputRect = InputClippedRect;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UsesSource)
|
if (RemoveMouse)
|
||||||
{
|
{
|
||||||
MouseSafetyOnDrawStart(SourceSurf, InputPoint.x, InputPoint.y,
|
BITMAPOBJ_LockBitmapBits(DestObj);
|
||||||
(InputPoint.x + abs(DestRect->right - DestRect->left)),
|
|
||||||
(InputPoint.y + abs(DestRect->bottom - DestRect->top)));
|
if (UsesSource)
|
||||||
|
{
|
||||||
|
if (SourceSurf != DestSurf)
|
||||||
|
{
|
||||||
|
SourceObj = CONTAINING_RECORD(SourceSurf, BITMAPOBJ, SurfObj);
|
||||||
|
BITMAPOBJ_LockBitmapBits(SourceObj);
|
||||||
|
}
|
||||||
|
MouseSafetyOnDrawStart(SourceSurf, InputPoint.x, InputPoint.y,
|
||||||
|
(InputPoint.x + abs(DestRect->right - DestRect->left)),
|
||||||
|
(InputPoint.y + abs(DestRect->bottom - DestRect->top)));
|
||||||
|
}
|
||||||
|
MouseSafetyOnDrawStart(DestSurf, OutputRect.left, OutputRect.top,
|
||||||
|
OutputRect.right, OutputRect.bottom);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* No success yet */
|
/* No success yet */
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
MouseSafetyOnDrawStart(DestSurf, OutputRect.left, OutputRect.top,
|
|
||||||
OutputRect.right, OutputRect.bottom);
|
|
||||||
|
|
||||||
/* Call the driver's DrvBitBlt if available */
|
/* Call the driver's DrvBitBlt if available */
|
||||||
if (DestObj->flHooks & HOOK_BITBLT)
|
if (DestObj->flHooks & HOOK_BITBLT)
|
||||||
|
@ -651,10 +661,19 @@ IntEngBitBlt(BITMAPOBJ *DestObj,
|
||||||
Rop4);
|
Rop4);
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseSafetyOnDrawEnd(DestSurf);
|
if (RemoveMouse)
|
||||||
if (UsesSource)
|
|
||||||
{
|
{
|
||||||
MouseSafetyOnDrawEnd(SourceSurf);
|
MouseSafetyOnDrawEnd(DestSurf);
|
||||||
|
if (UsesSource)
|
||||||
|
{
|
||||||
|
MouseSafetyOnDrawEnd(SourceSurf);
|
||||||
|
if (SourceSurf != DestSurf)
|
||||||
|
{
|
||||||
|
BITMAPOBJ_UnlockBitmapBits(SourceObj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
BITMAPOBJ_UnlockBitmapBits(DestObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -786,9 +805,9 @@ EngStretchBlt(
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL STDCALL
|
BOOL STDCALL
|
||||||
IntEngStretchBlt(BITMAPOBJ *DestObj,
|
IntEngStretchBlt(SURFOBJ *DestSurf,
|
||||||
BITMAPOBJ *SourceObj,
|
SURFOBJ *SourceSurf,
|
||||||
BITMAPOBJ *MaskObj,
|
SURFOBJ *MaskSurf,
|
||||||
CLIPOBJ *ClipRegion,
|
CLIPOBJ *ClipRegion,
|
||||||
XLATEOBJ *ColorTranslation,
|
XLATEOBJ *ColorTranslation,
|
||||||
RECTL *DestRect,
|
RECTL *DestRect,
|
||||||
|
@ -801,32 +820,37 @@ IntEngStretchBlt(BITMAPOBJ *DestObj,
|
||||||
BOOLEAN ret;
|
BOOLEAN ret;
|
||||||
COLORADJUSTMENT ca;
|
COLORADJUSTMENT ca;
|
||||||
POINT MaskOrigin;
|
POINT MaskOrigin;
|
||||||
SURFOBJ *DestSurf;
|
BITMAPOBJ *DestObj;
|
||||||
SURFOBJ *SourceSurf = SourceObj ? &SourceObj->SurfObj : NULL;
|
BITMAPOBJ *SourceObj = NULL;
|
||||||
SURFOBJ *MaskSurf = MaskObj ? &MaskObj->SurfObj : NULL;
|
|
||||||
|
|
||||||
ASSERT(DestObj);
|
|
||||||
DestSurf = &DestObj->SurfObj;
|
|
||||||
ASSERT(DestSurf);
|
ASSERT(DestSurf);
|
||||||
|
DestObj = CONTAINING_RECORD(DestSurf, BITMAPOBJ, SurfObj);
|
||||||
|
ASSERT(DestObj);
|
||||||
|
|
||||||
if (pMaskOrigin != NULL)
|
if (pMaskOrigin != NULL)
|
||||||
{
|
{
|
||||||
MaskOrigin.x = pMaskOrigin->x; MaskOrigin.y = pMaskOrigin->y;
|
MaskOrigin.x = pMaskOrigin->x; MaskOrigin.y = pMaskOrigin->y;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NULL != SourceSurf)
|
|
||||||
{
|
|
||||||
ASSERT(SourceRect);
|
|
||||||
MouseSafetyOnDrawStart(SourceSurf, SourceRect->left, SourceRect->top,
|
|
||||||
SourceRect->right, SourceRect->bottom);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* No success yet */
|
/* No success yet */
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
ASSERT(DestRect);
|
ASSERT(DestRect);
|
||||||
|
BITMAPOBJ_LockBitmapBits(DestObj);
|
||||||
MouseSafetyOnDrawStart(DestSurf, DestRect->left, DestRect->top,
|
MouseSafetyOnDrawStart(DestSurf, DestRect->left, DestRect->top,
|
||||||
DestRect->right, DestRect->bottom);
|
DestRect->right, DestRect->bottom);
|
||||||
|
|
||||||
|
if (NULL != SourceSurf)
|
||||||
|
{
|
||||||
|
SourceObj = CONTAINING_RECORD(SourceSurf, BITMAPOBJ, SurfObj);
|
||||||
|
ASSERT(SourceRect);
|
||||||
|
if (SourceSurf != DestSurf)
|
||||||
|
{
|
||||||
|
BITMAPOBJ_LockBitmapBits(SourceObj);
|
||||||
|
}
|
||||||
|
MouseSafetyOnDrawStart(SourceSurf, SourceRect->left, SourceRect->top,
|
||||||
|
SourceRect->right, SourceRect->bottom);
|
||||||
|
}
|
||||||
|
|
||||||
/* Prepare color adjustment */
|
/* Prepare color adjustment */
|
||||||
|
|
||||||
/* Call the driver's DrvStretchBlt if available */
|
/* Call the driver's DrvStretchBlt if available */
|
||||||
|
@ -847,11 +871,16 @@ IntEngStretchBlt(BITMAPOBJ *DestObj,
|
||||||
&ca, BrushOrigin, DestRect, SourceRect, NULL, Mode);
|
&ca, BrushOrigin, DestRect, SourceRect, NULL, Mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseSafetyOnDrawEnd(DestSurf);
|
|
||||||
if (NULL != SourceSurf)
|
if (NULL != SourceSurf)
|
||||||
{
|
{
|
||||||
MouseSafetyOnDrawEnd(SourceSurf);
|
MouseSafetyOnDrawEnd(SourceSurf);
|
||||||
|
if (SourceSurf != DestSurf)
|
||||||
|
{
|
||||||
|
BITMAPOBJ_UnlockBitmapBits(SourceObj);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
MouseSafetyOnDrawEnd(DestSurf);
|
||||||
|
BITMAPOBJ_UnlockBitmapBits(DestObj);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -1147,7 +1176,7 @@ EngMaskBitBlt(SURFOBJ *DestObj,
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL STDCALL
|
BOOL STDCALL
|
||||||
IntEngMaskBlt(SURFOBJ *DestObj,
|
IntEngMaskBlt(SURFOBJ *DestSurf,
|
||||||
SURFOBJ *Mask,
|
SURFOBJ *Mask,
|
||||||
CLIPOBJ *ClipRegion,
|
CLIPOBJ *ClipRegion,
|
||||||
XLATEOBJ *DestColorTranslation,
|
XLATEOBJ *DestColorTranslation,
|
||||||
|
@ -1161,6 +1190,7 @@ IntEngMaskBlt(SURFOBJ *DestObj,
|
||||||
BOOLEAN ret;
|
BOOLEAN ret;
|
||||||
RECTL OutputRect;
|
RECTL OutputRect;
|
||||||
POINTL InputPoint;
|
POINTL InputPoint;
|
||||||
|
BITMAPOBJ *DestObj;
|
||||||
|
|
||||||
ASSERT(Mask);
|
ASSERT(Mask);
|
||||||
|
|
||||||
|
@ -1187,26 +1217,30 @@ IntEngMaskBlt(SURFOBJ *DestObj,
|
||||||
|
|
||||||
/* No success yet */
|
/* No success yet */
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
ASSERT(DestObj);
|
ASSERT(DestSurf);
|
||||||
MouseSafetyOnDrawStart(DestObj, OutputRect.left, OutputRect.top,
|
DestObj = CONTAINING_RECORD(DestSurf, BITMAPOBJ, SurfObj);
|
||||||
|
|
||||||
|
BITMAPOBJ_LockBitmapBits(DestObj);
|
||||||
|
MouseSafetyOnDrawStart(DestSurf, OutputRect.left, OutputRect.top,
|
||||||
OutputRect.right, OutputRect.bottom);
|
OutputRect.right, OutputRect.bottom);
|
||||||
|
|
||||||
/* Dummy BitBlt to let driver know that it should flush its changes.
|
/* Dummy BitBlt to let driver know that it should flush its changes.
|
||||||
This should really be done using a call to DrvSynchronizeSurface,
|
This should really be done using a call to DrvSynchronizeSurface,
|
||||||
but the VMware driver doesn't hook that call. */
|
but the VMware driver doesn't hook that call. */
|
||||||
/* FIXME: Remove the typecast! */
|
IntEngBitBltEx(DestSurf, NULL, Mask, ClipRegion, DestColorTranslation,
|
||||||
IntEngBitBlt((BITMAPOBJ*)DestObj, NULL, (BITMAPOBJ*)Mask, ClipRegion, DestColorTranslation,
|
DestRect, SourcePoint, MaskOrigin, Brush, BrushOrigin,
|
||||||
DestRect, SourcePoint, MaskOrigin, Brush, BrushOrigin, R4_NOOP);
|
R4_NOOP, FALSE);
|
||||||
|
|
||||||
ret = EngMaskBitBlt(DestObj, Mask, ClipRegion, DestColorTranslation, SourceColorTranslation,
|
ret = EngMaskBitBlt(DestSurf, Mask, ClipRegion, DestColorTranslation, SourceColorTranslation,
|
||||||
&OutputRect, &InputPoint, MaskOrigin, Brush, BrushOrigin);
|
&OutputRect, &InputPoint, MaskOrigin, Brush, BrushOrigin);
|
||||||
|
|
||||||
/* Dummy BitBlt to let driver know that something has changed. */
|
/* Dummy BitBlt to let driver know that something has changed. */
|
||||||
/* FIXME: Remove the typecast! */
|
IntEngBitBltEx(DestSurf, NULL, Mask, ClipRegion, DestColorTranslation,
|
||||||
IntEngBitBlt((BITMAPOBJ*)DestObj, NULL, (BITMAPOBJ*)Mask, ClipRegion, DestColorTranslation,
|
DestRect, SourcePoint, MaskOrigin, Brush, BrushOrigin,
|
||||||
DestRect, SourcePoint, MaskOrigin, Brush, BrushOrigin, R4_NOOP);
|
R4_NOOP, FALSE);
|
||||||
|
|
||||||
MouseSafetyOnDrawEnd(DestObj);
|
MouseSafetyOnDrawEnd(DestSurf);
|
||||||
|
BITMAPOBJ_UnlockBitmapBits(DestObj);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,8 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id$
|
/*
|
||||||
*
|
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
* PURPOSE: GDI EngCopyBits Function
|
* PURPOSE: GDI EngCopyBits Function
|
||||||
|
@ -44,12 +43,21 @@ EngCopyBits(SURFOBJ *Dest,
|
||||||
RECT_ENUM RectEnum;
|
RECT_ENUM RectEnum;
|
||||||
BOOL EnumMore;
|
BOOL EnumMore;
|
||||||
BLTINFO BltInfo;
|
BLTINFO BltInfo;
|
||||||
|
BITMAPOBJ *DestObj = NULL;
|
||||||
|
BITMAPOBJ *SourceObj;
|
||||||
|
|
||||||
ASSERT(Dest != NULL && Source != NULL && DestRect != NULL && SourcePoint != NULL);
|
ASSERT(Dest != NULL && Source != NULL && DestRect != NULL && SourcePoint != NULL);
|
||||||
|
|
||||||
|
SourceObj = CONTAINING_RECORD(Source, BITMAPOBJ, SurfObj);
|
||||||
|
BITMAPOBJ_LockBitmapBits(SourceObj);
|
||||||
MouseSafetyOnDrawStart(Source, SourcePoint->x, SourcePoint->y,
|
MouseSafetyOnDrawStart(Source, SourcePoint->x, SourcePoint->y,
|
||||||
(SourcePoint->x + abs(DestRect->right - DestRect->left)),
|
(SourcePoint->x + abs(DestRect->right - DestRect->left)),
|
||||||
(SourcePoint->y + abs(DestRect->bottom - DestRect->top)));
|
(SourcePoint->y + abs(DestRect->bottom - DestRect->top)));
|
||||||
|
if (Dest != Source)
|
||||||
|
{
|
||||||
|
DestObj = CONTAINING_RECORD(Dest, BITMAPOBJ, SurfObj);
|
||||||
|
BITMAPOBJ_LockBitmapBits(DestObj);
|
||||||
|
}
|
||||||
MouseSafetyOnDrawStart(Dest, DestRect->left, DestRect->top, DestRect->right, DestRect->bottom);
|
MouseSafetyOnDrawStart(Dest, DestRect->left, DestRect->top, DestRect->right, DestRect->bottom);
|
||||||
|
|
||||||
// FIXME: Don't punt to the driver's DrvCopyBits immediately. Instead,
|
// FIXME: Don't punt to the driver's DrvCopyBits immediately. Instead,
|
||||||
|
@ -71,7 +79,12 @@ EngCopyBits(SURFOBJ *Dest,
|
||||||
Dest, Source, Clip, ColorTranslation, DestRect, SourcePoint);
|
Dest, Source, Clip, ColorTranslation, DestRect, SourcePoint);
|
||||||
|
|
||||||
MouseSafetyOnDrawEnd(Dest);
|
MouseSafetyOnDrawEnd(Dest);
|
||||||
|
if (Dest != Source)
|
||||||
|
{
|
||||||
|
BITMAPOBJ_UnlockBitmapBits(DestObj);
|
||||||
|
}
|
||||||
MouseSafetyOnDrawEnd(Source);
|
MouseSafetyOnDrawEnd(Source);
|
||||||
|
BITMAPOBJ_UnlockBitmapBits(SourceObj);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -88,20 +101,29 @@ EngCopyBits(SURFOBJ *Dest,
|
||||||
Dest, Source, Clip, ColorTranslation, DestRect, SourcePoint);
|
Dest, Source, Clip, ColorTranslation, DestRect, SourcePoint);
|
||||||
|
|
||||||
MouseSafetyOnDrawEnd(Dest);
|
MouseSafetyOnDrawEnd(Dest);
|
||||||
|
if (Dest != Source)
|
||||||
|
{
|
||||||
|
BITMAPOBJ_UnlockBitmapBits(DestObj);
|
||||||
|
}
|
||||||
MouseSafetyOnDrawEnd(Source);
|
MouseSafetyOnDrawEnd(Source);
|
||||||
|
BITMAPOBJ_UnlockBitmapBits(SourceObj);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If CopyBits wasn't hooked, BitBlt must be
|
// If CopyBits wasn't hooked, BitBlt must be
|
||||||
/* FIXME: Remove the typecast! */
|
ret = IntEngBitBlt(Dest, Source,
|
||||||
ret = IntEngBitBlt((BITMAPOBJ*)Dest, (BITMAPOBJ*)Source,
|
|
||||||
NULL, Clip, ColorTranslation, DestRect, SourcePoint,
|
NULL, Clip, ColorTranslation, DestRect, SourcePoint,
|
||||||
NULL, NULL, NULL, ROP3_TO_ROP4(SRCCOPY));
|
NULL, NULL, NULL, ROP3_TO_ROP4(SRCCOPY));
|
||||||
|
|
||||||
MouseSafetyOnDrawEnd(Dest);
|
MouseSafetyOnDrawEnd(Dest);
|
||||||
|
if (Dest != Source)
|
||||||
|
{
|
||||||
|
BITMAPOBJ_UnlockBitmapBits(DestObj);
|
||||||
|
}
|
||||||
MouseSafetyOnDrawEnd(Source);
|
MouseSafetyOnDrawEnd(Source);
|
||||||
|
BITMAPOBJ_UnlockBitmapBits(SourceObj);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -130,7 +152,12 @@ EngCopyBits(SURFOBJ *Dest,
|
||||||
DibFunctionsForBitmapFormat[Dest->iBitmapFormat].DIB_BitBltSrcCopy(&BltInfo);
|
DibFunctionsForBitmapFormat[Dest->iBitmapFormat].DIB_BitBltSrcCopy(&BltInfo);
|
||||||
|
|
||||||
MouseSafetyOnDrawEnd(Dest);
|
MouseSafetyOnDrawEnd(Dest);
|
||||||
|
if (Dest != Source)
|
||||||
|
{
|
||||||
|
BITMAPOBJ_UnlockBitmapBits(DestObj);
|
||||||
|
}
|
||||||
MouseSafetyOnDrawEnd(Source);
|
MouseSafetyOnDrawEnd(Source);
|
||||||
|
BITMAPOBJ_UnlockBitmapBits(SourceObj);
|
||||||
|
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
|
|
||||||
|
@ -144,7 +171,12 @@ EngCopyBits(SURFOBJ *Dest,
|
||||||
DibFunctionsForBitmapFormat[Dest->iBitmapFormat].DIB_BitBltSrcCopy(&BltInfo);
|
DibFunctionsForBitmapFormat[Dest->iBitmapFormat].DIB_BitBltSrcCopy(&BltInfo);
|
||||||
|
|
||||||
MouseSafetyOnDrawEnd(Dest);
|
MouseSafetyOnDrawEnd(Dest);
|
||||||
|
if (Dest != Source)
|
||||||
|
{
|
||||||
|
BITMAPOBJ_UnlockBitmapBits(DestObj);
|
||||||
|
}
|
||||||
MouseSafetyOnDrawEnd(Source);
|
MouseSafetyOnDrawEnd(Source);
|
||||||
|
BITMAPOBJ_UnlockBitmapBits(SourceObj);
|
||||||
|
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
|
|
||||||
|
@ -177,13 +209,23 @@ EngCopyBits(SURFOBJ *Dest,
|
||||||
} while(EnumMore);
|
} while(EnumMore);
|
||||||
|
|
||||||
MouseSafetyOnDrawEnd(Dest);
|
MouseSafetyOnDrawEnd(Dest);
|
||||||
|
if (Dest != Source)
|
||||||
|
{
|
||||||
|
BITMAPOBJ_UnlockBitmapBits(DestObj);
|
||||||
|
}
|
||||||
MouseSafetyOnDrawEnd(Source);
|
MouseSafetyOnDrawEnd(Source);
|
||||||
|
BITMAPOBJ_UnlockBitmapBits(SourceObj);
|
||||||
|
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseSafetyOnDrawEnd(Dest);
|
MouseSafetyOnDrawEnd(Dest);
|
||||||
|
if (Dest != Source)
|
||||||
|
{
|
||||||
|
BITMAPOBJ_UnlockBitmapBits(DestObj);
|
||||||
|
}
|
||||||
MouseSafetyOnDrawEnd(Source);
|
MouseSafetyOnDrawEnd(Source);
|
||||||
|
BITMAPOBJ_UnlockBitmapBits(SourceObj);
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -516,7 +516,7 @@ EngGradientFill(
|
||||||
|
|
||||||
BOOL STDCALL
|
BOOL STDCALL
|
||||||
IntEngGradientFill(
|
IntEngGradientFill(
|
||||||
IN BITMAPOBJ *pboDest,
|
IN SURFOBJ *psoDest,
|
||||||
IN CLIPOBJ *pco,
|
IN CLIPOBJ *pco,
|
||||||
IN XLATEOBJ *pxlo,
|
IN XLATEOBJ *pxlo,
|
||||||
IN TRIVERTEX *pVertex,
|
IN TRIVERTEX *pVertex,
|
||||||
|
@ -528,13 +528,14 @@ IntEngGradientFill(
|
||||||
IN ULONG ulMode)
|
IN ULONG ulMode)
|
||||||
{
|
{
|
||||||
BOOL Ret;
|
BOOL Ret;
|
||||||
SURFOBJ *psoDest;
|
BITMAPOBJ *pboDest;
|
||||||
ASSERT(pboDest);
|
ASSERT(psoDest);
|
||||||
ASSERT(pco);
|
ASSERT(pco);
|
||||||
|
|
||||||
psoDest = &pboDest->SurfObj;
|
pboDest = CONTAINING_RECORD(psoDest, BITMAPOBJ, SurfObj);
|
||||||
ASSERT(psoDest);
|
ASSERT(pboDest);
|
||||||
|
|
||||||
|
BITMAPOBJ_LockBitmapBits(pboDest);
|
||||||
MouseSafetyOnDrawStart(
|
MouseSafetyOnDrawStart(
|
||||||
psoDest,
|
psoDest,
|
||||||
pco->rclBounds.left,
|
pco->rclBounds.left,
|
||||||
|
@ -552,5 +553,7 @@ 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);
|
||||||
MouseSafetyOnDrawEnd(psoDest);
|
MouseSafetyOnDrawEnd(psoDest);
|
||||||
|
BITMAPOBJ_UnlockBitmapBits(pboDest);
|
||||||
|
|
||||||
return Ret;
|
return Ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -485,7 +485,7 @@ EngLineTo(SURFOBJ *DestObj,
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL STDCALL
|
BOOL STDCALL
|
||||||
IntEngLineTo(BITMAPOBJ *DestObj,
|
IntEngLineTo(SURFOBJ *DestSurf,
|
||||||
CLIPOBJ *ClipObj,
|
CLIPOBJ *ClipObj,
|
||||||
BRUSHOBJ *Brush,
|
BRUSHOBJ *Brush,
|
||||||
LONG x1,
|
LONG x1,
|
||||||
|
@ -496,13 +496,13 @@ IntEngLineTo(BITMAPOBJ *DestObj,
|
||||||
MIX Mix)
|
MIX Mix)
|
||||||
{
|
{
|
||||||
BOOLEAN ret;
|
BOOLEAN ret;
|
||||||
SURFOBJ *DestSurf;
|
BITMAPOBJ *DestObj;
|
||||||
PGDIBRUSHINST GdiBrush;
|
PGDIBRUSHINST GdiBrush;
|
||||||
RECTL b;
|
RECTL b;
|
||||||
|
|
||||||
ASSERT(DestObj);
|
|
||||||
DestSurf = &DestObj->SurfObj;
|
|
||||||
ASSERT(DestSurf);
|
ASSERT(DestSurf);
|
||||||
|
DestObj = CONTAINING_RECORD(DestSurf, BITMAPOBJ, SurfObj);
|
||||||
|
ASSERT(DestObj);
|
||||||
|
|
||||||
GdiBrush = CONTAINING_RECORD(
|
GdiBrush = CONTAINING_RECORD(
|
||||||
Brush,
|
Brush,
|
||||||
|
@ -543,6 +543,8 @@ IntEngLineTo(BITMAPOBJ *DestObj,
|
||||||
b.bottom = max(y1, y2);
|
b.bottom = max(y1, y2);
|
||||||
if (b.left == b.right) b.right++;
|
if (b.left == b.right) b.right++;
|
||||||
if (b.top == b.bottom) b.bottom++;
|
if (b.top == b.bottom) b.bottom++;
|
||||||
|
|
||||||
|
BITMAPOBJ_LockBitmapBits(DestObj);
|
||||||
MouseSafetyOnDrawStart(DestSurf, x1, y1, x2, y2);
|
MouseSafetyOnDrawStart(DestSurf, x1, y1, x2, y2);
|
||||||
|
|
||||||
if (DestObj->flHooks & HOOK_LINETO)
|
if (DestObj->flHooks & HOOK_LINETO)
|
||||||
|
@ -565,12 +567,13 @@ IntEngLineTo(BITMAPOBJ *DestObj,
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseSafetyOnDrawEnd(DestSurf);
|
MouseSafetyOnDrawEnd(DestSurf);
|
||||||
|
BITMAPOBJ_UnlockBitmapBits(DestObj);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL STDCALL
|
BOOL STDCALL
|
||||||
IntEngPolyline(BITMAPOBJ *DestObj,
|
IntEngPolyline(SURFOBJ *DestSurf,
|
||||||
CLIPOBJ *Clip,
|
CLIPOBJ *Clip,
|
||||||
BRUSHOBJ *Brush,
|
BRUSHOBJ *Brush,
|
||||||
CONST LPPOINT pt,
|
CONST LPPOINT pt,
|
||||||
|
@ -588,7 +591,7 @@ IntEngPolyline(BITMAPOBJ *DestObj,
|
||||||
rect.top = min(pt[i-1].y, pt[i].y);
|
rect.top = min(pt[i-1].y, pt[i].y);
|
||||||
rect.right = max(pt[i-1].x, pt[i].x);
|
rect.right = max(pt[i-1].x, pt[i].x);
|
||||||
rect.bottom = max(pt[i-1].y, pt[i].y);
|
rect.bottom = max(pt[i-1].y, pt[i].y);
|
||||||
ret = IntEngLineTo(DestObj,
|
ret = IntEngLineTo(DestSurf,
|
||||||
Clip,
|
Clip,
|
||||||
Brush,
|
Brush,
|
||||||
pt[i-1].x,
|
pt[i-1].x,
|
||||||
|
|
|
@ -177,8 +177,9 @@ IntHideMousePointer(GDIDEVICE *ppdev, SURFOBJ *DestSurface)
|
||||||
{
|
{
|
||||||
if((MaskSurface = EngLockSurface(pgp->MaskSurface)))
|
if((MaskSurface = EngLockSurface(pgp->MaskSurface)))
|
||||||
{
|
{
|
||||||
EngBitBlt(DestSurface, SaveSurface, MaskSurface, NULL, NULL,
|
IntEngBitBltEx(DestSurface, SaveSurface, MaskSurface, NULL, NULL,
|
||||||
&DestRect, &SrcPoint, &SrcPoint, NULL, NULL, ROP3_TO_ROP4(SRCCOPY));
|
&DestRect, &SrcPoint, &SrcPoint, NULL, NULL,
|
||||||
|
ROP3_TO_ROP4(SRCCOPY), FALSE);
|
||||||
EngUnlockSurface(MaskSurface);
|
EngUnlockSurface(MaskSurface);
|
||||||
}
|
}
|
||||||
EngUnlockSurface(SaveSurface);
|
EngUnlockSurface(SaveSurface);
|
||||||
|
@ -230,8 +231,9 @@ IntShowMousePointer(GDIDEVICE *ppdev, SURFOBJ *DestSurface)
|
||||||
pgp->Size.cy,
|
pgp->Size.cy,
|
||||||
DestSurface->sizlBitmap.cy - pt.y);
|
DestSurface->sizlBitmap.cy - pt.y);
|
||||||
|
|
||||||
EngBitBlt(SaveSurface, DestSurface, NULL, NULL, NULL,
|
IntEngBitBltEx(SaveSurface, DestSurface, NULL, NULL, NULL,
|
||||||
&DestRect, &SrcPoint, NULL, NULL, NULL, ROP3_TO_ROP4(SRCCOPY));
|
&DestRect, &SrcPoint, NULL, NULL, NULL,
|
||||||
|
ROP3_TO_ROP4(SRCCOPY), FALSE);
|
||||||
EngUnlockSurface(SaveSurface);
|
EngUnlockSurface(SaveSurface);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -266,18 +268,21 @@ IntShowMousePointer(GDIDEVICE *ppdev, SURFOBJ *DestSurface)
|
||||||
{
|
{
|
||||||
if((ColorSurf = EngLockSurface(pgp->ColorSurface)))
|
if((ColorSurf = EngLockSurface(pgp->ColorSurface)))
|
||||||
{
|
{
|
||||||
EngBitBlt(DestSurface, ColorSurf, MaskSurf, NULL, pgp->XlateObject,
|
IntEngBitBltEx(DestSurface, ColorSurf, MaskSurf, NULL,
|
||||||
&DestRect, &SrcPoint, &SrcPoint, NULL, NULL, R4_MASK);
|
pgp->XlateObject, &DestRect, &SrcPoint, &SrcPoint,
|
||||||
|
NULL, NULL, R4_MASK, FALSE);
|
||||||
EngUnlockSurface(ColorSurf);
|
EngUnlockSurface(ColorSurf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
EngBitBlt(DestSurface, MaskSurf, NULL, NULL, pgp->XlateObject,
|
IntEngBitBltEx(DestSurface, MaskSurf, NULL, NULL, pgp->XlateObject,
|
||||||
&DestRect, &SrcPoint, NULL, NULL, NULL, ROP3_TO_ROP4(SRCAND));
|
&DestRect, &SrcPoint, NULL, NULL, NULL,
|
||||||
|
ROP3_TO_ROP4(SRCAND), FALSE);
|
||||||
SrcPoint.y += pgp->Size.cy;
|
SrcPoint.y += pgp->Size.cy;
|
||||||
EngBitBlt(DestSurface, MaskSurf, NULL, NULL, pgp->XlateObject,
|
IntEngBitBltEx(DestSurface, MaskSurf, NULL, NULL, pgp->XlateObject,
|
||||||
&DestRect, &SrcPoint, NULL, NULL, NULL, ROP3_TO_ROP4(SRCINVERT));
|
&DestRect, &SrcPoint, NULL, NULL, NULL,
|
||||||
|
ROP3_TO_ROP4(SRCINVERT), FALSE);
|
||||||
}
|
}
|
||||||
EngUnlockSurface(MaskSurf);
|
EngUnlockSurface(MaskSurf);
|
||||||
}
|
}
|
||||||
|
@ -523,4 +528,25 @@ EngMovePointer(
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VOID STDCALL
|
||||||
|
IntEngMovePointer(
|
||||||
|
IN SURFOBJ *SurfObj,
|
||||||
|
IN LONG x,
|
||||||
|
IN LONG y,
|
||||||
|
IN RECTL *prcl)
|
||||||
|
{
|
||||||
|
BITMAPOBJ *BitmapObj = CONTAINING_RECORD(SurfObj, BITMAPOBJ, SurfObj);
|
||||||
|
|
||||||
|
BITMAPOBJ_LockBitmapBits(BitmapObj);
|
||||||
|
if (GDIDEV(SurfObj)->Pointer.MovePointer)
|
||||||
|
{
|
||||||
|
GDIDEV(SurfObj)->Pointer.MovePointer(SurfObj, x, y, prcl);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
EngMovePointer(SurfObj, x, y, prcl);
|
||||||
|
}
|
||||||
|
BITMAPOBJ_UnlockBitmapBits(BitmapObj);
|
||||||
|
}
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -33,9 +33,12 @@ BOOL STDCALL FillSolid(SURFOBJ *Surface, PRECTL pRect, ULONG iColor)
|
||||||
{
|
{
|
||||||
LONG y;
|
LONG y;
|
||||||
ULONG LineWidth;
|
ULONG LineWidth;
|
||||||
|
BITMAPOBJ *BitmapObj;
|
||||||
|
|
||||||
ASSERT ( Surface );
|
ASSERT ( Surface );
|
||||||
ASSERT ( pRect );
|
ASSERT ( pRect );
|
||||||
|
BitmapObj = CONTAINING_RECORD(Surface, BITMAPOBJ, SurfObj);
|
||||||
|
BITMAPOBJ_LockBitmapBits(BitmapObj);
|
||||||
MouseSafetyOnDrawStart(Surface, pRect->left, pRect->top, pRect->right, pRect->bottom);
|
MouseSafetyOnDrawStart(Surface, pRect->left, pRect->top, pRect->right, pRect->bottom);
|
||||||
LineWidth = pRect->right - pRect->left;
|
LineWidth = pRect->right - pRect->left;
|
||||||
DPRINT(" LineWidth: %d, top: %d, bottom: %d\n", LineWidth, pRect->top, pRect->bottom);
|
DPRINT(" LineWidth: %d, top: %d, bottom: %d\n", LineWidth, pRect->top, pRect->bottom);
|
||||||
|
@ -45,6 +48,7 @@ BOOL STDCALL FillSolid(SURFOBJ *Surface, PRECTL pRect, ULONG iColor)
|
||||||
Surface, pRect->left, pRect->right, y, iColor);
|
Surface, pRect->left, pRect->right, y, iColor);
|
||||||
}
|
}
|
||||||
MouseSafetyOnDrawEnd(Surface);
|
MouseSafetyOnDrawEnd(Surface);
|
||||||
|
BITMAPOBJ_UnlockBitmapBits(BitmapObj);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -111,13 +115,13 @@ EngPaint(IN SURFOBJ *Surface,
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL STDCALL
|
BOOL STDCALL
|
||||||
IntEngPaint(IN BITMAPOBJ *BitmapObj,
|
IntEngPaint(IN SURFOBJ *Surface,
|
||||||
IN CLIPOBJ *ClipRegion,
|
IN CLIPOBJ *ClipRegion,
|
||||||
IN BRUSHOBJ *Brush,
|
IN BRUSHOBJ *Brush,
|
||||||
IN POINTL *BrushOrigin,
|
IN POINTL *BrushOrigin,
|
||||||
IN MIX Mix)
|
IN MIX Mix)
|
||||||
{
|
{
|
||||||
SURFOBJ *Surface = &BitmapObj->SurfObj;
|
BITMAPOBJ *BitmapObj = CONTAINING_RECORD(Surface, BITMAPOBJ, SurfObj);
|
||||||
BOOL ret;
|
BOOL ret;
|
||||||
|
|
||||||
DPRINT("SurfGDI type: %d\n", Surface->iType);
|
DPRINT("SurfGDI type: %d\n", Surface->iType);
|
||||||
|
@ -125,6 +129,7 @@ IntEngPaint(IN BITMAPOBJ *BitmapObj,
|
||||||
if((Surface->iType!=STYPE_BITMAP) && (BitmapObj->flHooks & HOOK_PAINT))
|
if((Surface->iType!=STYPE_BITMAP) && (BitmapObj->flHooks & HOOK_PAINT))
|
||||||
{
|
{
|
||||||
// Call the driver's DrvPaint
|
// Call the driver's DrvPaint
|
||||||
|
BITMAPOBJ_LockBitmapBits(BitmapObj);
|
||||||
MouseSafetyOnDrawStart(Surface, ClipRegion->rclBounds.left,
|
MouseSafetyOnDrawStart(Surface, ClipRegion->rclBounds.left,
|
||||||
ClipRegion->rclBounds.top, ClipRegion->rclBounds.right,
|
ClipRegion->rclBounds.top, ClipRegion->rclBounds.right,
|
||||||
ClipRegion->rclBounds.bottom);
|
ClipRegion->rclBounds.bottom);
|
||||||
|
@ -132,6 +137,7 @@ IntEngPaint(IN BITMAPOBJ *BitmapObj,
|
||||||
ret = GDIDEVFUNCS(Surface).Paint(
|
ret = GDIDEVFUNCS(Surface).Paint(
|
||||||
Surface, ClipRegion, Brush, BrushOrigin, Mix);
|
Surface, ClipRegion, Brush, BrushOrigin, Mix);
|
||||||
MouseSafetyOnDrawEnd(Surface);
|
MouseSafetyOnDrawEnd(Surface);
|
||||||
|
BITMAPOBJ_UnlockBitmapBits(BitmapObj);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
return EngPaint( Surface, ClipRegion, Brush, BrushOrigin, Mix );
|
return EngPaint( Surface, ClipRegion, Brush, BrushOrigin, Mix );
|
||||||
|
|
|
@ -79,6 +79,33 @@ ULONG FASTCALL BitmapFormat(WORD Bits, DWORD Compression)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOL INTERNAL_CALL
|
||||||
|
BITMAPOBJ_InitBitsLock(BITMAPOBJ *BitmapObj)
|
||||||
|
{
|
||||||
|
BitmapObj->BitsLock = ExAllocatePoolWithTag(NonPagedPool,
|
||||||
|
sizeof(FAST_MUTEX),
|
||||||
|
TAG_BITMAPOBJ);
|
||||||
|
if (NULL == BitmapObj->BitsLock)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
ExInitializeFastMutex(BitmapObj->BitsLock);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void INTERNAL_CALL
|
||||||
|
BITMAPOBJ_CleanupBitsLock(BITMAPOBJ *BitmapObj)
|
||||||
|
{
|
||||||
|
if (NULL != BitmapObj->BitsLock)
|
||||||
|
{
|
||||||
|
ExFreePoolWithTag(BitmapObj->BitsLock, TAG_BITMAPOBJ);
|
||||||
|
BitmapObj->BitsLock = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
@ -232,6 +259,12 @@ IntCreateBitmap(IN SIZEL Size,
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
BitmapObj = BITMAPOBJ_LockBitmap(NewBitmap);
|
BitmapObj = BITMAPOBJ_LockBitmap(NewBitmap);
|
||||||
|
if (! BITMAPOBJ_InitBitsLock(BitmapObj))
|
||||||
|
{
|
||||||
|
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||||
|
BITMAPOBJ_FreeBitmap(NewBitmap);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
SurfObj = &BitmapObj->SurfObj;
|
SurfObj = &BitmapObj->SurfObj;
|
||||||
|
|
||||||
if (Format == BMF_4RLE)
|
if (Format == BMF_4RLE)
|
||||||
|
@ -357,11 +390,17 @@ EngCreateDeviceSurface(IN DHSURF dhsurf,
|
||||||
if (NewSurface == NULL)
|
if (NewSurface == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
GDIOBJ_SetOwnership(NewSurface, NULL);
|
|
||||||
|
|
||||||
BitmapObj = BITMAPOBJ_LockBitmap(NewSurface);
|
BitmapObj = BITMAPOBJ_LockBitmap(NewSurface);
|
||||||
|
if (! BITMAPOBJ_InitBitsLock(BitmapObj))
|
||||||
|
{
|
||||||
|
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||||
|
BITMAPOBJ_FreeBitmap(NewSurface);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
SurfObj = &BitmapObj->SurfObj;
|
SurfObj = &BitmapObj->SurfObj;
|
||||||
|
|
||||||
|
GDIOBJ_SetOwnership(NewSurface, NULL);
|
||||||
|
|
||||||
SurfObj->dhsurf = dhsurf;
|
SurfObj->dhsurf = dhsurf;
|
||||||
SurfObj->hsurf = NewSurface;
|
SurfObj->hsurf = NewSurface;
|
||||||
SurfObj->sizlBitmap = Size;
|
SurfObj->sizlBitmap = Size;
|
||||||
|
|
|
@ -193,8 +193,8 @@ EngTransparentBlt(SURFOBJ *Dest,
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL FASTCALL
|
BOOL FASTCALL
|
||||||
IntEngTransparentBlt(BITMAPOBJ *DestObj,
|
IntEngTransparentBlt(SURFOBJ *DestSurf,
|
||||||
BITMAPOBJ *SourceObj,
|
SURFOBJ *SourceSurf,
|
||||||
CLIPOBJ *Clip,
|
CLIPOBJ *Clip,
|
||||||
XLATEOBJ *ColorTranslation,
|
XLATEOBJ *ColorTranslation,
|
||||||
PRECTL DestRect,
|
PRECTL DestRect,
|
||||||
|
@ -204,18 +204,18 @@ IntEngTransparentBlt(BITMAPOBJ *DestObj,
|
||||||
{
|
{
|
||||||
BOOL Ret;
|
BOOL Ret;
|
||||||
RECTL OutputRect, InputClippedRect;
|
RECTL OutputRect, InputClippedRect;
|
||||||
SURFOBJ *DestSurf;
|
BITMAPOBJ *DestObj;
|
||||||
SURFOBJ *SourceSurf;
|
BITMAPOBJ *SourceObj;
|
||||||
|
|
||||||
ASSERT(DestObj);
|
|
||||||
ASSERT(SourceObj);
|
|
||||||
ASSERT(DestRect);
|
|
||||||
|
|
||||||
DestSurf = &DestObj->SurfObj;
|
|
||||||
SourceSurf = &SourceObj->SurfObj;
|
|
||||||
|
|
||||||
ASSERT(DestSurf);
|
ASSERT(DestSurf);
|
||||||
ASSERT(SourceSurf);
|
ASSERT(SourceSurf);
|
||||||
|
ASSERT(DestRect);
|
||||||
|
|
||||||
|
DestObj = CONTAINING_RECORD(DestSurf, BITMAPOBJ, SurfObj);
|
||||||
|
SourceObj = CONTAINING_RECORD(SourceSurf, BITMAPOBJ, SurfObj);
|
||||||
|
|
||||||
|
ASSERT(DestObj);
|
||||||
|
ASSERT(SourceObj);
|
||||||
|
|
||||||
InputClippedRect = *DestRect;
|
InputClippedRect = *DestRect;
|
||||||
if(InputClippedRect.right < InputClippedRect.left)
|
if(InputClippedRect.right < InputClippedRect.left)
|
||||||
|
@ -249,9 +249,11 @@ IntEngTransparentBlt(BITMAPOBJ *DestObj,
|
||||||
|
|
||||||
if(SourceSurf != DestSurf)
|
if(SourceSurf != DestSurf)
|
||||||
{
|
{
|
||||||
|
BITMAPOBJ_LockBitmapBits(SourceObj);
|
||||||
MouseSafetyOnDrawStart(SourceSurf, SourceRect->left, SourceRect->top,
|
MouseSafetyOnDrawStart(SourceSurf, SourceRect->left, SourceRect->top,
|
||||||
SourceRect->right, SourceRect->bottom);
|
SourceRect->right, SourceRect->bottom);
|
||||||
}
|
}
|
||||||
|
BITMAPOBJ_LockBitmapBits(DestObj);
|
||||||
MouseSafetyOnDrawStart(DestSurf, OutputRect.left, OutputRect.top,
|
MouseSafetyOnDrawStart(DestSurf, OutputRect.left, OutputRect.top,
|
||||||
OutputRect.right, OutputRect.bottom);
|
OutputRect.right, OutputRect.bottom);
|
||||||
|
|
||||||
|
@ -271,9 +273,11 @@ IntEngTransparentBlt(BITMAPOBJ *DestObj,
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseSafetyOnDrawEnd(DestSurf);
|
MouseSafetyOnDrawEnd(DestSurf);
|
||||||
|
BITMAPOBJ_UnlockBitmapBits(DestObj);
|
||||||
if(SourceSurf != DestSurf)
|
if(SourceSurf != DestSurf)
|
||||||
{
|
{
|
||||||
MouseSafetyOnDrawEnd(SourceSurf);
|
MouseSafetyOnDrawEnd(SourceSurf);
|
||||||
|
BITMAPOBJ_UnlockBitmapBits(SourceObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Ret;
|
return Ret;
|
||||||
|
|
|
@ -43,7 +43,7 @@ IntEngCleanupDriverObjs(struct _EPROCESS *Process,
|
||||||
PW32PROCESS Win32Process);
|
PW32PROCESS Win32Process);
|
||||||
|
|
||||||
BOOL STDCALL
|
BOOL STDCALL
|
||||||
IntEngLineTo(BITMAPOBJ *Surface,
|
IntEngLineTo(SURFOBJ *Surface,
|
||||||
CLIPOBJ *Clip,
|
CLIPOBJ *Clip,
|
||||||
BRUSHOBJ *Brush,
|
BRUSHOBJ *Brush,
|
||||||
LONG x1,
|
LONG x1,
|
||||||
|
@ -54,22 +54,29 @@ IntEngLineTo(BITMAPOBJ *Surface,
|
||||||
MIX mix);
|
MIX mix);
|
||||||
|
|
||||||
BOOL STDCALL
|
BOOL STDCALL
|
||||||
IntEngBitBlt(BITMAPOBJ *DestObj,
|
IntEngBitBltEx(SURFOBJ *DestObj,
|
||||||
BITMAPOBJ *SourceObj,
|
SURFOBJ *SourceObj,
|
||||||
BITMAPOBJ *Mask,
|
SURFOBJ *Mask,
|
||||||
CLIPOBJ *ClipRegion,
|
CLIPOBJ *ClipRegion,
|
||||||
XLATEOBJ *ColorTranslation,
|
XLATEOBJ *ColorTranslation,
|
||||||
RECTL *DestRect,
|
RECTL *DestRect,
|
||||||
POINTL *SourcePoint,
|
POINTL *SourcePoint,
|
||||||
POINTL *MaskOrigin,
|
POINTL *MaskOrigin,
|
||||||
BRUSHOBJ *Brush,
|
BRUSHOBJ *Brush,
|
||||||
POINTL *BrushOrigin,
|
POINTL *BrushOrigin,
|
||||||
ROP4 rop4);
|
ROP4 Rop4,
|
||||||
|
BOOL RemoveMouse);
|
||||||
|
#define IntEngBitBlt(DestObj, SourceObj, Mask, ClipRegion, ColorTranslation, \
|
||||||
|
DestRect, SourcePoint, MaskOrigin, Brush, BrushOrigin, \
|
||||||
|
Rop4) \
|
||||||
|
IntEngBitBltEx((DestObj), (SourceObj), (Mask), (ClipRegion), \
|
||||||
|
(ColorTranslation), (DestRect), (SourcePoint), \
|
||||||
|
(MaskOrigin), (Brush), (BrushOrigin), (Rop4), TRUE)
|
||||||
|
|
||||||
BOOL STDCALL
|
BOOL STDCALL
|
||||||
IntEngStretchBlt(BITMAPOBJ *DestObj,
|
IntEngStretchBlt(SURFOBJ *DestObj,
|
||||||
BITMAPOBJ *SourceObj,
|
SURFOBJ *SourceObj,
|
||||||
BITMAPOBJ *Mask,
|
SURFOBJ *Mask,
|
||||||
CLIPOBJ *ClipRegion,
|
CLIPOBJ *ClipRegion,
|
||||||
XLATEOBJ *ColorTranslation,
|
XLATEOBJ *ColorTranslation,
|
||||||
RECTL *DestRect,
|
RECTL *DestRect,
|
||||||
|
@ -80,7 +87,7 @@ IntEngStretchBlt(BITMAPOBJ *DestObj,
|
||||||
ULONG Mode);
|
ULONG Mode);
|
||||||
|
|
||||||
BOOL STDCALL
|
BOOL STDCALL
|
||||||
IntEngGradientFill(BITMAPOBJ *psoDest,
|
IntEngGradientFill(SURFOBJ *psoDest,
|
||||||
CLIPOBJ *pco,
|
CLIPOBJ *pco,
|
||||||
XLATEOBJ *pxlo,
|
XLATEOBJ *pxlo,
|
||||||
TRIVERTEX *pVertex,
|
TRIVERTEX *pVertex,
|
||||||
|
@ -109,7 +116,7 @@ IntEngCreateSrcMonoXlate(HPALETTE PaletteDest,
|
||||||
ULONG BackgroundColor);
|
ULONG BackgroundColor);
|
||||||
|
|
||||||
BOOL STDCALL
|
BOOL STDCALL
|
||||||
IntEngPolyline(BITMAPOBJ *DestSurf,
|
IntEngPolyline(SURFOBJ *DestSurf,
|
||||||
CLIPOBJ *Clip,
|
CLIPOBJ *Clip,
|
||||||
BRUSHOBJ *Brush,
|
BRUSHOBJ *Brush,
|
||||||
CONST LPPOINT pt,
|
CONST LPPOINT pt,
|
||||||
|
@ -131,8 +138,8 @@ ClipobjToSpans(PSPAN *Spans,
|
||||||
PRECTL Boundary);
|
PRECTL Boundary);
|
||||||
|
|
||||||
BOOL FASTCALL
|
BOOL FASTCALL
|
||||||
IntEngTransparentBlt(BITMAPOBJ *Dest,
|
IntEngTransparentBlt(SURFOBJ *Dest,
|
||||||
BITMAPOBJ *Source,
|
SURFOBJ *Source,
|
||||||
CLIPOBJ *Clip,
|
CLIPOBJ *Clip,
|
||||||
XLATEOBJ *ColorTranslation,
|
XLATEOBJ *ColorTranslation,
|
||||||
PRECTL DestRect,
|
PRECTL DestRect,
|
||||||
|
@ -141,10 +148,17 @@ IntEngTransparentBlt(BITMAPOBJ *Dest,
|
||||||
ULONG Reserved);
|
ULONG Reserved);
|
||||||
|
|
||||||
BOOL STDCALL
|
BOOL STDCALL
|
||||||
IntEngPaint(IN BITMAPOBJ *Surface,
|
IntEngPaint(IN SURFOBJ *Surface,
|
||||||
IN CLIPOBJ *ClipRegion,
|
IN CLIPOBJ *ClipRegion,
|
||||||
IN BRUSHOBJ *Brush,
|
IN BRUSHOBJ *Brush,
|
||||||
IN POINTL *BrushOrigin,
|
IN POINTL *BrushOrigin,
|
||||||
IN MIX Mix);
|
IN MIX Mix);
|
||||||
|
|
||||||
|
VOID STDCALL
|
||||||
|
IntEngMovePointer(IN SURFOBJ *pso,
|
||||||
|
IN LONG x,
|
||||||
|
IN LONG y,
|
||||||
|
IN RECTL *prcl);
|
||||||
|
|
||||||
|
|
||||||
#endif /* _WIN32K_INTENG_H */
|
#endif /* _WIN32K_INTENG_H */
|
||||||
|
|
|
@ -51,6 +51,7 @@
|
||||||
#define TAG_FONTOBJ TAG('F', 'N', 'T', 'O') /* font object */
|
#define TAG_FONTOBJ TAG('F', 'N', 'T', 'O') /* font object */
|
||||||
#define TAG_WNDOBJ TAG('W', 'N', 'D', 'O') /* window object */
|
#define TAG_WNDOBJ TAG('W', 'N', 'D', 'O') /* window object */
|
||||||
#define TAG_XLATEOBJ TAG('X', 'L', 'A', 'O') /* xlate object */
|
#define TAG_XLATEOBJ TAG('X', 'L', 'A', 'O') /* xlate object */
|
||||||
|
#define TAG_BITMAPOBJ TAG('B', 'M', 'P', 'O') /* bitmap object */
|
||||||
|
|
||||||
/* misc */
|
/* misc */
|
||||||
#define TAG_DRIVER TAG('G', 'D', 'R', 'V') /* video drivers */
|
#define TAG_DRIVER TAG('G', 'D', 'R', 'V') /* video drivers */
|
||||||
|
|
|
@ -142,10 +142,7 @@ IntSetCursor(PWINSTATION_OBJECT WinStaObject, PCURICON_OBJECT NewCursor,
|
||||||
if (NULL != CurInfo->CurrentCursorObject && CurInfo->ShowingCursor)
|
if (NULL != CurInfo->CurrentCursorObject && CurInfo->ShowingCursor)
|
||||||
{
|
{
|
||||||
/* Remove the cursor if it was displayed */
|
/* Remove the cursor if it was displayed */
|
||||||
if (GDIDEV(SurfObj)->Pointer.MovePointer)
|
IntEngMovePointer(SurfObj, -1, -1, &GDIDEV(SurfObj)->Pointer.Exclude);
|
||||||
GDIDEV(SurfObj)->Pointer.MovePointer(SurfObj, -1, -1, &GDIDEV(SurfObj)->Pointer.Exclude);
|
|
||||||
else
|
|
||||||
EngMovePointer(SurfObj, -1, -1, &GDIDEV(SurfObj)->Pointer.Exclude);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GDIDEV(SurfObj)->Pointer.Status = SPS_ACCEPT_NOEXCLUDE;
|
GDIDEV(SurfObj)->Pointer.Status = SPS_ACCEPT_NOEXCLUDE;
|
||||||
|
@ -266,7 +263,7 @@ IntSetCursor(PWINSTATION_OBJECT WinStaObject, PCURICON_OBJECT NewCursor,
|
||||||
GDIDEV(SurfObj)->Pointer.Pos.y,
|
GDIDEV(SurfObj)->Pointer.Pos.y,
|
||||||
&(GDIDEV(SurfObj)->Pointer.Exclude),
|
&(GDIDEV(SurfObj)->Pointer.Exclude),
|
||||||
SPS_CHANGE);
|
SPS_CHANGE);
|
||||||
GDIDEV(SurfObj)->Pointer.MovePointer = EngMovePointer;
|
GDIDEV(SurfObj)->Pointer.MovePointer = NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -959,12 +959,7 @@ IntMouseInput(MOUSEINPUT *mi)
|
||||||
{
|
{
|
||||||
SurfObj = &BitmapObj->SurfObj;
|
SurfObj = &BitmapObj->SurfObj;
|
||||||
|
|
||||||
if (GDIDEV(SurfObj)->Pointer.MovePointer)
|
IntEngMovePointer(SurfObj, MousePos.x, MousePos.y, &(GDIDEV(SurfObj)->Pointer.Exclude));
|
||||||
{
|
|
||||||
GDIDEV(SurfObj)->Pointer.MovePointer(SurfObj, MousePos.x, MousePos.y, &(GDIDEV(SurfObj)->Pointer.Exclude));
|
|
||||||
} else {
|
|
||||||
EngMovePointer(SurfObj, MousePos.x, MousePos.y, &(GDIDEV(SurfObj)->Pointer.Exclude));
|
|
||||||
}
|
|
||||||
/* Only now, update the info in the GDIDEVICE, so EngMovePointer can
|
/* Only now, update the info in the GDIDEVICE, so EngMovePointer can
|
||||||
* use the old values to move the pointer image */
|
* use the old values to move the pointer image */
|
||||||
GDIDEV(SurfObj)->Pointer.Pos.x = MousePos.x;
|
GDIDEV(SurfObj)->Pointer.Pos.x = MousePos.x;
|
||||||
|
|
|
@ -213,8 +213,10 @@ NtGdiBitBlt(
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Perform the bitblt operation */
|
/* Perform the bitblt operation */
|
||||||
Status = IntEngBitBlt(BitmapDest, BitmapSrc, NULL, DCDest->CombinedClip, XlateObj,
|
Status = IntEngBitBlt(&BitmapDest->SurfObj, &BitmapSrc->SurfObj, NULL,
|
||||||
&DestRect, &SourcePoint, NULL, BrushObj ? &BrushInst.BrushObject : NULL,
|
DCDest->CombinedClip, XlateObj, &DestRect,
|
||||||
|
&SourcePoint, NULL,
|
||||||
|
BrushObj ? &BrushInst.BrushObject : NULL,
|
||||||
&BrushOrigin, ROP3_TO_ROP4(ROP));
|
&BrushOrigin, ROP3_TO_ROP4(ROP));
|
||||||
|
|
||||||
if (UsesSource && XlateObj != NULL)
|
if (UsesSource && XlateObj != NULL)
|
||||||
|
@ -371,7 +373,8 @@ NtGdiTransparentBlt(
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ret = IntEngTransparentBlt(BitmapDest, BitmapSrc, DCDest->CombinedClip, XlateObj, &rcDest, &rcSrc,
|
Ret = IntEngTransparentBlt(&BitmapDest->SurfObj, &BitmapSrc->SurfObj,
|
||||||
|
DCDest->CombinedClip, XlateObj, &rcDest, &rcSrc,
|
||||||
TransparentColor, 0);
|
TransparentColor, 0);
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
@ -469,6 +472,12 @@ BITMAP_Cleanup(PVOID ObjectBody)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (NULL != pBmp->BitsLock)
|
||||||
|
{
|
||||||
|
ExFreePoolWithTag(pBmp->BitsLock, TAG_BITMAPOBJ);
|
||||||
|
pBmp->BitsLock = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1246,8 +1255,10 @@ NtGdiStretchBlt(
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Perform the bitblt operation */
|
/* Perform the bitblt operation */
|
||||||
Status = IntEngStretchBlt(BitmapDest, BitmapSrc, NULL, DCDest->CombinedClip,
|
Status = IntEngStretchBlt(&BitmapDest->SurfObj, &BitmapSrc->SurfObj,
|
||||||
XlateObj, &DestRect, &SourceRect, NULL, NULL, NULL, COLORONCOLOR);
|
NULL, DCDest->CombinedClip, XlateObj,
|
||||||
|
&DestRect, &SourceRect, NULL, NULL, NULL,
|
||||||
|
COLORONCOLOR);
|
||||||
|
|
||||||
if (UsesSource)
|
if (UsesSource)
|
||||||
EngDeleteXlate(XlateObj);
|
EngDeleteXlate(XlateObj);
|
||||||
|
|
|
@ -482,7 +482,7 @@ IntPatBlt(
|
||||||
IntGdiInitBrushInstance(&BrushInst, BrushObj, dc->XlateBrush);
|
IntGdiInitBrushInstance(&BrushInst, BrushObj, dc->XlateBrush);
|
||||||
|
|
||||||
ret = IntEngBitBlt(
|
ret = IntEngBitBlt(
|
||||||
BitmapObj,
|
&BitmapObj->SurfObj,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
dc->CombinedClip,
|
dc->CombinedClip,
|
||||||
|
|
|
@ -16,26 +16,25 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id$ */
|
|
||||||
#include <w32k.h>
|
#include <w32k.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* a couple macros to fill a single pixel or a line
|
* a couple macros to fill a single pixel or a line
|
||||||
*/
|
*/
|
||||||
#define PUTPIXEL(x,y,BrushInst) \
|
#define PUTPIXEL(x,y,BrushInst) \
|
||||||
ret = ret && IntEngLineTo(BitmapObj, \
|
ret = ret && IntEngLineTo(&BitmapObj->SurfObj, \
|
||||||
dc->CombinedClip, \
|
dc->CombinedClip, \
|
||||||
&BrushInst.BrushObject, \
|
&BrushInst.BrushObject, \
|
||||||
x, y, (x)+1, y, \
|
x, y, (x)+1, y, \
|
||||||
&RectBounds, \
|
&RectBounds, \
|
||||||
ROP2_TO_MIX(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->SurfObj, \
|
||||||
dc->CombinedClip, \
|
dc->CombinedClip, \
|
||||||
&BrushInst.BrushObject, \
|
&BrushInst.BrushObject, \
|
||||||
x1, y1, x2, y2, \
|
x1, y1, x2, y2, \
|
||||||
&RectBounds, \
|
&RectBounds, \
|
||||||
ROP2_TO_MIX(dc->w.ROPmode));
|
ROP2_TO_MIX(dc->w.ROPmode));
|
||||||
|
|
||||||
BOOL FASTCALL
|
BOOL FASTCALL
|
||||||
|
@ -116,7 +115,7 @@ IntGdiPolygon(PDC dc,
|
||||||
To = UnsafePoints[CurrentPoint + 1];
|
To = UnsafePoints[CurrentPoint + 1];
|
||||||
|
|
||||||
//DPRINT("Polygon Making line from (%d,%d) to (%d,%d)\n", From.x, From.y, To.x, To.y );
|
//DPRINT("Polygon Making line from (%d,%d) to (%d,%d)\n", From.x, From.y, To.x, To.y );
|
||||||
ret = IntEngLineTo(BitmapObj,
|
ret = IntEngLineTo(&BitmapObj->SurfObj,
|
||||||
dc->CombinedClip,
|
dc->CombinedClip,
|
||||||
&PenBrushInst.BrushObject,
|
&PenBrushInst.BrushObject,
|
||||||
From.x,
|
From.x,
|
||||||
|
@ -994,7 +993,7 @@ IntRectangle(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 = IntEngBitBlt(BitmapObj,
|
ret = IntEngBitBlt(&BitmapObj->SurfObj,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
dc->CombinedClip,
|
dc->CombinedClip,
|
||||||
|
@ -1028,28 +1027,28 @@ IntRectangle(PDC dc,
|
||||||
if (!(PenBrushObj->flAttrs & GDIBRUSH_IS_NULL))
|
if (!(PenBrushObj->flAttrs & GDIBRUSH_IS_NULL))
|
||||||
{
|
{
|
||||||
Mix = ROP2_TO_MIX(dc->w.ROPmode);
|
Mix = ROP2_TO_MIX(dc->w.ROPmode);
|
||||||
ret = ret && IntEngLineTo(BitmapObj,
|
ret = ret && IntEngLineTo(&BitmapObj->SurfObj,
|
||||||
dc->CombinedClip,
|
dc->CombinedClip,
|
||||||
&PenBrushInst.BrushObject,
|
&PenBrushInst.BrushObject,
|
||||||
LeftRect, TopRect, RightRect, TopRect,
|
LeftRect, TopRect, RightRect, TopRect,
|
||||||
&DestRect, // Bounding rectangle
|
&DestRect, // Bounding rectangle
|
||||||
Mix);
|
Mix);
|
||||||
|
|
||||||
ret = ret && IntEngLineTo(BitmapObj,
|
ret = ret && IntEngLineTo(&BitmapObj->SurfObj,
|
||||||
dc->CombinedClip,
|
dc->CombinedClip,
|
||||||
&PenBrushInst.BrushObject,
|
&PenBrushInst.BrushObject,
|
||||||
RightRect, TopRect, RightRect, BottomRect,
|
RightRect, TopRect, RightRect, BottomRect,
|
||||||
&DestRect, // Bounding rectangle
|
&DestRect, // Bounding rectangle
|
||||||
Mix);
|
Mix);
|
||||||
|
|
||||||
ret = ret && IntEngLineTo(BitmapObj,
|
ret = ret && IntEngLineTo(&BitmapObj->SurfObj,
|
||||||
dc->CombinedClip,
|
dc->CombinedClip,
|
||||||
&PenBrushInst.BrushObject,
|
&PenBrushInst.BrushObject,
|
||||||
RightRect, BottomRect, LeftRect, BottomRect,
|
RightRect, BottomRect, LeftRect, BottomRect,
|
||||||
&DestRect, // Bounding rectangle
|
&DestRect, // Bounding rectangle
|
||||||
Mix);
|
Mix);
|
||||||
|
|
||||||
ret = ret && IntEngLineTo(BitmapObj,
|
ret = ret && IntEngLineTo(&BitmapObj->SurfObj,
|
||||||
dc->CombinedClip,
|
dc->CombinedClip,
|
||||||
&PenBrushInst.BrushObject,
|
&PenBrushInst.BrushObject,
|
||||||
LeftRect, BottomRect, LeftRect, TopRect,
|
LeftRect, BottomRect, LeftRect, TopRect,
|
||||||
|
@ -1485,7 +1484,7 @@ IntGdiGradientFill(
|
||||||
XlateObj = (XLATEOBJ*)IntEngCreateXlate(Mode, PAL_RGB, dc->w.hPalette, NULL);
|
XlateObj = (XLATEOBJ*)IntEngCreateXlate(Mode, PAL_RGB, dc->w.hPalette, NULL);
|
||||||
ASSERT(XlateObj);
|
ASSERT(XlateObj);
|
||||||
|
|
||||||
Ret = IntEngGradientFill(BitmapObj,
|
Ret = IntEngGradientFill(&BitmapObj->SurfObj,
|
||||||
dc->CombinedClip,
|
dc->CombinedClip,
|
||||||
XlateObj,
|
XlateObj,
|
||||||
pVertex,
|
pVertex,
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id$ */
|
|
||||||
#include <w32k.h>
|
#include <w32k.h>
|
||||||
|
|
||||||
// Some code from the WINE project source (www.winehq.com)
|
// Some code from the WINE project source (www.winehq.com)
|
||||||
|
@ -104,7 +103,7 @@ IntGdiLineTo(DC *dc,
|
||||||
if (!(PenBrushObj->flAttrs & GDIBRUSH_IS_NULL))
|
if (!(PenBrushObj->flAttrs & GDIBRUSH_IS_NULL))
|
||||||
{
|
{
|
||||||
IntGdiInitBrushInstance(&PenBrushInst, PenBrushObj, dc->XlatePen);
|
IntGdiInitBrushInstance(&PenBrushInst, PenBrushObj, dc->XlatePen);
|
||||||
Ret = IntEngLineTo(BitmapObj,
|
Ret = IntEngLineTo(&BitmapObj->SurfObj,
|
||||||
dc->CombinedClip,
|
dc->CombinedClip,
|
||||||
&PenBrushInst.BrushObject,
|
&PenBrushInst.BrushObject,
|
||||||
Points[0].x, Points[0].y,
|
Points[0].x, Points[0].y,
|
||||||
|
@ -226,9 +225,9 @@ IntGdiPolyline(DC *dc,
|
||||||
}
|
}
|
||||||
|
|
||||||
IntGdiInitBrushInstance(&PenBrushInst, PenBrushObj, dc->XlatePen);
|
IntGdiInitBrushInstance(&PenBrushInst, PenBrushObj, dc->XlatePen);
|
||||||
Ret = IntEngPolyline(BitmapObj, dc->CombinedClip,
|
Ret = IntEngPolyline(&BitmapObj->SurfObj, dc->CombinedClip,
|
||||||
&PenBrushInst.BrushObject, Points, Count,
|
&PenBrushInst.BrushObject, Points, Count,
|
||||||
ROP2_TO_MIX(dc->w.ROPmode));
|
ROP2_TO_MIX(dc->w.ROPmode));
|
||||||
|
|
||||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||||
EngFreeMem(Points);
|
EngFreeMem(Points);
|
||||||
|
|
|
@ -422,15 +422,15 @@ POLYGONFILL_FillScanLineAlternate(
|
||||||
BoundRect.right = x2;
|
BoundRect.right = x2;
|
||||||
|
|
||||||
//DPRINT("Fill Line (%d, %d) to (%d, %d)\n",x1, ScanLine, x2, ScanLine);
|
//DPRINT("Fill Line (%d, %d) to (%d, %d)\n",x1, ScanLine, x2, ScanLine);
|
||||||
IntEngLineTo( BitmapObj,
|
IntEngLineTo(&BitmapObj->SurfObj,
|
||||||
dc->CombinedClip,
|
dc->CombinedClip,
|
||||||
BrushObj,
|
BrushObj,
|
||||||
x1,
|
x1,
|
||||||
ScanLine,
|
ScanLine,
|
||||||
x2,
|
x2,
|
||||||
ScanLine,
|
ScanLine,
|
||||||
&BoundRect, // Bounding rectangle
|
&BoundRect, // Bounding rectangle
|
||||||
RopMode); // MIX
|
RopMode); // MIX
|
||||||
}
|
}
|
||||||
pLeft = pRight->pNext;
|
pLeft = pRight->pNext;
|
||||||
pRight = pLeft ? pLeft->pNext : NULL;
|
pRight = pLeft ? pLeft->pNext : NULL;
|
||||||
|
@ -495,15 +495,15 @@ POLYGONFILL_FillScanLineWinding(
|
||||||
BoundRect.right = x2;
|
BoundRect.right = x2;
|
||||||
|
|
||||||
//DPRINT("Fill Line (%d, %d) to (%d, %d)\n",x1, ScanLine, x2, ScanLine);
|
//DPRINT("Fill Line (%d, %d) to (%d, %d)\n",x1, ScanLine, x2, ScanLine);
|
||||||
IntEngLineTo( BitmapObj,
|
IntEngLineTo(&BitmapObj->SurfObj,
|
||||||
dc->CombinedClip,
|
dc->CombinedClip,
|
||||||
BrushObj,
|
BrushObj,
|
||||||
x1,
|
x1,
|
||||||
ScanLine,
|
ScanLine,
|
||||||
x2,
|
x2,
|
||||||
ScanLine,
|
ScanLine,
|
||||||
&BoundRect, // Bounding rectangle
|
&BoundRect, // Bounding rectangle
|
||||||
RopMode); // MIX
|
RopMode); // MIX
|
||||||
|
|
||||||
x1 = newx1;
|
x1 = newx1;
|
||||||
x2 = newx2;
|
x2 = newx2;
|
||||||
|
@ -518,15 +518,15 @@ POLYGONFILL_FillScanLineWinding(
|
||||||
BoundRect.right = x2;
|
BoundRect.right = x2;
|
||||||
|
|
||||||
//DPRINT("Fill Line (%d, %d) to (%d, %d)\n",x1, ScanLine, x2, ScanLine);
|
//DPRINT("Fill Line (%d, %d) to (%d, %d)\n",x1, ScanLine, x2, ScanLine);
|
||||||
IntEngLineTo( BitmapObj,
|
IntEngLineTo(&BitmapObj->SurfObj,
|
||||||
dc->CombinedClip,
|
dc->CombinedClip,
|
||||||
BrushObj,
|
BrushObj,
|
||||||
x1,
|
x1,
|
||||||
ScanLine,
|
ScanLine,
|
||||||
x2,
|
x2,
|
||||||
ScanLine,
|
ScanLine,
|
||||||
&BoundRect, // Bounding rectangle
|
&BoundRect, // Bounding rectangle
|
||||||
RopMode); // MIX
|
RopMode); // MIX
|
||||||
}
|
}
|
||||||
|
|
||||||
//When the fill mode is ALTERNATE, GDI fills the area between odd-numbered and
|
//When the fill mode is ALTERNATE, GDI fills the area between odd-numbered and
|
||||||
|
|
|
@ -2501,7 +2501,7 @@ NtGdiPaintRgn(HDC hDC,
|
||||||
BitmapObj = BITMAPOBJ_LockBitmap(dc->w.hBitmap);
|
BitmapObj = BITMAPOBJ_LockBitmap(dc->w.hBitmap);
|
||||||
/* FIXME - Handle BitmapObj == NULL !!!! */
|
/* FIXME - Handle BitmapObj == NULL !!!! */
|
||||||
|
|
||||||
bRet = IntEngPaint(BitmapObj,
|
bRet = IntEngPaint(&BitmapObj->SurfObj,
|
||||||
ClipRegion,
|
ClipRegion,
|
||||||
&BrushInst.BrushObject,
|
&BrushInst.BrushObject,
|
||||||
&BrushOrigin,
|
&BrushOrigin,
|
||||||
|
|
|
@ -1482,7 +1482,7 @@ NtGdiExtTextOut(
|
||||||
|
|
||||||
DC *dc;
|
DC *dc;
|
||||||
SURFOBJ *SurfObj;
|
SURFOBJ *SurfObj;
|
||||||
BITMAPOBJ *BitmapObj;
|
BITMAPOBJ *BitmapObj = NULL;
|
||||||
int error, glyph_index, n, i;
|
int error, glyph_index, n, i;
|
||||||
FT_Face face;
|
FT_Face face;
|
||||||
FT_GlyphSlot glyph;
|
FT_GlyphSlot glyph;
|
||||||
|
@ -1628,7 +1628,7 @@ NtGdiExtTextOut(
|
||||||
DestRect.right = SpecifiedDestRect.right + dc->w.DCOrgX;
|
DestRect.right = SpecifiedDestRect.right + dc->w.DCOrgX;
|
||||||
DestRect.bottom = SpecifiedDestRect.bottom + dc->w.DCOrgY;
|
DestRect.bottom = SpecifiedDestRect.bottom + dc->w.DCOrgY;
|
||||||
IntEngBitBlt(
|
IntEngBitBlt(
|
||||||
BitmapObj,
|
&BitmapObj->SurfObj,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
dc->CombinedClip,
|
dc->CombinedClip,
|
||||||
|
@ -1846,7 +1846,7 @@ NtGdiExtTextOut(
|
||||||
DestRect.top = TextTop + yoff - ((face->size->metrics.ascender + 32) >> 6);
|
DestRect.top = TextTop + yoff - ((face->size->metrics.ascender + 32) >> 6);
|
||||||
DestRect.bottom = TextTop + yoff + ((32 - face->size->metrics.descender) >> 6);
|
DestRect.bottom = TextTop + yoff + ((32 - face->size->metrics.descender) >> 6);
|
||||||
IntEngBitBlt(
|
IntEngBitBlt(
|
||||||
BitmapObj,
|
&BitmapObj->SurfObj,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
dc->CombinedClip,
|
dc->CombinedClip,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue