mirror of
https://github.com/reactos/reactos.git
synced 2025-03-30 17:10:22 +00:00
Rename BITMAPOBJ to SURFACE as it's called on windows. Also rename related functions and variables.
svn path=/trunk/; revision=38645
This commit is contained in:
parent
be61701517
commit
8560b3bcc3
34 changed files with 993 additions and 1016 deletions
|
@ -93,8 +93,8 @@ BltMask(SURFOBJ* Dest,
|
|||
static BYTE maskbit[8] = { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 };
|
||||
/* Pattern brushes */
|
||||
PGDIBRUSHINST GdiBrush = NULL;
|
||||
SURFOBJ *PatternObj = NULL;
|
||||
PBITMAPOBJ PatternBitmap;
|
||||
SURFOBJ *psoPattern = NULL;
|
||||
PSURFACE psurfPattern;
|
||||
ULONG PatternWidth = 0, PatternHeight = 0, PatternY = 0;
|
||||
|
||||
if (Mask == NULL)
|
||||
|
@ -112,16 +112,16 @@ BltMask(SURFOBJ* Dest,
|
|||
GDIBRUSHINST,
|
||||
BrushObject);
|
||||
|
||||
PatternBitmap = BITMAPOBJ_LockBitmap(GdiBrush->GdiBrushObject->hbmPattern);
|
||||
if (PatternBitmap != NULL)
|
||||
psurfPattern = SURFACE_LockSurface(GdiBrush->GdiBrushObject->hbmPattern);
|
||||
if (psurfPattern != NULL)
|
||||
{
|
||||
PatternObj = &PatternBitmap->SurfObj;
|
||||
PatternWidth = PatternObj->sizlBitmap.cx;
|
||||
PatternHeight = PatternObj->sizlBitmap.cy;
|
||||
psoPattern = &psurfPattern->SurfObj;
|
||||
PatternWidth = psoPattern->sizlBitmap.cx;
|
||||
PatternHeight = psoPattern->sizlBitmap.cy;
|
||||
}
|
||||
}
|
||||
else
|
||||
PatternBitmap = NULL;
|
||||
psurfPattern = NULL;
|
||||
|
||||
tMask = (PBYTE)Mask->pvScan0 + SourcePoint->y * Mask->lDelta + (SourcePoint->x >> 3);
|
||||
for (j = 0; j < dy; j++)
|
||||
|
@ -129,14 +129,14 @@ BltMask(SURFOBJ* Dest,
|
|||
lMask = tMask;
|
||||
c8 = SourcePoint->x & 0x07;
|
||||
|
||||
if (PatternBitmap != NULL)
|
||||
if (psurfPattern != NULL)
|
||||
PatternY = (DestRect->top + j) % PatternHeight;
|
||||
|
||||
for (i = 0; i < dx; i++)
|
||||
{
|
||||
if (0 != (*lMask & maskbit[c8]))
|
||||
{
|
||||
if (PatternBitmap == NULL)
|
||||
if (psurfPattern == NULL)
|
||||
{
|
||||
DibFunctionsForBitmapFormat[Dest->iBitmapFormat].DIB_PutPixel(
|
||||
Dest, DestRect->left + i, DestRect->top + j, Brush->iSolidColor);
|
||||
|
@ -145,7 +145,7 @@ BltMask(SURFOBJ* Dest,
|
|||
{
|
||||
DibFunctionsForBitmapFormat[Dest->iBitmapFormat].DIB_PutPixel(
|
||||
Dest, DestRect->left + i, DestRect->top + j,
|
||||
DIB_GetSource(PatternObj, (DestRect->left + i) % PatternWidth, PatternY, GdiBrush->XlateObject));
|
||||
DIB_GetSource(psoPattern, (DestRect->left + i) % PatternWidth, PatternY, GdiBrush->XlateObject));
|
||||
}
|
||||
}
|
||||
c8++;
|
||||
|
@ -158,8 +158,8 @@ BltMask(SURFOBJ* Dest,
|
|||
tMask += Mask->lDelta;
|
||||
}
|
||||
|
||||
if (PatternBitmap != NULL)
|
||||
BITMAPOBJ_UnlockBitmap(PatternBitmap);
|
||||
if (psurfPattern != NULL)
|
||||
SURFACE_UnlockSurface(psurfPattern);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -198,7 +198,7 @@ CallDibBitBlt(SURFOBJ* OutputObj,
|
|||
{
|
||||
BLTINFO BltInfo;
|
||||
PGDIBRUSHINST GdiBrush = NULL;
|
||||
BITMAPOBJ *bmPattern;
|
||||
SURFACE *psurfPattern;
|
||||
BOOLEAN Result;
|
||||
|
||||
BltInfo.DestSurface = OutputObj;
|
||||
|
@ -220,9 +220,9 @@ CallDibBitBlt(SURFOBJ* OutputObj,
|
|||
if (ROP4_USES_PATTERN(Rop4) && Brush->iSolidColor == 0xFFFFFFFF)
|
||||
{
|
||||
GdiBrush = CONTAINING_RECORD(Brush, GDIBRUSHINST, BrushObject);
|
||||
if ((bmPattern = BITMAPOBJ_LockBitmap(GdiBrush->GdiBrushObject->hbmPattern)))
|
||||
if ((psurfPattern = SURFACE_LockSurface(GdiBrush->GdiBrushObject->hbmPattern)))
|
||||
{
|
||||
BltInfo.PatternSurface = &bmPattern->SurfObj;
|
||||
BltInfo.PatternSurface = &psurfPattern->SurfObj;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -232,15 +232,15 @@ CallDibBitBlt(SURFOBJ* OutputObj,
|
|||
}
|
||||
else
|
||||
{
|
||||
bmPattern = NULL;
|
||||
psurfPattern = NULL;
|
||||
}
|
||||
|
||||
Result = DibFunctionsForBitmapFormat[OutputObj->iBitmapFormat].DIB_BitBlt(&BltInfo);
|
||||
|
||||
/* Pattern brush */
|
||||
if (bmPattern != NULL)
|
||||
if (psurfPattern != NULL)
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmap(bmPattern);
|
||||
SURFACE_UnlockSurface(psurfPattern);
|
||||
}
|
||||
|
||||
return Result;
|
||||
|
@ -577,8 +577,8 @@ EngBitBlt(SURFOBJ *DestObj,
|
|||
}
|
||||
|
||||
BOOL APIENTRY
|
||||
IntEngBitBltEx(SURFOBJ *DestSurf,
|
||||
SURFOBJ *SourceSurf,
|
||||
IntEngBitBltEx(SURFOBJ *psoDest,
|
||||
SURFOBJ *psoSource,
|
||||
SURFOBJ *MaskSurf,
|
||||
CLIPOBJ *ClipRegion,
|
||||
XLATEOBJ *ColorTranslation,
|
||||
|
@ -595,14 +595,14 @@ IntEngBitBltEx(SURFOBJ *DestSurf,
|
|||
RECTL OutputRect;
|
||||
POINTL InputPoint;
|
||||
BOOLEAN UsesSource;
|
||||
BITMAPOBJ *DestObj;
|
||||
BITMAPOBJ *SourceObj = NULL;
|
||||
SURFACE *psurfDest;
|
||||
SURFACE *psurfSource = NULL;
|
||||
|
||||
if (DestSurf == NULL)
|
||||
if (psoDest == NULL)
|
||||
return FALSE;
|
||||
|
||||
DestObj = CONTAINING_RECORD(DestSurf, BITMAPOBJ, SurfObj);
|
||||
ASSERT(DestObj);
|
||||
psurfDest = CONTAINING_RECORD(psoDest, SURFACE, SurfObj);
|
||||
ASSERT(psurfDest);
|
||||
|
||||
InputClippedRect = *DestRect;
|
||||
if (InputClippedRect.right < InputClippedRect.left)
|
||||
|
@ -618,7 +618,7 @@ IntEngBitBltEx(SURFOBJ *DestSurf,
|
|||
UsesSource = ROP4_USES_SOURCE(Rop4);
|
||||
if (UsesSource)
|
||||
{
|
||||
if (NULL == SourcePoint || NULL == SourceSurf)
|
||||
if (NULL == SourcePoint || NULL == psoSource)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -636,19 +636,19 @@ IntEngBitBltEx(SURFOBJ *DestSurf,
|
|||
InputClippedRect.top -= InputPoint.y;
|
||||
InputPoint.y = 0;
|
||||
}
|
||||
if (SourceSurf->sizlBitmap.cx < InputPoint.x +
|
||||
if (psoSource->sizlBitmap.cx < InputPoint.x +
|
||||
InputClippedRect.right -
|
||||
InputClippedRect.left)
|
||||
{
|
||||
InputClippedRect.right = InputClippedRect.left +
|
||||
SourceSurf->sizlBitmap.cx - InputPoint.x;
|
||||
psoSource->sizlBitmap.cx - InputPoint.x;
|
||||
}
|
||||
if (SourceSurf->sizlBitmap.cy < InputPoint.y +
|
||||
if (psoSource->sizlBitmap.cy < InputPoint.y +
|
||||
InputClippedRect.bottom -
|
||||
InputClippedRect.top)
|
||||
{
|
||||
InputClippedRect.bottom = InputClippedRect.top +
|
||||
SourceSurf->sizlBitmap.cy - InputPoint.y;
|
||||
psoSource->sizlBitmap.cy - InputPoint.y;
|
||||
}
|
||||
|
||||
if (InputClippedRect.right < InputClippedRect.left ||
|
||||
|
@ -678,20 +678,20 @@ IntEngBitBltEx(SURFOBJ *DestSurf,
|
|||
|
||||
if (RemoveMouse)
|
||||
{
|
||||
BITMAPOBJ_LockBitmapBits(DestObj);
|
||||
SURFACE_LockBitmapBits(psurfDest);
|
||||
|
||||
if (UsesSource)
|
||||
{
|
||||
if (SourceSurf != DestSurf)
|
||||
if (psoSource != psoDest)
|
||||
{
|
||||
SourceObj = CONTAINING_RECORD(SourceSurf, BITMAPOBJ, SurfObj);
|
||||
BITMAPOBJ_LockBitmapBits(SourceObj);
|
||||
psurfSource = CONTAINING_RECORD(psoSource, SURFACE, SurfObj);
|
||||
SURFACE_LockBitmapBits(psurfSource);
|
||||
}
|
||||
MouseSafetyOnDrawStart(SourceSurf, InputPoint.x, InputPoint.y,
|
||||
MouseSafetyOnDrawStart(psoSource, InputPoint.x, InputPoint.y,
|
||||
(InputPoint.x + abs(DestRect->right - DestRect->left)),
|
||||
(InputPoint.y + abs(DestRect->bottom - DestRect->top)));
|
||||
}
|
||||
MouseSafetyOnDrawStart(DestSurf, OutputRect.left, OutputRect.top,
|
||||
MouseSafetyOnDrawStart(psoDest, OutputRect.left, OutputRect.top,
|
||||
OutputRect.right, OutputRect.bottom);
|
||||
}
|
||||
|
||||
|
@ -699,42 +699,42 @@ IntEngBitBltEx(SURFOBJ *DestSurf,
|
|||
ret = FALSE;
|
||||
|
||||
/* Call the driver's DrvBitBlt if available */
|
||||
if (DestObj->flHooks & HOOK_BITBLT)
|
||||
if (psurfDest->flHooks & HOOK_BITBLT)
|
||||
{
|
||||
ret = GDIDEVFUNCS(DestSurf).BitBlt(
|
||||
DestSurf, SourceSurf, MaskSurf, ClipRegion, ColorTranslation,
|
||||
ret = GDIDEVFUNCS(psoDest).BitBlt(
|
||||
psoDest, psoSource, MaskSurf, ClipRegion, ColorTranslation,
|
||||
&OutputRect, &InputPoint, MaskOrigin, Brush, BrushOrigin,
|
||||
Rop4);
|
||||
}
|
||||
|
||||
if (! ret)
|
||||
{
|
||||
ret = EngBitBlt(DestSurf, SourceSurf, MaskSurf, ClipRegion, ColorTranslation,
|
||||
ret = EngBitBlt(psoDest, psoSource, MaskSurf, ClipRegion, ColorTranslation,
|
||||
&OutputRect, &InputPoint, MaskOrigin, Brush, BrushOrigin,
|
||||
Rop4);
|
||||
}
|
||||
|
||||
if (RemoveMouse)
|
||||
{
|
||||
MouseSafetyOnDrawEnd(DestSurf);
|
||||
MouseSafetyOnDrawEnd(psoDest);
|
||||
if (UsesSource)
|
||||
{
|
||||
MouseSafetyOnDrawEnd(SourceSurf);
|
||||
if (SourceSurf != DestSurf)
|
||||
MouseSafetyOnDrawEnd(psoSource);
|
||||
if (psoSource != psoDest)
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmapBits(SourceObj);
|
||||
SURFACE_UnlockBitmapBits(psurfSource);
|
||||
}
|
||||
}
|
||||
|
||||
BITMAPOBJ_UnlockBitmapBits(DestObj);
|
||||
SURFACE_UnlockBitmapBits(psurfDest);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static BOOLEAN APIENTRY
|
||||
CallDibStretchBlt(SURFOBJ* OutputObj,
|
||||
SURFOBJ* InputObj,
|
||||
CallDibStretchBlt(SURFOBJ* psoDest,
|
||||
SURFOBJ* psoSource,
|
||||
SURFOBJ* Mask,
|
||||
CLIPOBJ* ClipRegion,
|
||||
XLATEOBJ* ColorTranslation,
|
||||
|
@ -753,16 +753,16 @@ CallDibStretchBlt(SURFOBJ* OutputObj,
|
|||
{
|
||||
RealBrushOrigin = *BrushOrigin;
|
||||
}
|
||||
return DibFunctionsForBitmapFormat[OutputObj->iBitmapFormat].DIB_StretchBlt(
|
||||
OutputObj, InputObj, OutputRect, InputRect, MaskOrigin, RealBrushOrigin, ClipRegion, ColorTranslation, Mode);
|
||||
return DibFunctionsForBitmapFormat[psoDest->iBitmapFormat].DIB_StretchBlt(
|
||||
psoDest, psoSource, OutputRect, InputRect, MaskOrigin, RealBrushOrigin, ClipRegion, ColorTranslation, Mode);
|
||||
}
|
||||
|
||||
|
||||
BOOL
|
||||
APIENTRY
|
||||
NtGdiEngStretchBlt(
|
||||
IN SURFOBJ *DestObj,
|
||||
IN SURFOBJ *SourceObj,
|
||||
IN SURFOBJ *psoDest,
|
||||
IN SURFOBJ *psoSource,
|
||||
IN SURFOBJ *Mask,
|
||||
IN CLIPOBJ *ClipRegion,
|
||||
IN XLATEOBJ *ColorTranslation,
|
||||
|
@ -804,14 +804,14 @@ NtGdiEngStretchBlt(
|
|||
}
|
||||
_SEH2_END;
|
||||
|
||||
return EngStretchBlt(DestObj, SourceObj, Mask, ClipRegion, ColorTranslation, &ca, &lBrushOrigin, &rclDest, &rclSrc, &lMaskOrigin, Mode);
|
||||
return EngStretchBlt(psoDest, psoSource, Mask, ClipRegion, ColorTranslation, &ca, &lBrushOrigin, &rclDest, &rclSrc, &lMaskOrigin, Mode);
|
||||
}
|
||||
|
||||
BOOL
|
||||
APIENTRY
|
||||
EngStretchBlt(
|
||||
IN SURFOBJ *DestObj,
|
||||
IN SURFOBJ *SourceObj,
|
||||
IN SURFOBJ *psoDest,
|
||||
IN SURFOBJ *psoSource,
|
||||
IN SURFOBJ *Mask,
|
||||
IN CLIPOBJ *ClipRegion,
|
||||
IN XLATEOBJ *ColorTranslation,
|
||||
|
@ -831,8 +831,8 @@ EngStretchBlt(
|
|||
POINTL Translate;
|
||||
INTENG_ENTER_LEAVE EnterLeaveSource;
|
||||
INTENG_ENTER_LEAVE EnterLeaveDest;
|
||||
SURFOBJ* InputObj;
|
||||
SURFOBJ* OutputObj;
|
||||
SURFOBJ* psoInput;
|
||||
SURFOBJ* psoOutput;
|
||||
PSTRETCHRECTFUNC BltRectFunc;
|
||||
BOOLEAN Ret;
|
||||
POINTL AdjustedBrushOrigin;
|
||||
|
@ -842,7 +842,7 @@ EngStretchBlt(
|
|||
InputRect.top = prclSrc->top;
|
||||
InputRect.bottom = prclSrc->bottom;
|
||||
|
||||
if (! IntEngEnter(&EnterLeaveSource, SourceObj, &InputRect, TRUE, &Translate, &InputObj))
|
||||
if (! IntEngEnter(&EnterLeaveSource, psoSource, &InputRect, TRUE, &Translate, &psoInput))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -860,7 +860,7 @@ EngStretchBlt(
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
if (! IntEngEnter(&EnterLeaveDest, DestObj, &OutputRect, FALSE, &Translate, &OutputObj))
|
||||
if (! IntEngEnter(&EnterLeaveDest, psoDest, &OutputRect, FALSE, &Translate, &psoOutput))
|
||||
{
|
||||
IntEngLeave(&EnterLeaveSource);
|
||||
return FALSE;
|
||||
|
@ -896,7 +896,7 @@ EngStretchBlt(
|
|||
}
|
||||
|
||||
|
||||
Ret = (*BltRectFunc)(OutputObj, InputObj, Mask, ClipRegion,
|
||||
Ret = (*BltRectFunc)(psoOutput, psoInput, Mask, ClipRegion,
|
||||
ColorTranslation, &OutputRect, &InputRect, MaskOrigin,
|
||||
&AdjustedBrushOrigin, Mode);
|
||||
|
||||
|
@ -907,8 +907,8 @@ EngStretchBlt(
|
|||
}
|
||||
|
||||
BOOL APIENTRY
|
||||
IntEngStretchBlt(SURFOBJ *DestSurf,
|
||||
SURFOBJ *SourceSurf,
|
||||
IntEngStretchBlt(SURFOBJ *psoDest,
|
||||
SURFOBJ *psoSource,
|
||||
SURFOBJ *MaskSurf,
|
||||
CLIPOBJ *ClipRegion,
|
||||
XLATEOBJ *ColorTranslation,
|
||||
|
@ -922,12 +922,12 @@ IntEngStretchBlt(SURFOBJ *DestSurf,
|
|||
BOOLEAN ret;
|
||||
COLORADJUSTMENT ca;
|
||||
POINT MaskOrigin;
|
||||
BITMAPOBJ *DestObj;
|
||||
BITMAPOBJ *SourceObj = NULL;
|
||||
SURFACE *psurfDest;
|
||||
SURFACE *psurfSource = NULL;
|
||||
|
||||
ASSERT(DestSurf);
|
||||
DestObj = CONTAINING_RECORD(DestSurf, BITMAPOBJ, SurfObj);
|
||||
ASSERT(DestObj);
|
||||
ASSERT(psoDest);
|
||||
psurfDest = CONTAINING_RECORD(psoDest, SURFACE, SurfObj);
|
||||
ASSERT(psurfDest);
|
||||
|
||||
if (pMaskOrigin != NULL)
|
||||
{
|
||||
|
@ -937,52 +937,52 @@ IntEngStretchBlt(SURFOBJ *DestSurf,
|
|||
/* No success yet */
|
||||
ret = FALSE;
|
||||
ASSERT(DestRect);
|
||||
BITMAPOBJ_LockBitmapBits(DestObj);
|
||||
MouseSafetyOnDrawStart(DestSurf, DestRect->left, DestRect->top,
|
||||
SURFACE_LockBitmapBits(psurfDest);
|
||||
MouseSafetyOnDrawStart(psoDest, DestRect->left, DestRect->top,
|
||||
DestRect->right, DestRect->bottom);
|
||||
|
||||
if (NULL != SourceSurf)
|
||||
if (NULL != psoSource)
|
||||
{
|
||||
SourceObj = CONTAINING_RECORD(SourceSurf, BITMAPOBJ, SurfObj);
|
||||
psurfSource = CONTAINING_RECORD(psoSource, SURFACE, SurfObj);
|
||||
ASSERT(SourceRect);
|
||||
if (SourceSurf != DestSurf)
|
||||
if (psoSource != psoDest)
|
||||
{
|
||||
BITMAPOBJ_LockBitmapBits(SourceObj);
|
||||
SURFACE_LockBitmapBits(psurfSource);
|
||||
}
|
||||
MouseSafetyOnDrawStart(SourceSurf, SourceRect->left, SourceRect->top,
|
||||
MouseSafetyOnDrawStart(psoSource, SourceRect->left, SourceRect->top,
|
||||
SourceRect->right, SourceRect->bottom);
|
||||
}
|
||||
|
||||
/* Prepare color adjustment */
|
||||
|
||||
/* Call the driver's DrvStretchBlt if available */
|
||||
if (DestObj->flHooks & HOOK_STRETCHBLT)
|
||||
if (psurfDest->flHooks & HOOK_STRETCHBLT)
|
||||
{
|
||||
/* Drv->StretchBlt (look at http://www.osr.com/ddk/graphics/ddifncs_3ew7.htm )
|
||||
SURFOBJ *psoMask // optional, if it exists, then rop4=0xCCAA, otherwise rop4=0xCCCC */
|
||||
// FIXME: MaskOrigin is always NULL !
|
||||
ret = GDIDEVFUNCS(DestSurf).StretchBlt(
|
||||
DestSurf, SourceSurf, MaskSurf, ClipRegion, ColorTranslation,
|
||||
ret = GDIDEVFUNCS(psoDest).StretchBlt(
|
||||
psoDest, psoSource, MaskSurf, ClipRegion, ColorTranslation,
|
||||
&ca, BrushOrigin, DestRect, SourceRect, NULL, Mode);
|
||||
}
|
||||
|
||||
if (! ret)
|
||||
{
|
||||
// FIXME: see previous fixme
|
||||
ret = EngStretchBlt(DestSurf, SourceSurf, MaskSurf, ClipRegion, ColorTranslation,
|
||||
ret = EngStretchBlt(psoDest, psoSource, MaskSurf, ClipRegion, ColorTranslation,
|
||||
&ca, BrushOrigin, DestRect, SourceRect, NULL, Mode);
|
||||
}
|
||||
|
||||
if (NULL != SourceSurf)
|
||||
if (NULL != psoSource)
|
||||
{
|
||||
MouseSafetyOnDrawEnd(SourceSurf);
|
||||
if (SourceSurf != DestSurf)
|
||||
MouseSafetyOnDrawEnd(psoSource);
|
||||
if (psoSource != psoDest)
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmapBits(SourceObj);
|
||||
SURFACE_UnlockBitmapBits(psurfSource);
|
||||
}
|
||||
}
|
||||
MouseSafetyOnDrawEnd(DestSurf);
|
||||
BITMAPOBJ_UnlockBitmapBits(DestObj);
|
||||
MouseSafetyOnDrawEnd(psoDest);
|
||||
SURFACE_UnlockBitmapBits(psurfDest);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -993,8 +993,8 @@ IntEngStretchBlt(SURFOBJ *DestSurf,
|
|||
*/
|
||||
BOOL
|
||||
APIENTRY
|
||||
NtGdiEngAlphaBlend(IN SURFOBJ *Dest,
|
||||
IN SURFOBJ *Source,
|
||||
NtGdiEngAlphaBlend(IN SURFOBJ *psoDest,
|
||||
IN SURFOBJ *psoSource,
|
||||
IN CLIPOBJ *ClipRegion,
|
||||
IN XLATEOBJ *ColorTranslation,
|
||||
IN PRECTL upDestRect,
|
||||
|
@ -1019,7 +1019,7 @@ NtGdiEngAlphaBlend(IN SURFOBJ *Dest,
|
|||
}
|
||||
_SEH2_END;
|
||||
|
||||
return EngAlphaBlend(Dest, Source, ClipRegion, ColorTranslation, &DestRect, &SourceRect, BlendObj);
|
||||
return EngAlphaBlend(psoDest, psoSource, ClipRegion, ColorTranslation, &DestRect, &SourceRect, BlendObj);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1027,8 +1027,8 @@ NtGdiEngAlphaBlend(IN SURFOBJ *Dest,
|
|||
*/
|
||||
BOOL
|
||||
APIENTRY
|
||||
EngAlphaBlend(IN SURFOBJ *Dest,
|
||||
IN SURFOBJ *Source,
|
||||
EngAlphaBlend(IN SURFOBJ *psoDest,
|
||||
IN SURFOBJ *psoSource,
|
||||
IN CLIPOBJ *ClipRegion,
|
||||
IN XLATEOBJ *ColorTranslation,
|
||||
IN PRECTL DestRect,
|
||||
|
@ -1056,7 +1056,7 @@ EngAlphaBlend(IN SURFOBJ *Dest,
|
|||
INT i;
|
||||
BOOLEAN Ret;
|
||||
|
||||
DPRINT("EngAlphaBlend(Dest:0x%p, Source:0x%p, ClipRegion:0x%p, ColorTranslation:0x%p,\n", Dest, Source, ClipRegion, ColorTranslation);
|
||||
DPRINT("EngAlphaBlend(psoDest:0x%p, psoSource:0x%p, ClipRegion:0x%p, ColorTranslation:0x%p,\n", psoDest, psoSource, ClipRegion, ColorTranslation);
|
||||
DPRINT(" DestRect:{0x%x, 0x%x, 0x%x, 0x%x}, SourceRect:{0x%x, 0x%x, 0x%x, 0x%x},\n",
|
||||
DestRect->left, DestRect->top, DestRect->right, DestRect->bottom,
|
||||
SourceRect->left, SourceRect->top, SourceRect->right, SourceRect->bottom);
|
||||
|
@ -1091,7 +1091,7 @@ EngAlphaBlend(IN SURFOBJ *Dest,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
if (Dest == Source &&
|
||||
if (psoDest == psoSource &&
|
||||
!(OutputRect.left >= SourceRect->right || InputRect.left >= OutputRect.right ||
|
||||
OutputRect.top >= SourceRect->bottom || InputRect.top >= OutputRect.bottom))
|
||||
{
|
||||
|
@ -1130,10 +1130,10 @@ EngAlphaBlend(IN SURFOBJ *Dest,
|
|||
{
|
||||
SourceStretchedSize.cx = OutputRect.right - OutputRect.left;
|
||||
SourceStretchedSize.cy = OutputRect.bottom - OutputRect.top;
|
||||
Width = DIB_GetDIBWidthBytes(SourceStretchedSize.cx, BitsPerFormat(Source->iBitmapFormat));
|
||||
Width = DIB_GetDIBWidthBytes(SourceStretchedSize.cx, BitsPerFormat(psoSource->iBitmapFormat));
|
||||
/* FIXME: Maybe it is a good idea to use EngCreateDeviceBitmap and IntEngStretchBlt
|
||||
if possible to get a HW accelerated stretch. */
|
||||
SourceStretchedBitmap = EngCreateBitmap(SourceStretchedSize, Width, Source->iBitmapFormat,
|
||||
SourceStretchedBitmap = EngCreateBitmap(SourceStretchedSize, Width, psoSource->iBitmapFormat,
|
||||
BMF_TOPDOWN | BMF_NOZEROINIT, NULL);
|
||||
if (SourceStretchedBitmap == 0)
|
||||
{
|
||||
|
@ -1154,10 +1154,10 @@ EngAlphaBlend(IN SURFOBJ *Dest,
|
|||
SourceStretchedRect.bottom = SourceStretchedSize.cy;
|
||||
/* FIXME: IntEngStretchBlt isn't used here atm because it results in a
|
||||
try to acquire an already acquired mutex (lock the already locked source surface) */
|
||||
/*if (!IntEngStretchBlt(SourceStretchedObj, Source, NULL, NULL,
|
||||
/*if (!IntEngStretchBlt(SourceStretchedObj, psoSource, NULL, NULL,
|
||||
NULL, &SourceStretchedRect, SourceRect, NULL,
|
||||
NULL, NULL, COLORONCOLOR))*/
|
||||
if (!EngStretchBlt(SourceStretchedObj, Source, NULL, NULL, NULL,
|
||||
if (!EngStretchBlt(SourceStretchedObj, psoSource, NULL, NULL, NULL,
|
||||
NULL, NULL, &SourceStretchedRect, &InputRect,
|
||||
NULL, COLORONCOLOR))
|
||||
{
|
||||
|
@ -1171,11 +1171,11 @@ EngAlphaBlend(IN SURFOBJ *Dest,
|
|||
InputRect.bottom = SourceStretchedRect.bottom;
|
||||
InputRect.left = SourceStretchedRect.left;
|
||||
InputRect.right = SourceStretchedRect.right;
|
||||
Source = SourceStretchedObj;
|
||||
psoSource = SourceStretchedObj;
|
||||
}
|
||||
|
||||
/* Now call the DIB function */
|
||||
if (!IntEngEnter(&EnterLeaveSource, Source, &InputRect, TRUE, &Translate, &InputObj))
|
||||
if (!IntEngEnter(&EnterLeaveSource, psoSource, &InputRect, TRUE, &Translate, &InputObj))
|
||||
{
|
||||
if (SourceStretchedObj != NULL)
|
||||
{
|
||||
|
@ -1193,7 +1193,7 @@ EngAlphaBlend(IN SURFOBJ *Dest,
|
|||
InputRect.top += Translate.y;
|
||||
InputRect.bottom += Translate.y;
|
||||
|
||||
if (!IntEngEnter(&EnterLeaveDest, Dest, &OutputRect, FALSE, &Translate, &OutputObj))
|
||||
if (!IntEngEnter(&EnterLeaveDest, psoDest, &OutputRect, FALSE, &Translate, &OutputObj))
|
||||
{
|
||||
IntEngLeave(&EnterLeaveSource);
|
||||
if (SourceStretchedObj != NULL)
|
||||
|
@ -1288,8 +1288,8 @@ EngAlphaBlend(IN SURFOBJ *Dest,
|
|||
}
|
||||
|
||||
BOOL APIENTRY
|
||||
IntEngAlphaBlend(IN SURFOBJ *Dest,
|
||||
IN SURFOBJ *Source,
|
||||
IntEngAlphaBlend(IN SURFOBJ *psoDest,
|
||||
IN SURFOBJ *psoSource,
|
||||
IN CLIPOBJ *ClipRegion,
|
||||
IN XLATEOBJ *ColorTranslation,
|
||||
IN PRECTL DestRect,
|
||||
|
@ -1297,16 +1297,14 @@ IntEngAlphaBlend(IN SURFOBJ *Dest,
|
|||
IN BLENDOBJ *BlendObj)
|
||||
{
|
||||
BOOL ret = FALSE;
|
||||
BITMAPOBJ *DestObj;
|
||||
BITMAPOBJ *SourceObj;
|
||||
SURFACE *psurfDest;
|
||||
SURFACE *psurfSource;
|
||||
|
||||
ASSERT(Dest);
|
||||
DestObj = CONTAINING_RECORD(Dest, BITMAPOBJ, SurfObj);
|
||||
ASSERT(DestObj);
|
||||
ASSERT(psoDest);
|
||||
psurfDest = CONTAINING_RECORD(psoDest, SURFACE, SurfObj);
|
||||
|
||||
ASSERT(Source);
|
||||
SourceObj = CONTAINING_RECORD(Source, BITMAPOBJ, SurfObj);
|
||||
ASSERT(SourceObj);
|
||||
ASSERT(psoSource);
|
||||
psurfSource = CONTAINING_RECORD(psoSource, SURFACE, SurfObj);
|
||||
|
||||
ASSERT(DestRect);
|
||||
ASSERT(SourceRect);
|
||||
|
@ -1320,34 +1318,34 @@ IntEngAlphaBlend(IN SURFOBJ *Dest,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
BITMAPOBJ_LockBitmapBits(DestObj);
|
||||
MouseSafetyOnDrawStart(Dest, DestRect->left, DestRect->top,
|
||||
SURFACE_LockBitmapBits(psurfDest);
|
||||
MouseSafetyOnDrawStart(psoDest, DestRect->left, DestRect->top,
|
||||
DestRect->right, DestRect->bottom);
|
||||
|
||||
if (Source != Dest)
|
||||
BITMAPOBJ_LockBitmapBits(SourceObj);
|
||||
MouseSafetyOnDrawStart(Source, SourceRect->left, SourceRect->top,
|
||||
if (psoSource != psoDest)
|
||||
SURFACE_LockBitmapBits(psurfSource);
|
||||
MouseSafetyOnDrawStart(psoSource, SourceRect->left, SourceRect->top,
|
||||
SourceRect->right, SourceRect->bottom);
|
||||
|
||||
/* Call the driver's DrvAlphaBlend if available */
|
||||
if (DestObj->flHooks & HOOK_ALPHABLEND)
|
||||
if (psurfDest->flHooks & HOOK_ALPHABLEND)
|
||||
{
|
||||
ret = GDIDEVFUNCS(Dest).AlphaBlend(
|
||||
Dest, Source, ClipRegion, ColorTranslation,
|
||||
ret = GDIDEVFUNCS(psoDest).AlphaBlend(
|
||||
psoDest, psoSource, ClipRegion, ColorTranslation,
|
||||
DestRect, SourceRect, BlendObj);
|
||||
}
|
||||
|
||||
if (! ret)
|
||||
{
|
||||
ret = EngAlphaBlend(Dest, Source, ClipRegion, ColorTranslation,
|
||||
ret = EngAlphaBlend(psoDest, psoSource, ClipRegion, ColorTranslation,
|
||||
DestRect, SourceRect, BlendObj);
|
||||
}
|
||||
|
||||
MouseSafetyOnDrawEnd(Source);
|
||||
if (Source != Dest)
|
||||
BITMAPOBJ_UnlockBitmapBits(SourceObj);
|
||||
MouseSafetyOnDrawEnd(Dest);
|
||||
BITMAPOBJ_UnlockBitmapBits(DestObj);
|
||||
MouseSafetyOnDrawEnd(psoSource);
|
||||
if (psoSource != psoDest)
|
||||
SURFACE_UnlockBitmapBits(psurfSource);
|
||||
MouseSafetyOnDrawEnd(psoDest);
|
||||
SURFACE_UnlockBitmapBits(psurfDest);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -1356,8 +1354,8 @@ IntEngAlphaBlend(IN SURFOBJ *Dest,
|
|||
|
||||
/* renders the alpha mask bitmap */
|
||||
static BOOLEAN APIENTRY
|
||||
AlphaBltMask(SURFOBJ* Dest,
|
||||
SURFOBJ* Source,
|
||||
AlphaBltMask(SURFOBJ* psoDest,
|
||||
SURFOBJ* psoSource,
|
||||
SURFOBJ* Mask,
|
||||
XLATEOBJ* ColorTranslation,
|
||||
XLATEOBJ* SrcColorTranslation,
|
||||
|
@ -1392,12 +1390,12 @@ AlphaBltMask(SURFOBJ* Dest,
|
|||
{
|
||||
if (*lMask == 0xff)
|
||||
{
|
||||
DibFunctionsForBitmapFormat[Dest->iBitmapFormat].DIB_PutPixel(
|
||||
Dest, DestRect->left + i, DestRect->top + j, Brush->iSolidColor);
|
||||
DibFunctionsForBitmapFormat[psoDest->iBitmapFormat].DIB_PutPixel(
|
||||
psoDest, DestRect->left + i, DestRect->top + j, Brush->iSolidColor);
|
||||
}
|
||||
else
|
||||
{
|
||||
Background = DIB_GetSource(Dest, DestRect->left + i, DestRect->top + j,
|
||||
Background = DIB_GetSource(psoDest, DestRect->left + i, DestRect->top + j,
|
||||
SrcColorTranslation);
|
||||
|
||||
NewColor =
|
||||
|
@ -1406,8 +1404,8 @@ AlphaBltMask(SURFOBJ* Dest,
|
|||
(*lMask * (b - GetBValue(Background)) >> 8) + GetBValue(Background));
|
||||
|
||||
Background = XLATEOBJ_iXlate(ColorTranslation, NewColor);
|
||||
DibFunctionsForBitmapFormat[Dest->iBitmapFormat].DIB_PutPixel(
|
||||
Dest, DestRect->left + i, DestRect->top + j, Background);
|
||||
DibFunctionsForBitmapFormat[psoDest->iBitmapFormat].DIB_PutPixel(
|
||||
psoDest, DestRect->left + i, DestRect->top + j, Background);
|
||||
}
|
||||
}
|
||||
lMask++;
|
||||
|
@ -1423,8 +1421,8 @@ AlphaBltMask(SURFOBJ* Dest,
|
|||
}
|
||||
|
||||
BOOL APIENTRY
|
||||
EngMaskBitBlt(SURFOBJ *DestObj,
|
||||
SURFOBJ *Mask,
|
||||
EngMaskBitBlt(SURFOBJ *psoDest,
|
||||
SURFOBJ *psoMask,
|
||||
CLIPOBJ *ClipRegion,
|
||||
XLATEOBJ *DestColorTranslation,
|
||||
XLATEOBJ *SourceColorTranslation,
|
||||
|
@ -1444,8 +1442,8 @@ EngMaskBitBlt(SURFOBJ *DestObj,
|
|||
POINTL Translate;
|
||||
INTENG_ENTER_LEAVE EnterLeaveSource;
|
||||
INTENG_ENTER_LEAVE EnterLeaveDest;
|
||||
SURFOBJ* InputObj;
|
||||
SURFOBJ* OutputObj;
|
||||
SURFOBJ* psoInput;
|
||||
SURFOBJ* psoOutput;
|
||||
BOOLEAN Ret = TRUE;
|
||||
RECTL ClipRect;
|
||||
unsigned i;
|
||||
|
@ -1453,7 +1451,7 @@ EngMaskBitBlt(SURFOBJ *DestObj,
|
|||
ULONG Direction;
|
||||
POINTL AdjustedBrushOrigin;
|
||||
|
||||
ASSERT ( Mask );
|
||||
ASSERT(psoMask);
|
||||
|
||||
if (NULL != SourcePoint)
|
||||
{
|
||||
|
@ -1470,7 +1468,7 @@ EngMaskBitBlt(SURFOBJ *DestObj,
|
|||
InputRect.bottom = DestRect->bottom - DestRect->top;
|
||||
}
|
||||
|
||||
if (! IntEngEnter(&EnterLeaveSource, DestObj, &InputRect, TRUE, &Translate, &InputObj))
|
||||
if (! IntEngEnter(&EnterLeaveSource, psoDest, &InputRect, TRUE, &Translate, &psoInput))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -1521,7 +1519,7 @@ EngMaskBitBlt(SURFOBJ *DestObj,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
if (! IntEngEnter(&EnterLeaveDest, DestObj, &OutputRect, FALSE, &Translate, &OutputObj))
|
||||
if (! IntEngEnter(&EnterLeaveDest, psoDest, &OutputRect, FALSE, &Translate, &psoOutput))
|
||||
{
|
||||
IntEngLeave(&EnterLeaveSource);
|
||||
return FALSE;
|
||||
|
@ -1551,11 +1549,11 @@ EngMaskBitBlt(SURFOBJ *DestObj,
|
|||
switch (clippingType)
|
||||
{
|
||||
case DC_TRIVIAL:
|
||||
if (Mask->iBitmapFormat == BMF_8BPP)
|
||||
Ret = AlphaBltMask(OutputObj, InputObj, Mask, DestColorTranslation, SourceColorTranslation,
|
||||
if (psoMask->iBitmapFormat == BMF_8BPP)
|
||||
Ret = AlphaBltMask(psoOutput, psoInput, psoMask, DestColorTranslation, SourceColorTranslation,
|
||||
&OutputRect, &InputPoint, MaskOrigin, Brush, &AdjustedBrushOrigin);
|
||||
else
|
||||
Ret = BltMask(OutputObj, InputObj, Mask, DestColorTranslation,
|
||||
Ret = BltMask(psoOutput, psoInput, psoMask, DestColorTranslation,
|
||||
&OutputRect, &InputPoint, MaskOrigin, Brush, &AdjustedBrushOrigin,
|
||||
R4_MASK);
|
||||
break;
|
||||
|
@ -1569,21 +1567,21 @@ EngMaskBitBlt(SURFOBJ *DestObj,
|
|||
{
|
||||
Pt.x = InputPoint.x + CombinedRect.left - OutputRect.left;
|
||||
Pt.y = InputPoint.y + CombinedRect.top - OutputRect.top;
|
||||
if (Mask->iBitmapFormat == BMF_8BPP)
|
||||
if (psoMask->iBitmapFormat == BMF_8BPP)
|
||||
{
|
||||
Ret = AlphaBltMask(OutputObj, InputObj, Mask, DestColorTranslation, SourceColorTranslation,
|
||||
Ret = AlphaBltMask(psoOutput, psoInput, psoMask, DestColorTranslation, SourceColorTranslation,
|
||||
&CombinedRect, &Pt, MaskOrigin, Brush, &AdjustedBrushOrigin);
|
||||
}
|
||||
else
|
||||
{
|
||||
Ret = BltMask(OutputObj, InputObj, Mask, DestColorTranslation,
|
||||
Ret = BltMask(psoOutput, psoInput, psoMask, DestColorTranslation,
|
||||
&CombinedRect, &Pt, MaskOrigin, Brush, &AdjustedBrushOrigin, R4_MASK);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case DC_COMPLEX:
|
||||
Ret = TRUE;
|
||||
if (OutputObj == InputObj)
|
||||
if (psoOutput == psoInput)
|
||||
{
|
||||
if (OutputRect.top < InputPoint.y)
|
||||
{
|
||||
|
@ -1613,9 +1611,9 @@ EngMaskBitBlt(SURFOBJ *DestObj,
|
|||
{
|
||||
Pt.x = InputPoint.x + CombinedRect.left - OutputRect.left;
|
||||
Pt.y = InputPoint.y + CombinedRect.top - OutputRect.top;
|
||||
if (Mask->iBitmapFormat == BMF_8BPP)
|
||||
if (psoMask->iBitmapFormat == BMF_8BPP)
|
||||
{
|
||||
Ret = AlphaBltMask(OutputObj, InputObj, Mask,
|
||||
Ret = AlphaBltMask(psoOutput, psoInput, psoMask,
|
||||
DestColorTranslation,
|
||||
SourceColorTranslation,
|
||||
&CombinedRect, &Pt, MaskOrigin, Brush,
|
||||
|
@ -1623,7 +1621,7 @@ EngMaskBitBlt(SURFOBJ *DestObj,
|
|||
}
|
||||
else
|
||||
{
|
||||
Ret = BltMask(OutputObj, InputObj, Mask,
|
||||
Ret = BltMask(psoOutput, psoInput, psoMask,
|
||||
DestColorTranslation, &CombinedRect, &Pt,
|
||||
MaskOrigin, Brush, &AdjustedBrushOrigin,
|
||||
R4_MASK) && Ret;
|
||||
|
@ -1643,8 +1641,8 @@ EngMaskBitBlt(SURFOBJ *DestObj,
|
|||
}
|
||||
|
||||
BOOL APIENTRY
|
||||
IntEngMaskBlt(SURFOBJ *DestSurf,
|
||||
SURFOBJ *Mask,
|
||||
IntEngMaskBlt(SURFOBJ *psoDest,
|
||||
SURFOBJ *psoMask,
|
||||
CLIPOBJ *ClipRegion,
|
||||
XLATEOBJ *DestColorTranslation,
|
||||
XLATEOBJ *SourceColorTranslation,
|
||||
|
@ -1657,9 +1655,9 @@ IntEngMaskBlt(SURFOBJ *DestSurf,
|
|||
BOOLEAN ret;
|
||||
RECTL OutputRect;
|
||||
POINTL InputPoint;
|
||||
BITMAPOBJ *DestObj;
|
||||
SURFACE *psurfDest;
|
||||
|
||||
ASSERT(Mask);
|
||||
ASSERT(psoMask);
|
||||
|
||||
if (NULL != SourcePoint)
|
||||
{
|
||||
|
@ -1684,30 +1682,30 @@ IntEngMaskBlt(SURFOBJ *DestSurf,
|
|||
|
||||
/* No success yet */
|
||||
ret = FALSE;
|
||||
ASSERT(DestSurf);
|
||||
DestObj = CONTAINING_RECORD(DestSurf, BITMAPOBJ, SurfObj);
|
||||
ASSERT(psoDest);
|
||||
psurfDest = CONTAINING_RECORD(psoDest, SURFACE, SurfObj);
|
||||
|
||||
BITMAPOBJ_LockBitmapBits(DestObj);
|
||||
MouseSafetyOnDrawStart(DestSurf, OutputRect.left, OutputRect.top,
|
||||
SURFACE_LockBitmapBits(psurfDest);
|
||||
MouseSafetyOnDrawStart(psoDest, OutputRect.left, OutputRect.top,
|
||||
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. */
|
||||
IntEngBitBltEx(DestSurf, NULL, Mask, ClipRegion, DestColorTranslation,
|
||||
IntEngBitBltEx(psoDest, NULL, psoMask, ClipRegion, DestColorTranslation,
|
||||
DestRect, SourcePoint, MaskOrigin, Brush, BrushOrigin,
|
||||
R4_NOOP, FALSE);
|
||||
|
||||
ret = EngMaskBitBlt(DestSurf, Mask, ClipRegion, DestColorTranslation, SourceColorTranslation,
|
||||
ret = EngMaskBitBlt(psoDest, psoMask, ClipRegion, DestColorTranslation, SourceColorTranslation,
|
||||
&OutputRect, &InputPoint, MaskOrigin, Brush, BrushOrigin);
|
||||
|
||||
/* Dummy BitBlt to let driver know that something has changed. */
|
||||
IntEngBitBltEx(DestSurf, NULL, Mask, ClipRegion, DestColorTranslation,
|
||||
IntEngBitBltEx(psoDest, NULL, psoMask, ClipRegion, DestColorTranslation,
|
||||
DestRect, SourcePoint, MaskOrigin, Brush, BrushOrigin,
|
||||
R4_NOOP, FALSE);
|
||||
|
||||
MouseSafetyOnDrawEnd(DestSurf);
|
||||
BITMAPOBJ_UnlockBitmapBits(DestObj);
|
||||
MouseSafetyOnDrawEnd(psoDest);
|
||||
SURFACE_UnlockBitmapBits(psurfDest);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -35,8 +35,8 @@
|
|||
* @implemented
|
||||
*/
|
||||
BOOL APIENTRY
|
||||
EngCopyBits(SURFOBJ *Dest,
|
||||
SURFOBJ *Source,
|
||||
EngCopyBits(SURFOBJ *psoDest,
|
||||
SURFOBJ *psoSource,
|
||||
CLIPOBJ *Clip,
|
||||
XLATEOBJ *ColorTranslation,
|
||||
RECTL *DestRect,
|
||||
|
@ -47,24 +47,24 @@ EngCopyBits(SURFOBJ *Dest,
|
|||
RECT_ENUM RectEnum;
|
||||
BOOL EnumMore;
|
||||
BLTINFO BltInfo;
|
||||
BITMAPOBJ *DestObj;
|
||||
BITMAPOBJ *SourceObj;
|
||||
SURFACE *psurfDest;
|
||||
SURFACE *psurfSource;
|
||||
|
||||
ASSERT(Dest != NULL && Source != NULL && DestRect != NULL && SourcePoint != NULL);
|
||||
ASSERT(psoDest != NULL && psoSource != NULL && DestRect != NULL && SourcePoint != NULL);
|
||||
|
||||
SourceObj = CONTAINING_RECORD(Source, BITMAPOBJ, SurfObj);
|
||||
BITMAPOBJ_LockBitmapBits(SourceObj);
|
||||
MouseSafetyOnDrawStart(Source, SourcePoint->x, SourcePoint->y,
|
||||
psurfSource = CONTAINING_RECORD(psoSource, SURFACE, SurfObj);
|
||||
SURFACE_LockBitmapBits(psurfSource);
|
||||
MouseSafetyOnDrawStart(psoSource, SourcePoint->x, SourcePoint->y,
|
||||
(SourcePoint->x + abs(DestRect->right - DestRect->left)),
|
||||
(SourcePoint->y + abs(DestRect->bottom - DestRect->top)));
|
||||
|
||||
DestObj = CONTAINING_RECORD(Dest, BITMAPOBJ, SurfObj);
|
||||
if (Dest != Source)
|
||||
psurfDest = CONTAINING_RECORD(psoDest, SURFACE, SurfObj);
|
||||
if (psoDest != psoSource)
|
||||
{
|
||||
BITMAPOBJ_LockBitmapBits(DestObj);
|
||||
SURFACE_LockBitmapBits(psurfDest);
|
||||
}
|
||||
|
||||
MouseSafetyOnDrawStart(Dest, DestRect->left, DestRect->top, DestRect->right, DestRect->bottom);
|
||||
MouseSafetyOnDrawStart(psoDest, DestRect->left, DestRect->top, DestRect->right, DestRect->bottom);
|
||||
|
||||
// FIXME: Don't punt to the driver's DrvCopyBits immediately. Instead,
|
||||
// mark the copy block function to be DrvCopyBits instead of the
|
||||
|
@ -72,62 +72,62 @@ EngCopyBits(SURFOBJ *Dest,
|
|||
// driver's responsibility
|
||||
|
||||
// If one of the surfaces isn't managed by the GDI
|
||||
if((Dest->iType!=STYPE_BITMAP) || (Source->iType!=STYPE_BITMAP))
|
||||
if((psoDest->iType!=STYPE_BITMAP) || (psoSource->iType!=STYPE_BITMAP))
|
||||
{
|
||||
// Destination surface is device managed
|
||||
if(Dest->iType!=STYPE_BITMAP)
|
||||
if(psoDest->iType!=STYPE_BITMAP)
|
||||
{
|
||||
/* FIXME: Eng* functions shouldn't call Drv* functions. ? */
|
||||
if (DestObj->flHooks & HOOK_COPYBITS)
|
||||
if (psurfDest->flHooks & HOOK_COPYBITS)
|
||||
{
|
||||
ret = GDIDEVFUNCS(Dest).CopyBits(
|
||||
Dest, Source, Clip, ColorTranslation, DestRect, SourcePoint);
|
||||
ret = GDIDEVFUNCS(psoDest).CopyBits(
|
||||
psoDest, psoSource, Clip, ColorTranslation, DestRect, SourcePoint);
|
||||
|
||||
MouseSafetyOnDrawEnd(Dest);
|
||||
if (Dest != Source)
|
||||
MouseSafetyOnDrawEnd(psoDest);
|
||||
if (psoDest != psoSource)
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmapBits(DestObj);
|
||||
SURFACE_UnlockBitmapBits(psurfDest);
|
||||
}
|
||||
MouseSafetyOnDrawEnd(Source);
|
||||
BITMAPOBJ_UnlockBitmapBits(SourceObj);
|
||||
MouseSafetyOnDrawEnd(psoSource);
|
||||
SURFACE_UnlockBitmapBits(psurfSource);
|
||||
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
// Source surface is device managed
|
||||
if(Source->iType!=STYPE_BITMAP)
|
||||
if(psoSource->iType!=STYPE_BITMAP)
|
||||
{
|
||||
/* FIXME: Eng* functions shouldn't call Drv* functions. ? */
|
||||
if (SourceObj->flHooks & HOOK_COPYBITS)
|
||||
if (psurfSource->flHooks & HOOK_COPYBITS)
|
||||
{
|
||||
ret = GDIDEVFUNCS(Source).CopyBits(
|
||||
Dest, Source, Clip, ColorTranslation, DestRect, SourcePoint);
|
||||
ret = GDIDEVFUNCS(psoSource).CopyBits(
|
||||
psoDest, psoSource, Clip, ColorTranslation, DestRect, SourcePoint);
|
||||
|
||||
MouseSafetyOnDrawEnd(Dest);
|
||||
if (Dest != Source)
|
||||
MouseSafetyOnDrawEnd(psoDest);
|
||||
if (psoDest != psoSource)
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmapBits(DestObj);
|
||||
SURFACE_UnlockBitmapBits(psurfDest);
|
||||
}
|
||||
MouseSafetyOnDrawEnd(Source);
|
||||
BITMAPOBJ_UnlockBitmapBits(SourceObj);
|
||||
MouseSafetyOnDrawEnd(psoSource);
|
||||
SURFACE_UnlockBitmapBits(psurfSource);
|
||||
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
// If CopyBits wasn't hooked, BitBlt must be
|
||||
ret = IntEngBitBlt(Dest, Source,
|
||||
ret = IntEngBitBlt(psoDest, psoSource,
|
||||
NULL, Clip, ColorTranslation, DestRect, SourcePoint,
|
||||
NULL, NULL, NULL, ROP3_TO_ROP4(SRCCOPY));
|
||||
|
||||
MouseSafetyOnDrawEnd(Dest);
|
||||
if (Dest != Source)
|
||||
MouseSafetyOnDrawEnd(psoDest);
|
||||
if (psoDest != psoSource)
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmapBits(DestObj);
|
||||
SURFACE_UnlockBitmapBits(psurfDest);
|
||||
}
|
||||
MouseSafetyOnDrawEnd(Source);
|
||||
BITMAPOBJ_UnlockBitmapBits(SourceObj);
|
||||
MouseSafetyOnDrawEnd(psoSource);
|
||||
SURFACE_UnlockBitmapBits(psurfSource);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -140,8 +140,8 @@ EngCopyBits(SURFOBJ *Dest,
|
|||
clippingType = Clip->iDComplexity;
|
||||
}
|
||||
|
||||
BltInfo.DestSurface = Dest;
|
||||
BltInfo.SourceSurface = Source;
|
||||
BltInfo.DestSurface = psoDest;
|
||||
BltInfo.SourceSurface = psoSource;
|
||||
BltInfo.PatternSurface = NULL;
|
||||
BltInfo.XlateSourceToDest = ColorTranslation;
|
||||
BltInfo.XlatePatternToDest = NULL;
|
||||
|
@ -153,15 +153,15 @@ EngCopyBits(SURFOBJ *Dest,
|
|||
BltInfo.DestRect = *DestRect;
|
||||
BltInfo.SourcePoint = *SourcePoint;
|
||||
|
||||
DibFunctionsForBitmapFormat[Dest->iBitmapFormat].DIB_BitBltSrcCopy(&BltInfo);
|
||||
DibFunctionsForBitmapFormat[psoDest->iBitmapFormat].DIB_BitBltSrcCopy(&BltInfo);
|
||||
|
||||
MouseSafetyOnDrawEnd(Dest);
|
||||
if (Dest != Source)
|
||||
MouseSafetyOnDrawEnd(psoDest);
|
||||
if (psoDest != psoSource)
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmapBits(DestObj);
|
||||
SURFACE_UnlockBitmapBits(psurfDest);
|
||||
}
|
||||
MouseSafetyOnDrawEnd(Source);
|
||||
BITMAPOBJ_UnlockBitmapBits(SourceObj);
|
||||
MouseSafetyOnDrawEnd(psoSource);
|
||||
SURFACE_UnlockBitmapBits(psurfSource);
|
||||
|
||||
return(TRUE);
|
||||
|
||||
|
@ -172,15 +172,15 @@ EngCopyBits(SURFOBJ *Dest,
|
|||
BltInfo.SourcePoint.x = SourcePoint->x + BltInfo.DestRect.left - DestRect->left;
|
||||
BltInfo.SourcePoint.y = SourcePoint->y + BltInfo.DestRect.top - DestRect->top;
|
||||
|
||||
DibFunctionsForBitmapFormat[Dest->iBitmapFormat].DIB_BitBltSrcCopy(&BltInfo);
|
||||
DibFunctionsForBitmapFormat[psoDest->iBitmapFormat].DIB_BitBltSrcCopy(&BltInfo);
|
||||
|
||||
MouseSafetyOnDrawEnd(Dest);
|
||||
if (Dest != Source)
|
||||
MouseSafetyOnDrawEnd(psoDest);
|
||||
if (psoDest != psoSource)
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmapBits(DestObj);
|
||||
SURFACE_UnlockBitmapBits(psurfDest);
|
||||
}
|
||||
MouseSafetyOnDrawEnd(Source);
|
||||
BITMAPOBJ_UnlockBitmapBits(SourceObj);
|
||||
MouseSafetyOnDrawEnd(psoSource);
|
||||
SURFACE_UnlockBitmapBits(psurfSource);
|
||||
|
||||
return(TRUE);
|
||||
|
||||
|
@ -202,7 +202,7 @@ EngCopyBits(SURFOBJ *Dest,
|
|||
BltInfo.SourcePoint.x = SourcePoint->x + prcl->left - DestRect->left;
|
||||
BltInfo.SourcePoint.y = SourcePoint->y + prcl->top - DestRect->top;
|
||||
|
||||
if(!DibFunctionsForBitmapFormat[Dest->iBitmapFormat].DIB_BitBltSrcCopy(&BltInfo))
|
||||
if(!DibFunctionsForBitmapFormat[psoDest->iBitmapFormat].DIB_BitBltSrcCopy(&BltInfo))
|
||||
return FALSE;
|
||||
|
||||
prcl++;
|
||||
|
@ -212,24 +212,24 @@ EngCopyBits(SURFOBJ *Dest,
|
|||
|
||||
} while(EnumMore);
|
||||
|
||||
MouseSafetyOnDrawEnd(Dest);
|
||||
if (Dest != Source)
|
||||
MouseSafetyOnDrawEnd(psoDest);
|
||||
if (psoDest != psoSource)
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmapBits(DestObj);
|
||||
SURFACE_UnlockBitmapBits(psurfDest);
|
||||
}
|
||||
MouseSafetyOnDrawEnd(Source);
|
||||
BITMAPOBJ_UnlockBitmapBits(SourceObj);
|
||||
MouseSafetyOnDrawEnd(psoSource);
|
||||
SURFACE_UnlockBitmapBits(psurfSource);
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
MouseSafetyOnDrawEnd(Dest);
|
||||
if (Dest != Source)
|
||||
MouseSafetyOnDrawEnd(psoDest);
|
||||
if (psoDest != psoSource)
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmapBits(DestObj);
|
||||
SURFACE_UnlockBitmapBits(psurfDest);
|
||||
}
|
||||
MouseSafetyOnDrawEnd(Source);
|
||||
BITMAPOBJ_UnlockBitmapBits(SourceObj);
|
||||
MouseSafetyOnDrawEnd(psoSource);
|
||||
SURFACE_UnlockBitmapBits(psurfSource);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
@ -25,11 +25,11 @@
|
|||
|
||||
BOOL APIENTRY
|
||||
IntEngEnter(PINTENG_ENTER_LEAVE EnterLeave,
|
||||
SURFOBJ *DestSurf,
|
||||
SURFOBJ *psoDest,
|
||||
RECTL *DestRect,
|
||||
BOOL ReadOnly,
|
||||
POINTL *Translate,
|
||||
SURFOBJ **OutputSurf)
|
||||
SURFOBJ **ppsoOutput)
|
||||
{
|
||||
LONG Exchange;
|
||||
SIZEL BitmapSize;
|
||||
|
@ -51,12 +51,12 @@ IntEngEnter(PINTENG_ENTER_LEAVE EnterLeave,
|
|||
DestRect->bottom = Exchange;
|
||||
}
|
||||
|
||||
if (NULL != DestSurf && STYPE_BITMAP != DestSurf->iType &&
|
||||
(NULL == DestSurf->pvScan0 || 0 == DestSurf->lDelta))
|
||||
if (NULL != psoDest && STYPE_BITMAP != psoDest->iType &&
|
||||
(NULL == psoDest->pvScan0 || 0 == psoDest->lDelta))
|
||||
{
|
||||
/* Driver needs to support DrvCopyBits, else we can't do anything */
|
||||
BITMAPOBJ *DestBmp = CONTAINING_RECORD(DestSurf, BITMAPOBJ, SurfObj);
|
||||
if (!(DestBmp->flHooks & HOOK_COPYBITS))
|
||||
SURFACE *psurfDest = CONTAINING_RECORD(psoDest, SURFACE, SurfObj);
|
||||
if (!(psurfDest->flHooks & HOOK_COPYBITS))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -64,9 +64,9 @@ IntEngEnter(PINTENG_ENTER_LEAVE EnterLeave,
|
|||
/* Allocate a temporary bitmap */
|
||||
BitmapSize.cx = DestRect->right - DestRect->left;
|
||||
BitmapSize.cy = DestRect->bottom - DestRect->top;
|
||||
Width = DIB_GetDIBWidthBytes(BitmapSize.cx, BitsPerFormat(DestSurf->iBitmapFormat));
|
||||
Width = DIB_GetDIBWidthBytes(BitmapSize.cx, BitsPerFormat(psoDest->iBitmapFormat));
|
||||
EnterLeave->OutputBitmap = EngCreateBitmap(BitmapSize, Width,
|
||||
DestSurf->iBitmapFormat,
|
||||
psoDest->iBitmapFormat,
|
||||
BMF_TOPDOWN | BMF_NOZEROINIT, NULL);
|
||||
|
||||
if (!EnterLeave->OutputBitmap)
|
||||
|
@ -75,7 +75,7 @@ IntEngEnter(PINTENG_ENTER_LEAVE EnterLeave,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
*OutputSurf = EngLockSurface((HSURF)EnterLeave->OutputBitmap);
|
||||
*ppsoOutput = EngLockSurface((HSURF)EnterLeave->OutputBitmap);
|
||||
|
||||
EnterLeave->DestRect.left = 0;
|
||||
EnterLeave->DestRect.top = 0;
|
||||
|
@ -89,35 +89,35 @@ IntEngEnter(PINTENG_ENTER_LEAVE EnterLeave,
|
|||
ClippedDestRect.left -= SrcPoint.x;
|
||||
SrcPoint.x = 0;
|
||||
}
|
||||
if (DestSurf->sizlBitmap.cx < SrcPoint.x + ClippedDestRect.right - ClippedDestRect.left)
|
||||
if (psoDest->sizlBitmap.cx < SrcPoint.x + ClippedDestRect.right - ClippedDestRect.left)
|
||||
{
|
||||
ClippedDestRect.right = ClippedDestRect.left + DestSurf->sizlBitmap.cx - SrcPoint.x;
|
||||
ClippedDestRect.right = ClippedDestRect.left + psoDest->sizlBitmap.cx - SrcPoint.x;
|
||||
}
|
||||
if (SrcPoint.y < 0)
|
||||
{
|
||||
ClippedDestRect.top -= SrcPoint.y;
|
||||
SrcPoint.y = 0;
|
||||
}
|
||||
if (DestSurf->sizlBitmap.cy < SrcPoint.y + ClippedDestRect.bottom - ClippedDestRect.top)
|
||||
if (psoDest->sizlBitmap.cy < SrcPoint.y + ClippedDestRect.bottom - ClippedDestRect.top)
|
||||
{
|
||||
ClippedDestRect.bottom = ClippedDestRect.top + DestSurf->sizlBitmap.cy - SrcPoint.y;
|
||||
ClippedDestRect.bottom = ClippedDestRect.top + psoDest->sizlBitmap.cy - SrcPoint.y;
|
||||
}
|
||||
EnterLeave->TrivialClipObj = EngCreateClip();
|
||||
EnterLeave->TrivialClipObj->iDComplexity = DC_TRIVIAL;
|
||||
if (ClippedDestRect.left < (*OutputSurf)->sizlBitmap.cx &&
|
||||
if (ClippedDestRect.left < (*ppsoOutput)->sizlBitmap.cx &&
|
||||
0 <= ClippedDestRect.right &&
|
||||
SrcPoint.x < DestSurf->sizlBitmap.cx &&
|
||||
ClippedDestRect.top <= (*OutputSurf)->sizlBitmap.cy &&
|
||||
SrcPoint.x < psoDest->sizlBitmap.cx &&
|
||||
ClippedDestRect.top <= (*ppsoOutput)->sizlBitmap.cy &&
|
||||
0 <= ClippedDestRect.bottom &&
|
||||
SrcPoint.y < DestSurf->sizlBitmap.cy &&
|
||||
! GDIDEVFUNCS(DestSurf).CopyBits(
|
||||
*OutputSurf, DestSurf,
|
||||
SrcPoint.y < psoDest->sizlBitmap.cy &&
|
||||
! GDIDEVFUNCS(psoDest).CopyBits(
|
||||
*ppsoOutput, psoDest,
|
||||
EnterLeave->TrivialClipObj, NULL,
|
||||
&ClippedDestRect, &SrcPoint))
|
||||
{
|
||||
EngDeleteClip(EnterLeave->TrivialClipObj);
|
||||
EngFreeMem((*OutputSurf)->pvBits);
|
||||
EngUnlockSurface(*OutputSurf);
|
||||
EngFreeMem((*ppsoOutput)->pvBits);
|
||||
EngUnlockSurface(*ppsoOutput);
|
||||
EngDeleteSurface((HSURF)EnterLeave->OutputBitmap);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -132,28 +132,28 @@ IntEngEnter(PINTENG_ENTER_LEAVE EnterLeave,
|
|||
{
|
||||
Translate->x = 0;
|
||||
Translate->y = 0;
|
||||
*OutputSurf = DestSurf;
|
||||
*ppsoOutput = psoDest;
|
||||
}
|
||||
|
||||
if (NULL != *OutputSurf)
|
||||
if (NULL != *ppsoOutput)
|
||||
{
|
||||
BITMAPOBJ* OutputBmp = CONTAINING_RECORD(*OutputSurf, BITMAPOBJ, SurfObj);
|
||||
if (0 != (OutputBmp->flHooks & HOOK_SYNCHRONIZE))
|
||||
SURFACE* psurfOutput = CONTAINING_RECORD(*ppsoOutput, SURFACE, SurfObj);
|
||||
if (0 != (psurfOutput->flHooks & HOOK_SYNCHRONIZE))
|
||||
{
|
||||
if (NULL != GDIDEVFUNCS(*OutputSurf).SynchronizeSurface)
|
||||
if (NULL != GDIDEVFUNCS(*ppsoOutput).SynchronizeSurface)
|
||||
{
|
||||
GDIDEVFUNCS(*OutputSurf).SynchronizeSurface(*OutputSurf, DestRect, 0);
|
||||
GDIDEVFUNCS(*ppsoOutput).SynchronizeSurface(*ppsoOutput, DestRect, 0);
|
||||
}
|
||||
else if (STYPE_BITMAP == (*OutputSurf)->iType
|
||||
&& NULL != GDIDEVFUNCS(*OutputSurf).Synchronize)
|
||||
else if (STYPE_BITMAP == (*ppsoOutput)->iType
|
||||
&& NULL != GDIDEVFUNCS(*ppsoOutput).Synchronize)
|
||||
{
|
||||
GDIDEVFUNCS(*OutputSurf).Synchronize((*OutputSurf)->dhpdev, DestRect);
|
||||
GDIDEVFUNCS(*ppsoOutput).Synchronize((*ppsoOutput)->dhpdev, DestRect);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EnterLeave->DestObj = DestSurf;
|
||||
EnterLeave->OutputObj = *OutputSurf;
|
||||
EnterLeave->DestObj = psoDest;
|
||||
EnterLeave->OutputObj = *ppsoOutput;
|
||||
EnterLeave->ReadOnly = ReadOnly;
|
||||
|
||||
return TRUE;
|
||||
|
|
|
@ -76,7 +76,7 @@ IntEngGradientFillRect(
|
|||
IN POINTL *pptlDitherOrg,
|
||||
IN BOOL Horizontal)
|
||||
{
|
||||
SURFOBJ *OutputObj;
|
||||
SURFOBJ *psoOutput;
|
||||
TRIVERTEX *v1, *v2;
|
||||
RECTL rcGradient, rcSG;
|
||||
RECT_ENUM RectEnum;
|
||||
|
@ -105,7 +105,7 @@ IntEngGradientFillRect(
|
|||
dy = abs(rcGradient.bottom - rcGradient.top);
|
||||
}
|
||||
|
||||
if(!IntEngEnter(&EnterLeave, psoDest, &rcSG, FALSE, &Translate, &OutputObj))
|
||||
if(!IntEngEnter(&EnterLeave, psoDest, &rcSG, FALSE, &Translate, &psoOutput))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -134,8 +134,8 @@ IntEngGradientFillRect(
|
|||
if(y >= FillRect.left)
|
||||
{
|
||||
Color = XLATEOBJ_iXlate(pxlo, RGB(c[0], c[1], c[2]));
|
||||
DibFunctionsForBitmapFormat[OutputObj->iBitmapFormat].DIB_VLine(
|
||||
OutputObj, y, FillRect.top, FillRect.bottom, Color);
|
||||
DibFunctionsForBitmapFormat[psoOutput->iBitmapFormat].DIB_VLine(
|
||||
psoOutput, y, FillRect.top, FillRect.bottom, Color);
|
||||
}
|
||||
HVSTEPCOL(0);
|
||||
HVSTEPCOL(1);
|
||||
|
@ -162,8 +162,8 @@ IntEngGradientFillRect(
|
|||
if(y >= FillRect.top)
|
||||
{
|
||||
Color = XLATEOBJ_iXlate(pxlo, RGB(c[0], c[1], c[2]));
|
||||
DibFunctionsForBitmapFormat[OutputObj->iBitmapFormat].DIB_HLine(
|
||||
OutputObj, FillRect.left, FillRect.right, y, Color);
|
||||
DibFunctionsForBitmapFormat[psoOutput->iBitmapFormat].DIB_HLine(
|
||||
psoOutput, FillRect.left, FillRect.right, y, Color);
|
||||
}
|
||||
HVSTEPCOL(0);
|
||||
HVSTEPCOL(1);
|
||||
|
@ -191,8 +191,8 @@ IntEngGradientFillRect(
|
|||
{
|
||||
for(; FillRect.top < FillRect.bottom; FillRect.top++)
|
||||
{
|
||||
DibFunctionsForBitmapFormat[OutputObj->iBitmapFormat].DIB_HLine(
|
||||
OutputObj, FillRect.left, FillRect.right, FillRect.top, Color);
|
||||
DibFunctionsForBitmapFormat[psoOutput->iBitmapFormat].DIB_HLine(
|
||||
psoOutput, FillRect.left, FillRect.right, FillRect.top, Color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -204,9 +204,9 @@ IntEngGradientFillRect(
|
|||
/* Fill triangle with solid color */
|
||||
#define S_FILLLINE(linefrom,lineto) \
|
||||
if(sx[lineto] < sx[linefrom]) \
|
||||
DibFunctionsForBitmapFormat[OutputObj->iBitmapFormat].DIB_HLine(OutputObj, max(sx[lineto], FillRect.left), min(sx[linefrom], FillRect.right), sy, Color); \
|
||||
DibFunctionsForBitmapFormat[psoOutput->iBitmapFormat].DIB_HLine(psoOutput, max(sx[lineto], FillRect.left), min(sx[linefrom], FillRect.right), sy, Color); \
|
||||
else \
|
||||
DibFunctionsForBitmapFormat[OutputObj->iBitmapFormat].DIB_HLine(OutputObj, max(sx[linefrom], FillRect.left), min(sx[lineto], FillRect.right), sy, Color);
|
||||
DibFunctionsForBitmapFormat[psoOutput->iBitmapFormat].DIB_HLine(psoOutput, max(sx[linefrom], FillRect.left), min(sx[lineto], FillRect.right), sy, Color);
|
||||
#define S_DOLINE(a,b,line) \
|
||||
ex[line] += dx[line]; \
|
||||
while(ex[line] > 0 && x[line] != destx[line]) \
|
||||
|
@ -265,7 +265,7 @@ IntEngGradientFillRect(
|
|||
if(InY && g >= FillRect.left && g < FillRect.right) \
|
||||
{ \
|
||||
Color = XLATEOBJ_iXlate(pxlo, RGB(gc[0], gc[1], gc[2])); \
|
||||
DibFunctionsForBitmapFormat[OutputObj->iBitmapFormat].DIB_PutPixel(OutputObj, g, sy, Color); \
|
||||
DibFunctionsForBitmapFormat[psoOutput->iBitmapFormat].DIB_PutPixel(psoOutput, g, sy, Color); \
|
||||
} \
|
||||
FDOCOL(linefrom, lineto, 0); \
|
||||
FDOCOL(linefrom, lineto, 1); \
|
||||
|
@ -316,7 +316,7 @@ IntEngGradientFillTriangle(
|
|||
IN RECTL *prclExtents,
|
||||
IN POINTL *pptlDitherOrg)
|
||||
{
|
||||
SURFOBJ *OutputObj;
|
||||
SURFOBJ *psoOutput;
|
||||
PTRIVERTEX v1, v2, v3;
|
||||
//RECT_ENUM RectEnum;
|
||||
//BOOL EnumMore;
|
||||
|
@ -356,7 +356,7 @@ IntEngGradientFillTriangle(
|
|||
/* FIXME: commented out because of an endless loop - fix triangles first */
|
||||
DbgPrint("FIXME: IntEngGradientFillTriangle is broken");
|
||||
|
||||
if(!IntEngEnter(&EnterLeave, psoDest, &FillRect, FALSE, &Translate, &OutputObj))
|
||||
if(!IntEngEnter(&EnterLeave, psoDest, &FillRect, FALSE, &Translate, &psoOutput))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -553,20 +553,20 @@ IntEngGradientFill(
|
|||
IN ULONG ulMode)
|
||||
{
|
||||
BOOL Ret;
|
||||
BITMAPOBJ *pboDest;
|
||||
SURFACE *psurf;
|
||||
ASSERT(psoDest);
|
||||
|
||||
pboDest = CONTAINING_RECORD(psoDest, BITMAPOBJ, SurfObj);
|
||||
ASSERT(pboDest);
|
||||
psurf = CONTAINING_RECORD(psoDest, SURFACE, SurfObj);
|
||||
ASSERT(psurf);
|
||||
|
||||
BITMAPOBJ_LockBitmapBits(pboDest);
|
||||
SURFACE_LockBitmapBits(psurf);
|
||||
MouseSafetyOnDrawStart(
|
||||
psoDest,
|
||||
pco->rclBounds.left,
|
||||
pco->rclBounds.top,
|
||||
pco->rclBounds.right,
|
||||
pco->rclBounds.bottom);
|
||||
if(pboDest->flHooks & HOOK_GRADIENTFILL)
|
||||
if(psurf->flHooks & HOOK_GRADIENTFILL)
|
||||
{
|
||||
Ret = GDIDEVFUNCS(psoDest).GradientFill(
|
||||
psoDest, pco, pxlo, pVertex, nVertex, pMesh, nMesh,
|
||||
|
@ -578,7 +578,7 @@ IntEngGradientFill(
|
|||
pptlDitherOrg, ulMode);
|
||||
}
|
||||
MouseSafetyOnDrawEnd(psoDest);
|
||||
BITMAPOBJ_UnlockBitmapBits(pboDest);
|
||||
SURFACE_UnlockBitmapBits(psurf);
|
||||
|
||||
return Ret;
|
||||
}
|
||||
|
|
|
@ -506,7 +506,7 @@ EngLineTo(SURFOBJ *DestObj,
|
|||
}
|
||||
|
||||
BOOL APIENTRY
|
||||
IntEngLineTo(SURFOBJ *DestSurf,
|
||||
IntEngLineTo(SURFOBJ *psoDest,
|
||||
CLIPOBJ *ClipObj,
|
||||
BRUSHOBJ *Brush,
|
||||
LONG x1,
|
||||
|
@ -517,13 +517,13 @@ IntEngLineTo(SURFOBJ *DestSurf,
|
|||
MIX Mix)
|
||||
{
|
||||
BOOLEAN ret;
|
||||
BITMAPOBJ *DestObj;
|
||||
SURFACE *psurfDest;
|
||||
PGDIBRUSHINST GdiBrush;
|
||||
RECTL b;
|
||||
|
||||
ASSERT(DestSurf);
|
||||
DestObj = CONTAINING_RECORD(DestSurf, BITMAPOBJ, SurfObj);
|
||||
ASSERT(DestObj);
|
||||
ASSERT(psoDest);
|
||||
psurfDest = CONTAINING_RECORD(psoDest, SURFACE, SurfObj);
|
||||
ASSERT(psurfDest);
|
||||
|
||||
GdiBrush = CONTAINING_RECORD(
|
||||
Brush,
|
||||
|
@ -544,9 +544,9 @@ IntEngLineTo(SURFOBJ *DestSurf,
|
|||
if (NULL == ClipObj || DC_TRIVIAL == ClipObj->iDComplexity)
|
||||
{
|
||||
b.left = 0;
|
||||
b.right = DestSurf->sizlBitmap.cx;
|
||||
b.right = psoDest->sizlBitmap.cx;
|
||||
b.top = 0;
|
||||
b.bottom = DestSurf->sizlBitmap.cy;
|
||||
b.bottom = psoDest->sizlBitmap.cy;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -565,18 +565,18 @@ IntEngLineTo(SURFOBJ *DestSurf,
|
|||
if (b.left == b.right) b.right++;
|
||||
if (b.top == b.bottom) b.bottom++;
|
||||
|
||||
BITMAPOBJ_LockBitmapBits(DestObj);
|
||||
MouseSafetyOnDrawStart(DestSurf, x1, y1, x2, y2);
|
||||
SURFACE_LockBitmapBits(psurfDest);
|
||||
MouseSafetyOnDrawStart(psoDest, x1, y1, x2, y2);
|
||||
|
||||
if (DestObj->flHooks & HOOK_LINETO)
|
||||
if (psurfDest->flHooks & HOOK_LINETO)
|
||||
{
|
||||
/* Call the driver's DrvLineTo */
|
||||
ret = GDIDEVFUNCS(DestSurf).LineTo(
|
||||
DestSurf, ClipObj, Brush, x1, y1, x2, y2, &b, Mix);
|
||||
ret = GDIDEVFUNCS(psoDest).LineTo(
|
||||
psoDest, ClipObj, Brush, x1, y1, x2, y2, &b, Mix);
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (! ret && (DestObj->flHooks & HOOK_STROKEPATH))
|
||||
if (! ret && (psurfDest->flHooks & HOOK_STROKEPATH))
|
||||
{
|
||||
/* FIXME: Emulate LineTo using drivers DrvStrokePath and set ret on success */
|
||||
}
|
||||
|
@ -584,17 +584,17 @@ IntEngLineTo(SURFOBJ *DestSurf,
|
|||
|
||||
if (! ret)
|
||||
{
|
||||
ret = EngLineTo(DestSurf, ClipObj, Brush, x1, y1, x2, y2, RectBounds, Mix);
|
||||
ret = EngLineTo(psoDest, ClipObj, Brush, x1, y1, x2, y2, RectBounds, Mix);
|
||||
}
|
||||
|
||||
MouseSafetyOnDrawEnd(DestSurf);
|
||||
BITMAPOBJ_UnlockBitmapBits(DestObj);
|
||||
MouseSafetyOnDrawEnd(psoDest);
|
||||
SURFACE_UnlockBitmapBits(psurfDest);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
BOOL APIENTRY
|
||||
IntEngPolyline(SURFOBJ *DestSurf,
|
||||
IntEngPolyline(SURFOBJ *psoDest,
|
||||
CLIPOBJ *Clip,
|
||||
BRUSHOBJ *Brush,
|
||||
CONST LPPOINT pt,
|
||||
|
@ -612,7 +612,7 @@ IntEngPolyline(SURFOBJ *DestSurf,
|
|||
rect.top = min(pt[i-1].y, pt[i].y);
|
||||
rect.right = max(pt[i-1].x, pt[i].x);
|
||||
rect.bottom = max(pt[i-1].y, pt[i].y);
|
||||
ret = IntEngLineTo(DestSurf,
|
||||
ret = IntEngLineTo(psoDest,
|
||||
Clip,
|
||||
Brush,
|
||||
pt[i-1].x,
|
||||
|
|
|
@ -138,13 +138,13 @@ MouseSafetyOnDrawEnd(SURFOBJ *SurfObj)
|
|||
/* SOFTWARE MOUSE POINTER IMPLEMENTATION **************************************/
|
||||
|
||||
VOID INTERNAL_CALL
|
||||
IntHideMousePointer(GDIDEVICE *ppdev, SURFOBJ *DestSurface)
|
||||
IntHideMousePointer(GDIDEVICE *ppdev, SURFOBJ *psoDest)
|
||||
{
|
||||
GDIPOINTER *pgp;
|
||||
POINTL pt;
|
||||
|
||||
ASSERT(ppdev);
|
||||
ASSERT(DestSurface);
|
||||
ASSERT(psoDest);
|
||||
|
||||
pgp = &ppdev->Pointer;
|
||||
|
||||
|
@ -184,10 +184,10 @@ IntHideMousePointer(GDIDEVICE *ppdev, SURFOBJ *DestSurface)
|
|||
DestRect.top = max(pt.y, 0);
|
||||
DestRect.right = min(
|
||||
pt.x + pgp->Size.cx,
|
||||
DestSurface->sizlBitmap.cx);
|
||||
psoDest->sizlBitmap.cx);
|
||||
DestRect.bottom = min(
|
||||
pt.y + pgp->Size.cy,
|
||||
DestSurface->sizlBitmap.cy);
|
||||
psoDest->sizlBitmap.cy);
|
||||
|
||||
SrcPoint.x = max(-pt.x, 0);
|
||||
SrcPoint.y = max(-pt.y, 0);
|
||||
|
@ -196,7 +196,7 @@ IntHideMousePointer(GDIDEVICE *ppdev, SURFOBJ *DestSurface)
|
|||
{
|
||||
if((MaskSurface = EngLockSurface(pgp->MaskSurface)))
|
||||
{
|
||||
IntEngBitBltEx(DestSurface, SaveSurface, MaskSurface, NULL, NULL,
|
||||
IntEngBitBltEx(psoDest, SaveSurface, MaskSurface, NULL, NULL,
|
||||
&DestRect, &SrcPoint, &SrcPoint, NULL, NULL,
|
||||
ROP3_TO_ROP4(SRCCOPY), FALSE);
|
||||
EngUnlockSurface(MaskSurface);
|
||||
|
@ -207,14 +207,14 @@ IntHideMousePointer(GDIDEVICE *ppdev, SURFOBJ *DestSurface)
|
|||
}
|
||||
|
||||
VOID INTERNAL_CALL
|
||||
IntShowMousePointer(GDIDEVICE *ppdev, SURFOBJ *DestSurface)
|
||||
IntShowMousePointer(GDIDEVICE *ppdev, SURFOBJ *psoDest)
|
||||
{
|
||||
GDIPOINTER *pgp;
|
||||
SURFOBJ *SaveSurface;
|
||||
POINTL pt;
|
||||
|
||||
ASSERT(ppdev);
|
||||
ASSERT(DestSurface);
|
||||
ASSERT(psoDest);
|
||||
|
||||
pgp = &ppdev->Pointer;
|
||||
|
||||
|
@ -253,12 +253,12 @@ IntShowMousePointer(GDIDEVICE *ppdev, SURFOBJ *DestSurface)
|
|||
DestRect.top = SrcPoint.y - pt.y;
|
||||
DestRect.right = min(
|
||||
pgp->Size.cx,
|
||||
DestSurface->sizlBitmap.cx - pt.x);
|
||||
psoDest->sizlBitmap.cx - pt.x);
|
||||
DestRect.bottom = min(
|
||||
pgp->Size.cy,
|
||||
DestSurface->sizlBitmap.cy - pt.y);
|
||||
psoDest->sizlBitmap.cy - pt.y);
|
||||
|
||||
IntEngBitBltEx(SaveSurface, DestSurface, NULL, NULL, NULL,
|
||||
IntEngBitBltEx(SaveSurface, psoDest, NULL, NULL, NULL,
|
||||
&DestRect, &SrcPoint, NULL, NULL, NULL,
|
||||
ROP3_TO_ROP4(SRCCOPY), FALSE);
|
||||
EngUnlockSurface(SaveSurface);
|
||||
|
@ -272,48 +272,48 @@ IntShowMousePointer(GDIDEVICE *ppdev, SURFOBJ *DestSurface)
|
|||
{
|
||||
RECTL DestRect;
|
||||
POINTL SrcPoint;
|
||||
SURFOBJ *ColorSurf;
|
||||
SURFOBJ *MaskSurf = NULL;
|
||||
SURFOBJ *psoColor;
|
||||
SURFOBJ *psoMask = NULL;
|
||||
|
||||
DestRect.left = max(pt.x, 0);
|
||||
DestRect.top = max(pt.y, 0);
|
||||
DestRect.right = min(
|
||||
pt.x + pgp->Size.cx,
|
||||
DestSurface->sizlBitmap.cx);
|
||||
psoDest->sizlBitmap.cx);
|
||||
DestRect.bottom = min(
|
||||
pt.y + pgp->Size.cy,
|
||||
DestSurface->sizlBitmap.cy);
|
||||
psoDest->sizlBitmap.cy);
|
||||
|
||||
SrcPoint.x = max(-pt.x, 0);
|
||||
SrcPoint.y = max(-pt.y, 0);
|
||||
|
||||
|
||||
if (pgp->MaskSurface)
|
||||
MaskSurf = EngLockSurface(pgp->MaskSurface);
|
||||
psoMask = EngLockSurface(pgp->MaskSurface);
|
||||
|
||||
if (MaskSurf != NULL)
|
||||
if (psoMask != NULL)
|
||||
{
|
||||
if (pgp->ColorSurface != NULL)
|
||||
{
|
||||
if((ColorSurf = EngLockSurface(pgp->ColorSurface)))
|
||||
if((psoColor = EngLockSurface(pgp->ColorSurface)))
|
||||
{
|
||||
IntEngBitBltEx(DestSurface, ColorSurf, MaskSurf, NULL,
|
||||
IntEngBitBltEx(psoDest, psoColor, psoMask, NULL,
|
||||
pgp->XlateObject, &DestRect, &SrcPoint, &SrcPoint,
|
||||
NULL, NULL, R4_MASK, FALSE);
|
||||
EngUnlockSurface(ColorSurf);
|
||||
EngUnlockSurface(psoColor);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
IntEngBitBltEx(DestSurface, MaskSurf, NULL, NULL, pgp->XlateObject,
|
||||
IntEngBitBltEx(psoDest, psoMask, NULL, NULL, pgp->XlateObject,
|
||||
&DestRect, &SrcPoint, NULL, NULL, NULL,
|
||||
ROP3_TO_ROP4(SRCAND), FALSE);
|
||||
SrcPoint.y += pgp->Size.cy;
|
||||
IntEngBitBltEx(DestSurface, MaskSurf, NULL, NULL, pgp->XlateObject,
|
||||
IntEngBitBltEx(psoDest, psoMask, NULL, NULL, pgp->XlateObject,
|
||||
&DestRect, &SrcPoint, NULL, NULL, NULL,
|
||||
ROP3_TO_ROP4(SRCINVERT), FALSE);
|
||||
}
|
||||
EngUnlockSurface(MaskSurf);
|
||||
EngUnlockSurface(psoMask);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -336,7 +336,7 @@ EngSetPointerShape(
|
|||
IN FLONG fl)
|
||||
{
|
||||
GDIDEVICE *ppdev;
|
||||
SURFOBJ *TempSurfObj;
|
||||
SURFOBJ *psoTemp;
|
||||
GDIPOINTER *pgp;
|
||||
|
||||
ASSERT(pso);
|
||||
|
@ -349,11 +349,11 @@ EngSetPointerShape(
|
|||
if (pgp->ColorSurface != NULL)
|
||||
{
|
||||
/* FIXME: Is this really needed? */
|
||||
if((TempSurfObj = EngLockSurface(pgp->ColorSurface)))
|
||||
if((psoTemp = EngLockSurface(pgp->ColorSurface)))
|
||||
{
|
||||
EngFreeMem(TempSurfObj->pvBits);
|
||||
TempSurfObj->pvBits = 0;
|
||||
EngUnlockSurface(TempSurfObj);
|
||||
EngFreeMem(psoTemp->pvBits);
|
||||
psoTemp->pvBits = 0;
|
||||
EngUnlockSurface(psoTemp);
|
||||
}
|
||||
|
||||
EngDeleteSurface(pgp->ColorSurface);
|
||||
|
@ -363,11 +363,11 @@ EngSetPointerShape(
|
|||
if (pgp->MaskSurface != NULL)
|
||||
{
|
||||
/* FIXME: Is this really needed? */
|
||||
if((TempSurfObj = EngLockSurface(pgp->MaskSurface)))
|
||||
if((psoTemp = EngLockSurface(pgp->MaskSurface)))
|
||||
{
|
||||
EngFreeMem(TempSurfObj->pvBits);
|
||||
TempSurfObj->pvBits = 0;
|
||||
EngUnlockSurface(TempSurfObj);
|
||||
EngFreeMem(psoTemp->pvBits);
|
||||
psoTemp->pvBits = 0;
|
||||
EngUnlockSurface(psoTemp);
|
||||
}
|
||||
|
||||
EngDeleteSurface(pgp->MaskSurface);
|
||||
|
@ -569,23 +569,23 @@ EngMovePointer(
|
|||
|
||||
VOID APIENTRY
|
||||
IntEngMovePointer(
|
||||
IN SURFOBJ *SurfObj,
|
||||
IN SURFOBJ *pso,
|
||||
IN LONG x,
|
||||
IN LONG y,
|
||||
IN RECTL *prcl)
|
||||
{
|
||||
BITMAPOBJ *BitmapObj = CONTAINING_RECORD(SurfObj, BITMAPOBJ, SurfObj);
|
||||
SURFACE *psurf = CONTAINING_RECORD(pso, SURFACE, SurfObj);
|
||||
|
||||
BITMAPOBJ_LockBitmapBits(BitmapObj);
|
||||
if (GDIDEV(SurfObj)->Pointer.MovePointer)
|
||||
SURFACE_LockBitmapBits(psurf);
|
||||
if (GDIDEV(pso)->Pointer.MovePointer)
|
||||
{
|
||||
GDIDEV(SurfObj)->Pointer.MovePointer(SurfObj, x, y, prcl);
|
||||
GDIDEV(pso)->Pointer.MovePointer(pso, x, y, prcl);
|
||||
}
|
||||
else
|
||||
{
|
||||
EngMovePointer(SurfObj, x, y, prcl);
|
||||
EngMovePointer(pso, x, y, prcl);
|
||||
}
|
||||
BITMAPOBJ_UnlockBitmapBits(BitmapObj);
|
||||
SURFACE_UnlockBitmapBits(psurf);
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -32,39 +32,39 @@
|
|||
#define NDEBUG
|
||||
#include <debug.h>
|
||||
|
||||
BOOL APIENTRY FillSolid(SURFOBJ *Surface, PRECTL pRect, ULONG iColor)
|
||||
BOOL APIENTRY FillSolid(SURFOBJ *pso, PRECTL pRect, ULONG iColor)
|
||||
{
|
||||
LONG y;
|
||||
ULONG LineWidth;
|
||||
BITMAPOBJ *BitmapObj;
|
||||
SURFACE *psurf;
|
||||
|
||||
ASSERT ( Surface );
|
||||
ASSERT ( pRect );
|
||||
BitmapObj = CONTAINING_RECORD(Surface, BITMAPOBJ, SurfObj);
|
||||
BITMAPOBJ_LockBitmapBits(BitmapObj);
|
||||
MouseSafetyOnDrawStart(Surface, pRect->left, pRect->top, pRect->right, pRect->bottom);
|
||||
ASSERT(pso);
|
||||
ASSERT(pRect);
|
||||
psurf = CONTAINING_RECORD(pso, SURFACE, SurfObj);
|
||||
SURFACE_LockBitmapBits(psurf);
|
||||
MouseSafetyOnDrawStart(pso, pRect->left, pRect->top, pRect->right, pRect->bottom);
|
||||
LineWidth = pRect->right - pRect->left;
|
||||
DPRINT(" LineWidth: %d, top: %d, bottom: %d\n", LineWidth, pRect->top, pRect->bottom);
|
||||
for (y = pRect->top; y < pRect->bottom; y++)
|
||||
{
|
||||
DibFunctionsForBitmapFormat[Surface->iBitmapFormat].DIB_HLine(
|
||||
Surface, pRect->left, pRect->right, y, iColor);
|
||||
DibFunctionsForBitmapFormat[pso->iBitmapFormat].DIB_HLine(
|
||||
pso, pRect->left, pRect->right, y, iColor);
|
||||
}
|
||||
MouseSafetyOnDrawEnd(Surface);
|
||||
BITMAPOBJ_UnlockBitmapBits(BitmapObj);
|
||||
MouseSafetyOnDrawEnd(pso);
|
||||
SURFACE_UnlockBitmapBits(psurf);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL APIENTRY
|
||||
EngPaintRgn(SURFOBJ *Surface, CLIPOBJ *ClipRegion, ULONG iColor, MIX Mix,
|
||||
EngPaintRgn(SURFOBJ *pso, CLIPOBJ *ClipRegion, ULONG iColor, MIX Mix,
|
||||
BRUSHOBJ *BrushObj, POINTL *BrushPoint)
|
||||
{
|
||||
RECT_ENUM RectEnum;
|
||||
BOOL EnumMore;
|
||||
ULONG i;
|
||||
|
||||
ASSERT(Surface);
|
||||
ASSERT(pso);
|
||||
ASSERT(ClipRegion);
|
||||
|
||||
DPRINT("ClipRegion->iMode:%d, ClipRegion->iDComplexity: %d\n Color: %d", ClipRegion->iMode, ClipRegion->iDComplexity, iColor);
|
||||
|
@ -78,7 +78,7 @@ EngPaintRgn(SURFOBJ *Surface, CLIPOBJ *ClipRegion, ULONG iColor, MIX Mix,
|
|||
|
||||
if (ClipRegion->iDComplexity == DC_RECT)
|
||||
{
|
||||
FillSolid(Surface, &(ClipRegion->rclBounds), iColor);
|
||||
FillSolid(pso, &(ClipRegion->rclBounds), iColor);
|
||||
} else {
|
||||
|
||||
/* Enumerate all the rectangles and draw them */
|
||||
|
@ -87,7 +87,7 @@ EngPaintRgn(SURFOBJ *Surface, CLIPOBJ *ClipRegion, ULONG iColor, MIX Mix,
|
|||
do {
|
||||
EnumMore = CLIPOBJ_bEnum(ClipRegion, sizeof(RectEnum), (PVOID) &RectEnum);
|
||||
for (i = 0; i < RectEnum.c; i++) {
|
||||
FillSolid(Surface, RectEnum.arcl + i, iColor);
|
||||
FillSolid(pso, RectEnum.arcl + i, iColor);
|
||||
}
|
||||
} while (EnumMore);
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ EngPaintRgn(SURFOBJ *Surface, CLIPOBJ *ClipRegion, ULONG iColor, MIX Mix,
|
|||
* @unimplemented
|
||||
*/
|
||||
BOOL APIENTRY
|
||||
EngPaint(IN SURFOBJ *Surface,
|
||||
EngPaint(IN SURFOBJ *pso,
|
||||
IN CLIPOBJ *ClipRegion,
|
||||
IN BRUSHOBJ *Brush,
|
||||
IN POINTL *BrushOrigin,
|
||||
|
@ -112,38 +112,38 @@ EngPaint(IN SURFOBJ *Surface,
|
|||
BOOLEAN ret;
|
||||
|
||||
// FIXME: We only support a brush's solid color attribute
|
||||
ret = EngPaintRgn(Surface, ClipRegion, Brush->iSolidColor, Mix, Brush, BrushOrigin);
|
||||
ret = EngPaintRgn(pso, ClipRegion, Brush->iSolidColor, Mix, Brush, BrushOrigin);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
BOOL APIENTRY
|
||||
IntEngPaint(IN SURFOBJ *Surface,
|
||||
IntEngPaint(IN SURFOBJ *pso,
|
||||
IN CLIPOBJ *ClipRegion,
|
||||
IN BRUSHOBJ *Brush,
|
||||
IN POINTL *BrushOrigin,
|
||||
IN MIX Mix)
|
||||
{
|
||||
BITMAPOBJ *BitmapObj = CONTAINING_RECORD(Surface, BITMAPOBJ, SurfObj);
|
||||
SURFACE *psurf = CONTAINING_RECORD(pso, SURFACE, SurfObj);
|
||||
BOOL ret;
|
||||
|
||||
DPRINT("SurfGDI type: %d\n", Surface->iType);
|
||||
DPRINT("pso->iType == %d\n", pso->iType);
|
||||
/* Is the surface's Paint function hooked? */
|
||||
if((Surface->iType!=STYPE_BITMAP) && (BitmapObj->flHooks & HOOK_PAINT))
|
||||
if((pso->iType!=STYPE_BITMAP) && (psurf->flHooks & HOOK_PAINT))
|
||||
{
|
||||
// Call the driver's DrvPaint
|
||||
BITMAPOBJ_LockBitmapBits(BitmapObj);
|
||||
MouseSafetyOnDrawStart(Surface, ClipRegion->rclBounds.left,
|
||||
SURFACE_LockBitmapBits(psurf);
|
||||
MouseSafetyOnDrawStart(pso, ClipRegion->rclBounds.left,
|
||||
ClipRegion->rclBounds.top, ClipRegion->rclBounds.right,
|
||||
ClipRegion->rclBounds.bottom);
|
||||
|
||||
ret = GDIDEVFUNCS(Surface).Paint(
|
||||
Surface, ClipRegion, Brush, BrushOrigin, Mix);
|
||||
MouseSafetyOnDrawEnd(Surface);
|
||||
BITMAPOBJ_UnlockBitmapBits(BitmapObj);
|
||||
ret = GDIDEVFUNCS(pso).Paint(
|
||||
pso, ClipRegion, Brush, BrushOrigin, Mix);
|
||||
MouseSafetyOnDrawEnd(pso);
|
||||
SURFACE_UnlockBitmapBits(psurf);
|
||||
return ret;
|
||||
}
|
||||
return EngPaint( Surface, ClipRegion, Brush, BrushOrigin, Mix );
|
||||
return EngPaint(pso, ClipRegion, Brush, BrushOrigin, Mix );
|
||||
|
||||
}
|
||||
/* EOF */
|
||||
|
|
|
@ -1,21 +1,3 @@
|
|||
/*
|
||||
* ReactOS W32 Subsystem
|
||||
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ReactOS Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -109,28 +91,62 @@ ULONG FASTCALL BitmapFormat(WORD Bits, DWORD Compression)
|
|||
}
|
||||
|
||||
BOOL INTERNAL_CALL
|
||||
BITMAPOBJ_InitBitsLock(BITMAPOBJ *BitmapObj)
|
||||
SURFACE_Cleanup(PVOID ObjectBody)
|
||||
{
|
||||
BitmapObj->BitsLock = ExAllocatePoolWithTag(NonPagedPool,
|
||||
PSURFACE psurf = (PSURFACE)ObjectBody;
|
||||
|
||||
if (psurf->SurfObj.pvBits != NULL &&
|
||||
(psurf->flFlags & BITMAPOBJ_IS_APIBITMAP))
|
||||
{
|
||||
if (psurf->dib == NULL)
|
||||
{
|
||||
ExFreePool(psurf->SurfObj.pvBits);
|
||||
}
|
||||
else
|
||||
{
|
||||
EngFreeUserMem(psurf->SurfObj.pvBits);
|
||||
}
|
||||
if (psurf->hDIBPalette != NULL)
|
||||
{
|
||||
NtGdiDeleteObject(psurf->hDIBPalette);
|
||||
}
|
||||
}
|
||||
|
||||
if (NULL != psurf->BitsLock)
|
||||
{
|
||||
ExFreePoolWithTag(psurf->BitsLock, TAG_SURFACE);
|
||||
psurf->BitsLock = NULL;
|
||||
}
|
||||
|
||||
if (psurf->dib)
|
||||
ExFreePoolWithTag(psurf->dib, TAG_DIB);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL INTERNAL_CALL
|
||||
SURFACE_InitBitsLock(PSURFACE psurf)
|
||||
{
|
||||
psurf->BitsLock = ExAllocatePoolWithTag(NonPagedPool,
|
||||
sizeof(FAST_MUTEX),
|
||||
TAG_BITMAPOBJ);
|
||||
if (NULL == BitmapObj->BitsLock)
|
||||
TAG_SURFACE);
|
||||
if (NULL == psurf->BitsLock)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
ExInitializeFastMutex(BitmapObj->BitsLock);
|
||||
ExInitializeFastMutex(psurf->BitsLock);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void INTERNAL_CALL
|
||||
BITMAPOBJ_CleanupBitsLock(BITMAPOBJ *BitmapObj)
|
||||
SURFACE_CleanupBitsLock(PSURFACE psurf)
|
||||
{
|
||||
if (NULL != BitmapObj->BitsLock)
|
||||
if (NULL != psurf->BitsLock)
|
||||
{
|
||||
ExFreePoolWithTag(BitmapObj->BitsLock, TAG_BITMAPOBJ);
|
||||
BitmapObj->BitsLock = NULL;
|
||||
ExFreePoolWithTag(psurf->BitsLock, TAG_SURFACE);
|
||||
psurf->BitsLock = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -144,7 +160,7 @@ EngCreateDeviceBitmap(IN DHSURF dhsurf,
|
|||
IN ULONG Format)
|
||||
{
|
||||
HBITMAP NewBitmap;
|
||||
SURFOBJ *SurfObj;
|
||||
SURFOBJ *pso;
|
||||
|
||||
NewBitmap = EngCreateBitmap(Size, DIB_GetDIBWidthBytes(Size.cx, BitsPerFormat(Format)), Format, 0, NULL);
|
||||
if (!NewBitmap)
|
||||
|
@ -153,9 +169,9 @@ EngCreateDeviceBitmap(IN DHSURF dhsurf,
|
|||
return 0;
|
||||
}
|
||||
|
||||
SurfObj = EngLockSurface((HSURF)NewBitmap);
|
||||
SurfObj->dhsurf = dhsurf;
|
||||
EngUnlockSurface(SurfObj);
|
||||
pso = EngLockSurface((HSURF)NewBitmap);
|
||||
pso->dhsurf = dhsurf;
|
||||
EngUnlockSurface(pso);
|
||||
|
||||
return NewBitmap;
|
||||
}
|
||||
|
@ -288,80 +304,80 @@ IntCreateBitmap(IN SIZEL Size,
|
|||
IN ULONG Flags,
|
||||
IN PVOID Bits)
|
||||
{
|
||||
HBITMAP NewBitmap;
|
||||
SURFOBJ *SurfObj;
|
||||
BITMAPOBJ *BitmapObj;
|
||||
HBITMAP hbmp;
|
||||
SURFOBJ *pso;
|
||||
PSURFACE psurf;
|
||||
PVOID UncompressedBits;
|
||||
ULONG UncompressedFormat;
|
||||
|
||||
if (Format == 0)
|
||||
return 0;
|
||||
|
||||
BitmapObj = BITMAPOBJ_AllocBitmapWithHandle();
|
||||
if (BitmapObj == NULL)
|
||||
psurf = SURFACE_AllocSurfaceWithHandle();
|
||||
if (psurf == NULL)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
NewBitmap = BitmapObj->BaseObject.hHmgr;
|
||||
hbmp = psurf->BaseObject.hHmgr;
|
||||
|
||||
if (! BITMAPOBJ_InitBitsLock(BitmapObj))
|
||||
if (! SURFACE_InitBitsLock(psurf))
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
BITMAPOBJ_FreeBitmapByHandle(NewBitmap);
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
SURFACE_FreeSurfaceByHandle(hbmp);
|
||||
return 0;
|
||||
}
|
||||
SurfObj = &BitmapObj->SurfObj;
|
||||
pso = &psurf->SurfObj;
|
||||
|
||||
if (Format == BMF_4RLE)
|
||||
{
|
||||
SurfObj->lDelta = DIB_GetDIBWidthBytes(Size.cx, BitsPerFormat(BMF_4BPP));
|
||||
SurfObj->cjBits = SurfObj->lDelta * Size.cy;
|
||||
pso->lDelta = DIB_GetDIBWidthBytes(Size.cx, BitsPerFormat(BMF_4BPP));
|
||||
pso->cjBits = pso->lDelta * Size.cy;
|
||||
UncompressedFormat = BMF_4BPP;
|
||||
UncompressedBits = EngAllocMem(FL_ZERO_MEMORY, SurfObj->cjBits, TAG_DIB);
|
||||
Decompress4bpp(Size, (BYTE *)Bits, (BYTE *)UncompressedBits, SurfObj->lDelta);
|
||||
UncompressedBits = EngAllocMem(FL_ZERO_MEMORY, pso->cjBits, TAG_DIB);
|
||||
Decompress4bpp(Size, (BYTE *)Bits, (BYTE *)UncompressedBits, pso->lDelta);
|
||||
}
|
||||
else if (Format == BMF_8RLE)
|
||||
{
|
||||
SurfObj->lDelta = DIB_GetDIBWidthBytes(Size.cx, BitsPerFormat(BMF_8BPP));
|
||||
SurfObj->cjBits = SurfObj->lDelta * Size.cy;
|
||||
pso->lDelta = DIB_GetDIBWidthBytes(Size.cx, BitsPerFormat(BMF_8BPP));
|
||||
pso->cjBits = pso->lDelta * Size.cy;
|
||||
UncompressedFormat = BMF_8BPP;
|
||||
UncompressedBits = EngAllocMem(FL_ZERO_MEMORY, SurfObj->cjBits, TAG_DIB);
|
||||
Decompress8bpp(Size, (BYTE *)Bits, (BYTE *)UncompressedBits, SurfObj->lDelta);
|
||||
UncompressedBits = EngAllocMem(FL_ZERO_MEMORY, pso->cjBits, TAG_DIB);
|
||||
Decompress8bpp(Size, (BYTE *)Bits, (BYTE *)UncompressedBits, pso->lDelta);
|
||||
}
|
||||
else
|
||||
{
|
||||
SurfObj->lDelta = abs(Width);
|
||||
SurfObj->cjBits = SurfObj->lDelta * Size.cy;
|
||||
pso->lDelta = abs(Width);
|
||||
pso->cjBits = pso->lDelta * Size.cy;
|
||||
UncompressedBits = Bits;
|
||||
UncompressedFormat = Format;
|
||||
}
|
||||
|
||||
if (UncompressedBits != NULL)
|
||||
{
|
||||
SurfObj->pvBits = UncompressedBits;
|
||||
pso->pvBits = UncompressedBits;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (SurfObj->cjBits == 0)
|
||||
if (pso->cjBits == 0)
|
||||
{
|
||||
SurfObj->pvBits = NULL;
|
||||
pso->pvBits = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (0 != (Flags & BMF_USERMEM))
|
||||
{
|
||||
SurfObj->pvBits = EngAllocUserMem(SurfObj->cjBits, 0);
|
||||
pso->pvBits = EngAllocUserMem(pso->cjBits, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
SurfObj->pvBits = EngAllocMem(0 != (Flags & BMF_NOZEROINIT) ?
|
||||
pso->pvBits = EngAllocMem(0 != (Flags & BMF_NOZEROINIT) ?
|
||||
0 : FL_ZERO_MEMORY,
|
||||
SurfObj->cjBits, TAG_DIB);
|
||||
pso->cjBits, TAG_DIB);
|
||||
}
|
||||
if (SurfObj->pvBits == NULL)
|
||||
if (pso->pvBits == NULL)
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
BITMAPOBJ_FreeBitmapByHandle(NewBitmap);
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
SURFACE_FreeSurfaceByHandle(hbmp);
|
||||
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
|
||||
return 0;
|
||||
}
|
||||
|
@ -370,33 +386,33 @@ IntCreateBitmap(IN SIZEL Size,
|
|||
|
||||
if (0 == (Flags & BMF_TOPDOWN))
|
||||
{
|
||||
SurfObj->pvScan0 = (PVOID) ((ULONG_PTR) SurfObj->pvBits + SurfObj->cjBits - SurfObj->lDelta);
|
||||
SurfObj->lDelta = - SurfObj->lDelta;
|
||||
pso->pvScan0 = (PVOID)((ULONG_PTR)pso->pvBits + pso->cjBits - pso->lDelta);
|
||||
pso->lDelta = - pso->lDelta;
|
||||
}
|
||||
else
|
||||
{
|
||||
SurfObj->pvScan0 = SurfObj->pvBits;
|
||||
pso->pvScan0 = pso->pvBits;
|
||||
}
|
||||
|
||||
SurfObj->dhsurf = 0; /* device managed surface */
|
||||
SurfObj->hsurf = (HSURF)NewBitmap;
|
||||
SurfObj->dhpdev = NULL;
|
||||
SurfObj->hdev = NULL;
|
||||
SurfObj->sizlBitmap = Size;
|
||||
SurfObj->iBitmapFormat = UncompressedFormat;
|
||||
SurfObj->iType = STYPE_BITMAP;
|
||||
SurfObj->fjBitmap = Flags & (BMF_TOPDOWN | BMF_NOZEROINIT);
|
||||
SurfObj->iUniq = 0;
|
||||
pso->dhsurf = 0; /* device managed surface */
|
||||
pso->hsurf = (HSURF)hbmp;
|
||||
pso->dhpdev = NULL;
|
||||
pso->hdev = NULL;
|
||||
pso->sizlBitmap = Size;
|
||||
pso->iBitmapFormat = UncompressedFormat;
|
||||
pso->iType = STYPE_BITMAP;
|
||||
pso->fjBitmap = Flags & (BMF_TOPDOWN | BMF_NOZEROINIT);
|
||||
pso->iUniq = 0;
|
||||
|
||||
BitmapObj->flHooks = 0;
|
||||
BitmapObj->flFlags = 0;
|
||||
BitmapObj->dimension.cx = 0;
|
||||
BitmapObj->dimension.cy = 0;
|
||||
BitmapObj->dib = NULL;
|
||||
psurf->flHooks = 0;
|
||||
psurf->flFlags = 0;
|
||||
psurf->dimension.cx = 0;
|
||||
psurf->dimension.cy = 0;
|
||||
psurf->dib = NULL;
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
|
||||
return NewBitmap;
|
||||
return hbmp;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -409,15 +425,15 @@ EngCreateBitmap(IN SIZEL Size,
|
|||
IN ULONG Flags,
|
||||
IN PVOID Bits)
|
||||
{
|
||||
HBITMAP NewBitmap;
|
||||
HBITMAP hNewBitmap;
|
||||
|
||||
NewBitmap = IntCreateBitmap(Size, Width, Format, Flags, Bits);
|
||||
if ( !NewBitmap )
|
||||
hNewBitmap = IntCreateBitmap(Size, Width, Format, Flags, Bits);
|
||||
if ( !hNewBitmap )
|
||||
return 0;
|
||||
|
||||
GDIOBJ_SetOwnership(NewBitmap, NULL);
|
||||
GDIOBJ_SetOwnership(hNewBitmap, NULL);
|
||||
|
||||
return NewBitmap;
|
||||
return hNewBitmap;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -428,40 +444,40 @@ EngCreateDeviceSurface(IN DHSURF dhsurf,
|
|||
IN SIZEL Size,
|
||||
IN ULONG Format)
|
||||
{
|
||||
HSURF NewSurface;
|
||||
SURFOBJ *SurfObj;
|
||||
BITMAPOBJ *BitmapObj;
|
||||
HSURF hsurf;
|
||||
SURFOBJ *pso;
|
||||
PSURFACE psurf;
|
||||
|
||||
BitmapObj = BITMAPOBJ_AllocBitmapWithHandle();
|
||||
if (!BitmapObj)
|
||||
psurf = SURFACE_AllocSurfaceWithHandle();
|
||||
if (!psurf)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
NewSurface = BitmapObj->BaseObject.hHmgr;
|
||||
GDIOBJ_SetOwnership(NewSurface, NULL);
|
||||
hsurf = psurf->BaseObject.hHmgr;
|
||||
GDIOBJ_SetOwnership(hsurf, NULL);
|
||||
|
||||
if (!BITMAPOBJ_InitBitsLock(BitmapObj))
|
||||
if (!SURFACE_InitBitsLock(psurf))
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
BITMAPOBJ_FreeBitmapByHandle(NewSurface);
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
SURFACE_FreeSurfaceByHandle(hsurf);
|
||||
return 0;
|
||||
}
|
||||
SurfObj = &BitmapObj->SurfObj;
|
||||
pso = &psurf->SurfObj;
|
||||
|
||||
SurfObj->dhsurf = dhsurf;
|
||||
SurfObj->hsurf = NewSurface;
|
||||
SurfObj->sizlBitmap = Size;
|
||||
SurfObj->iBitmapFormat = Format;
|
||||
SurfObj->lDelta = DIB_GetDIBWidthBytes(Size.cx, BitsPerFormat(Format));
|
||||
SurfObj->iType = STYPE_DEVICE;
|
||||
SurfObj->iUniq = 0;
|
||||
pso->dhsurf = dhsurf;
|
||||
pso->hsurf = hsurf;
|
||||
pso->sizlBitmap = Size;
|
||||
pso->iBitmapFormat = Format;
|
||||
pso->lDelta = DIB_GetDIBWidthBytes(Size.cx, BitsPerFormat(Format));
|
||||
pso->iType = STYPE_DEVICE;
|
||||
pso->iUniq = 0;
|
||||
|
||||
BitmapObj->flHooks = 0;
|
||||
psurf->flHooks = 0;
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
|
||||
return NewSurface;
|
||||
return hsurf;
|
||||
}
|
||||
|
||||
PFN FASTCALL DriverFunction(DRVENABLEDATA *DED, ULONG DriverFunc)
|
||||
|
@ -482,28 +498,28 @@ PFN FASTCALL DriverFunction(DRVENABLEDATA *DED, ULONG DriverFunc)
|
|||
* @implemented
|
||||
*/
|
||||
BOOL APIENTRY
|
||||
EngAssociateSurface(IN HSURF Surface,
|
||||
EngAssociateSurface(IN HSURF hsurf,
|
||||
IN HDEV Dev,
|
||||
IN ULONG Hooks)
|
||||
{
|
||||
SURFOBJ *SurfObj;
|
||||
BITMAPOBJ *BitmapObj;
|
||||
SURFOBJ *pso;
|
||||
PSURFACE psurf;
|
||||
GDIDEVICE* Device;
|
||||
|
||||
Device = (GDIDEVICE*)Dev;
|
||||
|
||||
BitmapObj = BITMAPOBJ_LockBitmap(Surface);
|
||||
ASSERT(BitmapObj);
|
||||
SurfObj = &BitmapObj->SurfObj;
|
||||
psurf = SURFACE_LockSurface(hsurf);
|
||||
ASSERT(psurf);
|
||||
pso = &psurf->SurfObj;
|
||||
|
||||
/* Associate the hdev */
|
||||
SurfObj->hdev = Dev;
|
||||
SurfObj->dhpdev = Device->hPDev;
|
||||
pso->hdev = Dev;
|
||||
pso->dhpdev = Device->hPDev;
|
||||
|
||||
/* Hook up specified functions */
|
||||
BitmapObj->flHooks = Hooks;
|
||||
psurf->flHooks = Hooks;
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -550,10 +566,10 @@ EngModifySurface(
|
|||
* @implemented
|
||||
*/
|
||||
BOOL APIENTRY
|
||||
EngDeleteSurface(IN HSURF Surface)
|
||||
EngDeleteSurface(IN HSURF hsurf)
|
||||
{
|
||||
GDIOBJ_SetOwnership(Surface, PsGetCurrentProcess());
|
||||
BITMAPOBJ_FreeBitmapByHandle(Surface);
|
||||
GDIOBJ_SetOwnership(hsurf, PsGetCurrentProcess());
|
||||
SURFACE_FreeSurfaceByHandle(hsurf);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -561,13 +577,13 @@ EngDeleteSurface(IN HSURF Surface)
|
|||
* @implemented
|
||||
*/
|
||||
BOOL APIENTRY
|
||||
EngEraseSurface(SURFOBJ *Surface,
|
||||
EngEraseSurface(SURFOBJ *pso,
|
||||
RECTL *Rect,
|
||||
ULONG iColor)
|
||||
{
|
||||
ASSERT(Surface);
|
||||
ASSERT(pso);
|
||||
ASSERT(Rect);
|
||||
return FillSolid(Surface, Rect, iColor);
|
||||
return FillSolid(pso, Rect, iColor);
|
||||
}
|
||||
|
||||
#define GDIBdyToHdr(body) \
|
||||
|
@ -578,9 +594,9 @@ EngEraseSurface(SURFOBJ *Surface,
|
|||
* @implemented
|
||||
*/
|
||||
SURFOBJ * APIENTRY
|
||||
NtGdiEngLockSurface(IN HSURF Surface)
|
||||
NtGdiEngLockSurface(IN HSURF hsurf)
|
||||
{
|
||||
return EngLockSurface(Surface);
|
||||
return EngLockSurface(hsurf);
|
||||
}
|
||||
|
||||
|
||||
|
@ -588,12 +604,12 @@ NtGdiEngLockSurface(IN HSURF Surface)
|
|||
* @implemented
|
||||
*/
|
||||
SURFOBJ * APIENTRY
|
||||
EngLockSurface(IN HSURF Surface)
|
||||
EngLockSurface(IN HSURF hsurf)
|
||||
{
|
||||
BITMAPOBJ *bmp = GDIOBJ_ShareLockObj(Surface, GDI_OBJECT_TYPE_BITMAP);
|
||||
SURFACE *psurf = GDIOBJ_ShareLockObj(hsurf, GDI_OBJECT_TYPE_BITMAP);
|
||||
|
||||
if (bmp != NULL)
|
||||
return &bmp->SurfObj;
|
||||
if (psurf != NULL)
|
||||
return &psurf->SurfObj;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
@ -603,21 +619,21 @@ EngLockSurface(IN HSURF Surface)
|
|||
* @implemented
|
||||
*/
|
||||
VOID APIENTRY
|
||||
NtGdiEngUnlockSurface(IN SURFOBJ *Surface)
|
||||
NtGdiEngUnlockSurface(IN SURFOBJ *pso)
|
||||
{
|
||||
EngUnlockSurface(Surface);
|
||||
EngUnlockSurface(pso);
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
VOID APIENTRY
|
||||
EngUnlockSurface(IN SURFOBJ *Surface)
|
||||
EngUnlockSurface(IN SURFOBJ *pso)
|
||||
{
|
||||
if (Surface != NULL)
|
||||
if (pso != NULL)
|
||||
{
|
||||
BITMAPOBJ *bmp = CONTAINING_RECORD(Surface, BITMAPOBJ, SurfObj);
|
||||
GDIOBJ_ShareUnlockObjByPtr((POBJ)bmp);
|
||||
SURFACE *psurf = CONTAINING_RECORD(pso, SURFACE, SurfObj);
|
||||
GDIOBJ_ShareUnlockObjByPtr((POBJ)psurf);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -33,8 +33,8 @@
|
|||
#include <debug.h>
|
||||
|
||||
BOOL APIENTRY
|
||||
EngTransparentBlt(SURFOBJ *Dest,
|
||||
SURFOBJ *Source,
|
||||
EngTransparentBlt(SURFOBJ *psoDest,
|
||||
SURFOBJ *psoSource,
|
||||
CLIPOBJ *Clip,
|
||||
XLATEOBJ *ColorTranslation,
|
||||
PRECTL DestRect,
|
||||
|
@ -54,7 +54,7 @@ EngTransparentBlt(SURFOBJ *Dest,
|
|||
InputRect.top = 0;
|
||||
InputRect.bottom = DestRect->bottom - DestRect->top;
|
||||
|
||||
if(!IntEngEnter(&EnterLeaveSource, Source, &InputRect, TRUE, &Translate, &InputObj))
|
||||
if(!IntEngEnter(&EnterLeaveSource, psoSource, &InputRect, TRUE, &Translate, &InputObj))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ EngTransparentBlt(SURFOBJ *Dest,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
if(!IntEngEnter(&EnterLeaveDest, Dest, &OutputRect, FALSE, &Translate, &OutputObj))
|
||||
if(!IntEngEnter(&EnterLeaveDest, psoDest, &OutputRect, FALSE, &Translate, &OutputObj))
|
||||
{
|
||||
IntEngLeave(&EnterLeaveSource);
|
||||
return FALSE;
|
||||
|
@ -114,7 +114,7 @@ EngTransparentBlt(SURFOBJ *Dest,
|
|||
{
|
||||
case DC_TRIVIAL:
|
||||
{
|
||||
Ret = DibFunctionsForBitmapFormat[Dest->iBitmapFormat].DIB_TransparentBlt(
|
||||
Ret = DibFunctionsForBitmapFormat[psoDest->iBitmapFormat].DIB_TransparentBlt(
|
||||
OutputObj, InputObj, &OutputRect, &InputPoint, ColorTranslation, iTransColor);
|
||||
break;
|
||||
}
|
||||
|
@ -130,7 +130,7 @@ EngTransparentBlt(SURFOBJ *Dest,
|
|||
EngIntersectRect(&CombinedRect, &OutputRect, &ClipRect);
|
||||
Pt.x = InputPoint.x + CombinedRect.left - OutputRect.left;
|
||||
Pt.y = InputPoint.y + CombinedRect.top - OutputRect.top;
|
||||
Ret = DibFunctionsForBitmapFormat[Dest->iBitmapFormat].DIB_TransparentBlt(
|
||||
Ret = DibFunctionsForBitmapFormat[psoDest->iBitmapFormat].DIB_TransparentBlt(
|
||||
OutputObj, InputObj, &CombinedRect, &Pt, ColorTranslation, iTransColor);
|
||||
break;
|
||||
}
|
||||
|
@ -172,7 +172,7 @@ EngTransparentBlt(SURFOBJ *Dest,
|
|||
EngIntersectRect(&CombinedRect, &OutputRect, &ClipRect);
|
||||
Pt.x = InputPoint.x + CombinedRect.left - OutputRect.left;
|
||||
Pt.y = InputPoint.y + CombinedRect.top - OutputRect.top;
|
||||
Ret = DibFunctionsForBitmapFormat[Dest->iBitmapFormat].DIB_TransparentBlt(
|
||||
Ret = DibFunctionsForBitmapFormat[psoDest->iBitmapFormat].DIB_TransparentBlt(
|
||||
OutputObj, InputObj, &CombinedRect, &Pt, ColorTranslation, iTransColor);
|
||||
if(!Ret)
|
||||
{
|
||||
|
@ -196,8 +196,8 @@ EngTransparentBlt(SURFOBJ *Dest,
|
|||
}
|
||||
|
||||
BOOL FASTCALL
|
||||
IntEngTransparentBlt(SURFOBJ *DestSurf,
|
||||
SURFOBJ *SourceSurf,
|
||||
IntEngTransparentBlt(SURFOBJ *psoDest,
|
||||
SURFOBJ *psoSource,
|
||||
CLIPOBJ *Clip,
|
||||
XLATEOBJ *ColorTranslation,
|
||||
PRECTL DestRect,
|
||||
|
@ -207,18 +207,18 @@ IntEngTransparentBlt(SURFOBJ *DestSurf,
|
|||
{
|
||||
BOOL Ret;
|
||||
RECTL OutputRect, InputClippedRect;
|
||||
BITMAPOBJ *DestObj;
|
||||
BITMAPOBJ *SourceObj;
|
||||
SURFACE *psurfDest;
|
||||
SURFACE *psurfSource;
|
||||
|
||||
ASSERT(DestSurf);
|
||||
ASSERT(SourceSurf);
|
||||
ASSERT(psoDest);
|
||||
ASSERT(psoSource);
|
||||
ASSERT(DestRect);
|
||||
|
||||
DestObj = CONTAINING_RECORD(DestSurf, BITMAPOBJ, SurfObj);
|
||||
SourceObj = CONTAINING_RECORD(SourceSurf, BITMAPOBJ, SurfObj);
|
||||
psurfDest = CONTAINING_RECORD(psoDest, SURFACE, SurfObj);
|
||||
psurfSource = CONTAINING_RECORD(psoSource, SURFACE, SurfObj);
|
||||
|
||||
ASSERT(DestObj);
|
||||
ASSERT(SourceObj);
|
||||
ASSERT(psurfDest);
|
||||
ASSERT(psurfSource);
|
||||
|
||||
InputClippedRect = *DestRect;
|
||||
if(InputClippedRect.right < InputClippedRect.left)
|
||||
|
@ -250,20 +250,20 @@ IntEngTransparentBlt(SURFOBJ *DestSurf,
|
|||
OutputRect = *DestRect;
|
||||
}
|
||||
|
||||
if(SourceSurf != DestSurf)
|
||||
if(psoSource != psoDest)
|
||||
{
|
||||
BITMAPOBJ_LockBitmapBits(SourceObj);
|
||||
MouseSafetyOnDrawStart(SourceSurf, SourceRect->left, SourceRect->top,
|
||||
SURFACE_LockBitmapBits(psurfSource);
|
||||
MouseSafetyOnDrawStart(psoSource, SourceRect->left, SourceRect->top,
|
||||
SourceRect->right, SourceRect->bottom);
|
||||
}
|
||||
BITMAPOBJ_LockBitmapBits(DestObj);
|
||||
MouseSafetyOnDrawStart(DestSurf, OutputRect.left, OutputRect.top,
|
||||
SURFACE_LockBitmapBits(psurfDest);
|
||||
MouseSafetyOnDrawStart(psoDest, OutputRect.left, OutputRect.top,
|
||||
OutputRect.right, OutputRect.bottom);
|
||||
|
||||
if(DestObj->flHooks & HOOK_TRANSPARENTBLT)
|
||||
if(psurfDest->flHooks & HOOK_TRANSPARENTBLT)
|
||||
{
|
||||
Ret = GDIDEVFUNCS(DestSurf).TransparentBlt(
|
||||
DestSurf, SourceSurf, Clip, ColorTranslation, &OutputRect,
|
||||
Ret = GDIDEVFUNCS(psoDest).TransparentBlt(
|
||||
psoDest, psoSource, Clip, ColorTranslation, &OutputRect,
|
||||
SourceRect, iTransColor, Reserved);
|
||||
}
|
||||
else
|
||||
|
@ -271,16 +271,16 @@ IntEngTransparentBlt(SURFOBJ *DestSurf,
|
|||
|
||||
if(!Ret)
|
||||
{
|
||||
Ret = EngTransparentBlt(DestSurf, SourceSurf, Clip, ColorTranslation,
|
||||
Ret = EngTransparentBlt(psoDest, psoSource, Clip, ColorTranslation,
|
||||
&OutputRect, SourceRect, iTransColor, Reserved);
|
||||
}
|
||||
|
||||
MouseSafetyOnDrawEnd(DestSurf);
|
||||
BITMAPOBJ_UnlockBitmapBits(DestObj);
|
||||
if(SourceSurf != DestSurf)
|
||||
MouseSafetyOnDrawEnd(psoDest);
|
||||
SURFACE_UnlockBitmapBits(psurfDest);
|
||||
if(psoSource != psoDest)
|
||||
{
|
||||
MouseSafetyOnDrawEnd(SourceSurf);
|
||||
BITMAPOBJ_UnlockBitmapBits(SourceObj);
|
||||
MouseSafetyOnDrawEnd(psoSource);
|
||||
SURFACE_UnlockBitmapBits(psurfSource);
|
||||
}
|
||||
|
||||
return Ret;
|
||||
|
|
|
@ -446,7 +446,7 @@ IntEngGetXlatePalette(XLATEOBJ *XlateObj,
|
|||
|
||||
XLATEOBJ*
|
||||
FASTCALL
|
||||
IntCreateXlateForBlt(PDC pDCDest, PDC pDCSrc, BITMAPOBJ* pDestSurf, BITMAPOBJ* pSrcSurf)
|
||||
IntCreateXlateForBlt(PDC pDCDest, PDC pDCSrc, SURFACE* psurfDest, SURFACE* psurfSrc)
|
||||
{
|
||||
XLATEOBJ *XlateObj;
|
||||
HPALETTE DestPalette, SourcePalette;
|
||||
|
@ -454,23 +454,23 @@ IntCreateXlateForBlt(PDC pDCDest, PDC pDCSrc, BITMAPOBJ* pDestSurf, BITMAPOBJ* p
|
|||
|
||||
DPRINT("Enter IntCreateXlateFromDCs\n");
|
||||
|
||||
if (pDestSurf == pSrcSurf)
|
||||
if (psurfDest == psurfSrc)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
DestPalette = pDestSurf->hDIBPalette;
|
||||
DestPalette = psurfDest->hDIBPalette;
|
||||
if (!DestPalette) DestPalette = pPrimarySurface->DevInfo.hpalDefault;
|
||||
|
||||
SourcePalette = pSrcSurf->hDIBPalette;
|
||||
SourcePalette = psurfSrc->hDIBPalette;
|
||||
if (!SourcePalette) SourcePalette = pPrimarySurface->DevInfo.hpalDefault;
|
||||
|
||||
DPRINT("DestPalette = %p, SourcePalette = %p, DefaultPatelle = %p\n", DestPalette, SourcePalette, NtGdiGetStockObject((INT)DEFAULT_PALETTE));
|
||||
|
||||
/* KB41464 details how to convert between mono and color */
|
||||
if (pDestSurf->SurfObj.iBitmapFormat == BMF_1BPP)
|
||||
if (psurfDest->SurfObj.iBitmapFormat == BMF_1BPP)
|
||||
{
|
||||
if (pSrcSurf->SurfObj.iBitmapFormat == BMF_1BPP)
|
||||
if (psurfSrc->SurfObj.iBitmapFormat == BMF_1BPP)
|
||||
{
|
||||
XlateObj = NULL;
|
||||
}
|
||||
|
@ -483,12 +483,12 @@ IntCreateXlateForBlt(PDC pDCDest, PDC pDCSrc, BITMAPOBJ* pDestSurf, BITMAPOBJ* p
|
|||
}
|
||||
else
|
||||
{
|
||||
if (pSrcSurf->SurfObj.iBitmapFormat == BMF_1BPP)
|
||||
if (psurfSrc->SurfObj.iBitmapFormat == BMF_1BPP)
|
||||
{
|
||||
/* DIB sections need special handling */
|
||||
if (pSrcSurf->dib)
|
||||
if (psurfSrc->dib)
|
||||
{
|
||||
PPALGDI ppal = PALETTE_LockPalette(pSrcSurf->hDIBPalette);
|
||||
PPALGDI ppal = PALETTE_LockPalette(psurfSrc->hDIBPalette);
|
||||
if (ppal)
|
||||
{
|
||||
XlateObj = IntEngCreateSrcMonoXlate(DestPalette, ((ULONG*)ppal->IndexedColors)[0], ((ULONG*)ppal->IndexedColors)[1]);
|
||||
|
|
|
@ -1,66 +1,12 @@
|
|||
|
||||
#ifndef __WIN32K_BITMAPS_H
|
||||
#define __WIN32K_BITMAPS_H
|
||||
|
||||
#include "win32.h"
|
||||
#include "gdiobj.h"
|
||||
#include "surface.h"
|
||||
|
||||
/* GDI logical bitmap object */
|
||||
typedef struct _BITMAPOBJ
|
||||
{
|
||||
BASEOBJECT BaseObject;
|
||||
|
||||
SURFOBJ SurfObj;
|
||||
FLONG flHooks;
|
||||
FLONG flFlags;
|
||||
SIZE dimension; /* For SetBitmapDimension(), do NOT use
|
||||
to get width/height of bitmap, use
|
||||
bitmap.bmWidth/bitmap.bmHeight for
|
||||
that */
|
||||
PFAST_MUTEX BitsLock; /* You need to hold this lock before you touch
|
||||
the actual bits in the bitmap */
|
||||
|
||||
/* For device-independent bitmaps: */
|
||||
DIBSECTION *dib;
|
||||
HPALETTE hDIBPalette;
|
||||
HDC hDC; // Doc in "Undocumented Windows", page 546, seems to be supported with XP.
|
||||
} BITMAPOBJ, *PBITMAPOBJ;
|
||||
|
||||
#define BITMAPOBJ_IS_APIBITMAP 0x1
|
||||
|
||||
/* Internal interface */
|
||||
|
||||
#define BITMAPOBJ_AllocBitmap() ((PBITMAPOBJ) GDIOBJ_AllocObj(GDIObjType_SURF_TYPE))
|
||||
#define BITMAPOBJ_AllocBitmapWithHandle() ((PBITMAPOBJ) GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_BITMAP))
|
||||
#define BITMAPOBJ_FreeBitmap(pBMObj) GDIOBJ_FreeObj((POBJ) pBMObj, GDIObjType_SURF_TYPE)
|
||||
#define BITMAPOBJ_FreeBitmapByHandle(hBMObj) GDIOBJ_FreeObjByHandle((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_BITMAP)
|
||||
|
||||
/* NOTE: Use shared locks! */
|
||||
#define BITMAPOBJ_LockBitmap(hBMObj) \
|
||||
((PBITMAPOBJ) GDIOBJ_LockObj ((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_BITMAP))
|
||||
#define BITMAPOBJ_ShareLockBitmap(hBMObj) \
|
||||
((PBITMAPOBJ) GDIOBJ_ShareLockObj ((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_BITMAP))
|
||||
#define BITMAPOBJ_UnlockBitmap(pBMObj) \
|
||||
GDIOBJ_UnlockObjByPtr ((POBJ)pBMObj)
|
||||
#define BITMAPOBJ_ShareUnlockBitmap(pBMObj) \
|
||||
GDIOBJ_ShareUnlockObjByPtr ((POBJ)pBMObj)
|
||||
|
||||
BOOL INTERNAL_CALL BITMAP_Cleanup(PVOID ObjectBody);
|
||||
|
||||
BOOL INTERNAL_CALL BITMAPOBJ_InitBitsLock(BITMAPOBJ *pBMObj);
|
||||
#define BITMAPOBJ_LockBitmapBits(pBMObj) ExEnterCriticalRegionAndAcquireFastMutexUnsafe((pBMObj)->BitsLock)
|
||||
#define BITMAPOBJ_UnlockBitmapBits(pBMObj) ExReleaseFastMutexUnsafeAndLeaveCriticalRegion((pBMObj)->BitsLock)
|
||||
void INTERNAL_CALL BITMAPOBJ_CleanupBitsLock(BITMAPOBJ *pBMObj);
|
||||
|
||||
INT FASTCALL BITMAPOBJ_GetWidthBytes (INT bmWidth, INT bpp);
|
||||
UINT FASTCALL BITMAPOBJ_GetRealBitsPixel(UINT nBitsPixel);
|
||||
HBITMAP FASTCALL BITMAPOBJ_CopyBitmap (HBITMAP hBitmap);
|
||||
INT FASTCALL DIB_GetDIBWidthBytes (INT width, INT depth);
|
||||
int APIENTRY DIB_GetDIBImageBytes (INT width, INT height, INT depth);
|
||||
INT FASTCALL DIB_BitmapInfoSize (const BITMAPINFO * info, WORD coloruse);
|
||||
INT APIENTRY BITMAP_GetObject(BITMAPOBJ * bmp, INT count, LPVOID buffer);
|
||||
HBITMAP FASTCALL BitmapToSurf(PBITMAPOBJ BitmapObj, HDEV GDIDevice);
|
||||
INT APIENTRY BITMAP_GetObject(SURFACE * bmp, INT count, LPVOID buffer);
|
||||
HBITMAP FASTCALL IntCreateBitmap(IN SIZEL Size, IN LONG Width, IN ULONG Format, IN ULONG Flags, IN PVOID Bits);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ typedef struct _DCLEVEL
|
|||
FLOATOBJ efM22_TWIPS;
|
||||
FLOATOBJ efPr11;
|
||||
FLOATOBJ efPr22;
|
||||
PBITMAPOBJ pSurface; // SURFACE*
|
||||
PSURFACE pSurface;
|
||||
SIZE sizl;
|
||||
} DCLEVEL, *PDCLEVEL;
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ IntGdiCreateBrushXlate(PDC Dc, GDIBRUSHOBJ *BrushObj, BOOLEAN *Failed);
|
|||
|
||||
XLATEOBJ*
|
||||
FASTCALL
|
||||
IntCreateXlateForBlt(PDC pDCDest, PDC pDCSrc, BITMAPOBJ* pDestSurf, BITMAPOBJ* pSrcSurf);
|
||||
IntCreateXlateForBlt(PDC pDCDest, PDC pDCSrc, SURFACE* pDestSurf, SURFACE* pSrcSurf);
|
||||
|
||||
VOID FASTCALL
|
||||
IntGdiInitBrushInstance(GDIBRUSHINST *BrushInst, PGDIBRUSHOBJ BrushObj, XLATEOBJ *XlateObj);
|
||||
|
@ -244,9 +244,9 @@ WORD APIENTRY IntGdiSetHookFlags(HDC hDC, WORD Flags);
|
|||
|
||||
VOID APIENTRY IntGdiSetDCState ( HDC hDC, HDC hDCSave );
|
||||
|
||||
LONG APIENTRY IntSetBitmapBits(PBITMAPOBJ bmp, DWORD Bytes, IN PBYTE Bits);
|
||||
LONG APIENTRY IntSetBitmapBits(PSURFACE bmp, DWORD Bytes, IN PBYTE Bits);
|
||||
|
||||
LONG APIENTRY IntGetBitmapBits(PBITMAPOBJ bmp, DWORD Bytes, OUT PBYTE Bits);
|
||||
LONG APIENTRY IntGetBitmapBits(PSURFACE bmp, DWORD Bytes, OUT PBYTE Bits);
|
||||
|
||||
UINT APIENTRY IntSetDIBColorTable(HDC hDC, UINT StartIndex, UINT Entries, CONST RGBQUAD *Colors);
|
||||
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
#define _WIN32K_PAINT_H
|
||||
|
||||
BOOL APIENTRY FillSolid (SURFOBJ* Surface, RECTL* Dimensions, ULONG iColor);
|
||||
BOOL APIENTRY FillPolygon ( DC* dc, BITMAPOBJ* SurfObj, BRUSHOBJ* BrushObj, MIX RopMode, CONST PPOINT Points, INT Count, RECTL BoundRect );
|
||||
BOOL APIENTRY FillPolygon ( DC* dc, SURFACE* pSurface, BRUSHOBJ* BrushObj, MIX RopMode, CONST PPOINT Points, INT Count, RECTL BoundRect );
|
||||
|
||||
#endif /* _WIN32K_PAINT_H */
|
||||
|
|
|
@ -1,11 +1,63 @@
|
|||
#ifndef _WIN32K_SURFACE_H
|
||||
#define _WIN32K_SURFACE_H
|
||||
|
||||
#include "win32.h"
|
||||
#include "gdiobj.h"
|
||||
|
||||
/* GDI surface object */
|
||||
typedef struct _SURFACE
|
||||
{
|
||||
BASEOBJECT BaseObject;
|
||||
|
||||
SURFOBJ SurfObj;
|
||||
FLONG flHooks;
|
||||
FLONG flFlags;
|
||||
SIZE dimension; /* For SetBitmapDimension(), do NOT use
|
||||
to get width/height of bitmap, use
|
||||
bitmap.bmWidth/bitmap.bmHeight for
|
||||
that */
|
||||
PFAST_MUTEX BitsLock; /* You need to hold this lock before you touch
|
||||
the actual bits in the bitmap */
|
||||
|
||||
/* For device-independent bitmaps: */
|
||||
DIBSECTION *dib;
|
||||
HPALETTE hDIBPalette;
|
||||
HDC hDC; // Doc in "Undocumented Windows", page 546, seems to be supported with XP.
|
||||
} SURFACE, *PSURFACE;
|
||||
|
||||
#define BITMAPOBJ_IS_APIBITMAP 0x1
|
||||
|
||||
/* Internal interface */
|
||||
|
||||
#define SURFACE_AllocSurface() ((PSURFACE) GDIOBJ_AllocObj(GDIObjType_SURF_TYPE))
|
||||
#define SURFACE_AllocSurfaceWithHandle() ((PSURFACE) GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_BITMAP))
|
||||
#define SURFACE_FreeSurface(pBMObj) GDIOBJ_FreeObj((POBJ) pBMObj, GDIObjType_SURF_TYPE)
|
||||
#define SURFACE_FreeSurfaceByHandle(hBMObj) GDIOBJ_FreeObjByHandle((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_BITMAP)
|
||||
|
||||
/* NOTE: Use shared locks! */
|
||||
#define SURFACE_LockSurface(hBMObj) \
|
||||
((PSURFACE) GDIOBJ_LockObj ((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_BITMAP))
|
||||
#define SURFACE_ShareLockSurface(hBMObj) \
|
||||
((PSURFACE) GDIOBJ_ShareLockObj ((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_BITMAP))
|
||||
#define SURFACE_UnlockSurface(pBMObj) \
|
||||
GDIOBJ_UnlockObjByPtr ((POBJ)pBMObj)
|
||||
#define SURFACE_ShareUnlockSurface(pBMObj) \
|
||||
GDIOBJ_ShareUnlockObjByPtr ((POBJ)pBMObj)
|
||||
|
||||
#define SURFACE_LockBitmapBits(pBMObj) ExEnterCriticalRegionAndAcquireFastMutexUnsafe((pBMObj)->BitsLock)
|
||||
#define SURFACE_UnlockBitmapBits(pBMObj) ExReleaseFastMutexUnsafeAndLeaveCriticalRegion((pBMObj)->BitsLock)
|
||||
|
||||
BOOL INTERNAL_CALL SURFACE_Cleanup(PVOID ObjectBody);
|
||||
BOOL INTERNAL_CALL SURFACE_InitBitsLock(SURFACE *pBMObj);
|
||||
void INTERNAL_CALL SURFACE_CleanupBitsLock(SURFACE *pBMObj);
|
||||
INT FASTCALL SURFACE_GetWidthBytes (INT bmWidth, INT bpp);
|
||||
UINT FASTCALL SURFACE_GetRealBitsPixel(UINT nBitsPixel);
|
||||
HBITMAP FASTCALL SURFACE_CopyBitmap (HBITMAP hBitmap);
|
||||
|
||||
#define GDIDEV(SurfObj) ((GDIDEVICE *)((SurfObj)->hdev))
|
||||
#define GDIDEVFUNCS(SurfObj) ((GDIDEVICE *)((SurfObj)->hdev))->DriverFunctions
|
||||
|
||||
INT FASTCALL BitsPerFormat (ULONG Format);
|
||||
ULONG FASTCALL BitmapFormat (WORD Bits, DWORD Compression);
|
||||
HBITMAP FASTCALL IntCreateBitmap(IN SIZEL Size, IN LONG Width, IN ULONG Format, IN ULONG Flags, IN PVOID Bits);
|
||||
|
||||
#endif /* _WIN32K_SURFACE_H */
|
||||
|
|
|
@ -82,7 +82,6 @@
|
|||
#define TAG_FONTOBJ TAG('G', 'f', 'n', 't') /* font object */
|
||||
#define TAG_WNDOBJ TAG('W', 'N', 'D', 'O') /* window object */
|
||||
#define TAG_XLATEOBJ TAG('X', 'L', 'A', 'O') /* xlate object */
|
||||
#define TAG_BITMAPOBJ TAG('B', 'M', 'P', 'O') /* bitmap object */
|
||||
#define TAG_GSEM TAG('G', 's', 'e', 'm') /* Gdi Semaphore */
|
||||
|
||||
/* misc */
|
||||
|
|
|
@ -949,16 +949,16 @@ NtUserSetClipboardData(UINT uFormat, HANDLE hMem, DWORD size)
|
|||
INT ret;
|
||||
BITMAP bm;
|
||||
BITMAPINFO bi;
|
||||
BITMAPOBJ *BitmapObj;
|
||||
SURFACE *psurf;
|
||||
|
||||
hdc = UserGetDCEx(NULL, NULL, DCX_USESTYLE);
|
||||
|
||||
|
||||
BitmapObj = BITMAPOBJ_LockBitmap(hMem);
|
||||
BITMAP_GetObject(BitmapObj, sizeof(BITMAP), (PVOID)&bm);
|
||||
if(BitmapObj)
|
||||
psurf = SURFACE_LockSurface(hMem);
|
||||
BITMAP_GetObject(psurf, sizeof(BITMAP), (PVOID)&bm);
|
||||
if(psurf)
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
}
|
||||
|
||||
bi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
|
||||
|
|
|
@ -82,10 +82,10 @@ HCURSOR FASTCALL
|
|||
IntSetCursor(PWINSTATION_OBJECT WinSta, PCURICON_OBJECT NewCursor,
|
||||
BOOL ForceChange)
|
||||
{
|
||||
BITMAPOBJ *BitmapObj;
|
||||
SURFOBJ *SurfObj;
|
||||
SURFACE *psurf;
|
||||
SURFOBJ *pso;
|
||||
PDEVINFO DevInfo;
|
||||
PBITMAPOBJ MaskBmpObj = NULL;
|
||||
PSURFACE MaskBmpObj = NULL;
|
||||
PSYSTEM_CURSORINFO CurInfo;
|
||||
PCURICON_OBJECT OldCursor;
|
||||
HCURSOR Ret = (HCURSOR)0;
|
||||
|
@ -123,10 +123,10 @@ IntSetCursor(PWINSTATION_OBJECT WinSta, PCURICON_OBJECT NewCursor,
|
|||
DevInfo = (PDEVINFO)&((GDIDEVICE *)dc->pPDev)->DevInfo;
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
BitmapObj = BITMAPOBJ_LockBitmap(dcbmp);
|
||||
if (!BitmapObj)
|
||||
psurf = SURFACE_LockSurface(dcbmp);
|
||||
if (!psurf)
|
||||
return (HCURSOR)0;
|
||||
SurfObj = &BitmapObj->SurfObj;
|
||||
pso = &psurf->SurfObj;
|
||||
|
||||
if (!NewCursor)
|
||||
{
|
||||
|
@ -139,37 +139,37 @@ IntSetCursor(PWINSTATION_OBJECT WinSta, PCURICON_OBJECT NewCursor,
|
|||
{
|
||||
DPRINT1("Removing pointer!\n");
|
||||
/* Remove the cursor if it was displayed */
|
||||
IntEngMovePointer(SurfObj, -1, -1, &GDIDEV(SurfObj)->Pointer.Exclude);
|
||||
IntEngMovePointer(pso, -1, -1, &GDIDEV(pso)->Pointer.Exclude);
|
||||
}
|
||||
}
|
||||
|
||||
GDIDEV(SurfObj)->Pointer.Status = SPS_ACCEPT_NOEXCLUDE;
|
||||
GDIDEV(pso)->Pointer.Status = SPS_ACCEPT_NOEXCLUDE;
|
||||
|
||||
CurInfo->CurrentCursorObject = NewCursor; /* i.e. CurrentCursorObject = NULL */
|
||||
CurInfo->ShowingCursor = 0;
|
||||
}
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
return Ret;
|
||||
}
|
||||
|
||||
/* TODO: Fixme. Logic is screwed above */
|
||||
|
||||
MaskBmpObj = BITMAPOBJ_LockBitmap(NewCursor->IconInfo.hbmMask);
|
||||
MaskBmpObj = SURFACE_LockSurface(NewCursor->IconInfo.hbmMask);
|
||||
if (MaskBmpObj)
|
||||
{
|
||||
const int maskBpp = BitsPerFormat(MaskBmpObj->SurfObj.iBitmapFormat);
|
||||
BITMAPOBJ_UnlockBitmap(MaskBmpObj);
|
||||
SURFACE_UnlockSurface(MaskBmpObj);
|
||||
if (maskBpp != 1)
|
||||
{
|
||||
DPRINT1("SetCursor: The Mask bitmap must have 1BPP!\n");
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
return Ret;
|
||||
}
|
||||
|
||||
if ((DevInfo->flGraphicsCaps2 & GCAPS2_ALPHACURSOR) &&
|
||||
SurfObj->iBitmapFormat >= BMF_16BPP &&
|
||||
SurfObj->iBitmapFormat <= BMF_32BPP &&
|
||||
pso->iBitmapFormat >= BMF_16BPP &&
|
||||
pso->iBitmapFormat <= BMF_32BPP &&
|
||||
NewCursor->Shadow && COLORCURSORS_ALLOWED)
|
||||
{
|
||||
/* FIXME - Create a color pointer, only 32bit bitmap, set alpha bits!
|
||||
|
@ -190,7 +190,7 @@ IntSetCursor(PWINSTATION_OBJECT WinSta, PCURICON_OBJECT NewCursor,
|
|||
}
|
||||
else
|
||||
{
|
||||
MaskBmpObj = BITMAPOBJ_LockBitmap(NewCursor->IconInfo.hbmMask);
|
||||
MaskBmpObj = SURFACE_LockSurface(NewCursor->IconInfo.hbmMask);
|
||||
if(MaskBmpObj)
|
||||
{
|
||||
RECTL DestRect = {0, 0, MaskBmpObj->SurfObj.sizlBitmap.cx, MaskBmpObj->SurfObj.sizlBitmap.cy};
|
||||
|
@ -207,14 +207,14 @@ IntSetCursor(PWINSTATION_OBJECT WinSta, PCURICON_OBJECT NewCursor,
|
|||
NULL);
|
||||
if ( !hMask )
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmap(MaskBmpObj);
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
SURFACE_UnlockSurface(MaskBmpObj);
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
return (HCURSOR)0;
|
||||
}
|
||||
soMask = EngLockSurface((HSURF)hMask);
|
||||
EngCopyBits(soMask, &MaskBmpObj->SurfObj, NULL, NULL,
|
||||
&DestRect, &SourcePoint);
|
||||
BITMAPOBJ_UnlockBitmap(MaskBmpObj);
|
||||
SURFACE_UnlockSurface(MaskBmpObj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -234,43 +234,43 @@ IntSetCursor(PWINSTATION_OBJECT WinSta, PCURICON_OBJECT NewCursor,
|
|||
UserDereferenceObject(OldCursor);
|
||||
}
|
||||
|
||||
if (GDIDEVFUNCS(SurfObj).SetPointerShape)
|
||||
if (GDIDEVFUNCS(pso).SetPointerShape)
|
||||
{
|
||||
GDIDEV(SurfObj)->Pointer.Status =
|
||||
GDIDEVFUNCS(SurfObj).SetPointerShape(
|
||||
SurfObj, soMask, soColor, XlateObj,
|
||||
GDIDEV(pso)->Pointer.Status =
|
||||
GDIDEVFUNCS(pso).SetPointerShape(
|
||||
pso, soMask, soColor, XlateObj,
|
||||
NewCursor->IconInfo.xHotspot,
|
||||
NewCursor->IconInfo.yHotspot,
|
||||
gpsi->ptCursor.x,
|
||||
gpsi->ptCursor.y,
|
||||
&(GDIDEV(SurfObj)->Pointer.Exclude),
|
||||
&(GDIDEV(pso)->Pointer.Exclude),
|
||||
SPS_CHANGE);
|
||||
DPRINT("SetCursor: DrvSetPointerShape() returned %x\n",
|
||||
GDIDEV(SurfObj)->Pointer.Status);
|
||||
GDIDEV(pso)->Pointer.Status);
|
||||
}
|
||||
else
|
||||
{
|
||||
GDIDEV(SurfObj)->Pointer.Status = SPS_DECLINE;
|
||||
GDIDEV(pso)->Pointer.Status = SPS_DECLINE;
|
||||
}
|
||||
|
||||
if(GDIDEV(SurfObj)->Pointer.Status == SPS_DECLINE)
|
||||
if(GDIDEV(pso)->Pointer.Status == SPS_DECLINE)
|
||||
{
|
||||
GDIDEV(SurfObj)->Pointer.Status = EngSetPointerShape(
|
||||
SurfObj, soMask, soColor, XlateObj,
|
||||
GDIDEV(pso)->Pointer.Status = EngSetPointerShape(
|
||||
pso, soMask, soColor, XlateObj,
|
||||
NewCursor->IconInfo.xHotspot,
|
||||
NewCursor->IconInfo.yHotspot,
|
||||
gpsi->ptCursor.x,
|
||||
gpsi->ptCursor.y,
|
||||
&(GDIDEV(SurfObj)->Pointer.Exclude),
|
||||
&(GDIDEV(pso)->Pointer.Exclude),
|
||||
SPS_CHANGE);
|
||||
GDIDEV(SurfObj)->Pointer.MovePointer = NULL;
|
||||
GDIDEV(pso)->Pointer.MovePointer = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
GDIDEV(SurfObj)->Pointer.MovePointer = GDIDEVFUNCS(SurfObj).MovePointer;
|
||||
GDIDEV(pso)->Pointer.MovePointer = GDIDEVFUNCS(pso).MovePointer;
|
||||
}
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
if(hMask)
|
||||
{
|
||||
EngUnlockSurface(soMask);
|
||||
|
@ -281,7 +281,7 @@ IntSetCursor(PWINSTATION_OBJECT WinSta, PCURICON_OBJECT NewCursor,
|
|||
EngDeleteXlate(XlateObj);
|
||||
}
|
||||
|
||||
if(GDIDEV(SurfObj)->Pointer.Status == SPS_ERROR)
|
||||
if(GDIDEV(pso)->Pointer.Status == SPS_ERROR)
|
||||
DPRINT1("SetCursor: DrvSetPointerShape() returned SPS_ERROR\n");
|
||||
|
||||
return Ret;
|
||||
|
@ -537,7 +537,7 @@ NtUserCreateCursorIconHandle(PICONINFO IconInfo OPTIONAL, BOOL Indirect)
|
|||
{
|
||||
PCURICON_OBJECT CurIcon;
|
||||
PWINSTATION_OBJECT WinSta;
|
||||
PBITMAPOBJ bmp;
|
||||
PSURFACE psurfBmp;
|
||||
NTSTATUS Status;
|
||||
HANDLE Ret;
|
||||
DECLARE_RETURN(HANDLE);
|
||||
|
@ -567,26 +567,26 @@ NtUserCreateCursorIconHandle(PICONINFO IconInfo OPTIONAL, BOOL Indirect)
|
|||
{
|
||||
if(Indirect)
|
||||
{
|
||||
CurIcon->IconInfo.hbmMask = BITMAPOBJ_CopyBitmap(CurIcon->IconInfo.hbmMask);
|
||||
CurIcon->IconInfo.hbmColor = BITMAPOBJ_CopyBitmap(CurIcon->IconInfo.hbmColor);
|
||||
CurIcon->IconInfo.hbmMask = SURFACE_CopyBitmap(CurIcon->IconInfo.hbmMask);
|
||||
CurIcon->IconInfo.hbmColor = SURFACE_CopyBitmap(CurIcon->IconInfo.hbmColor);
|
||||
}
|
||||
if(CurIcon->IconInfo.hbmColor &&
|
||||
(bmp = BITMAPOBJ_LockBitmap(CurIcon->IconInfo.hbmColor)))
|
||||
(psurfBmp = SURFACE_LockSurface(CurIcon->IconInfo.hbmColor)))
|
||||
{
|
||||
CurIcon->Size.cx = bmp->SurfObj.sizlBitmap.cx;
|
||||
CurIcon->Size.cy = bmp->SurfObj.sizlBitmap.cy;
|
||||
BITMAPOBJ_UnlockBitmap(bmp);
|
||||
CurIcon->Size.cx = psurfBmp->SurfObj.sizlBitmap.cx;
|
||||
CurIcon->Size.cy = psurfBmp->SurfObj.sizlBitmap.cy;
|
||||
SURFACE_UnlockSurface(psurfBmp);
|
||||
GDIOBJ_SetOwnership(CurIcon->IconInfo.hbmColor, NULL);
|
||||
}
|
||||
if(CurIcon->IconInfo.hbmMask &&
|
||||
(bmp = BITMAPOBJ_LockBitmap(CurIcon->IconInfo.hbmMask)))
|
||||
(psurfBmp = SURFACE_LockSurface(CurIcon->IconInfo.hbmMask)))
|
||||
{
|
||||
if (CurIcon->IconInfo.hbmColor == NULL)
|
||||
{
|
||||
CurIcon->Size.cx = bmp->SurfObj.sizlBitmap.cx;
|
||||
CurIcon->Size.cy = bmp->SurfObj.sizlBitmap.cy / 2;
|
||||
CurIcon->Size.cx = psurfBmp->SurfObj.sizlBitmap.cx;
|
||||
CurIcon->Size.cy = psurfBmp->SurfObj.sizlBitmap.cy / 2;
|
||||
}
|
||||
BITMAPOBJ_UnlockBitmap(bmp);
|
||||
SURFACE_UnlockSurface(psurfBmp);
|
||||
GDIOBJ_SetOwnership(CurIcon->IconInfo.hbmMask, NULL);
|
||||
}
|
||||
}
|
||||
|
@ -651,8 +651,8 @@ NtUserGetIconInfo(
|
|||
RtlCopyMemory(&ii, &CurIcon->IconInfo, sizeof(ICONINFO));
|
||||
|
||||
/* Copy bitmaps */
|
||||
ii.hbmMask = BITMAPOBJ_CopyBitmap(CurIcon->IconInfo.hbmMask);
|
||||
ii.hbmColor = BITMAPOBJ_CopyBitmap(CurIcon->IconInfo.hbmColor);
|
||||
ii.hbmMask = SURFACE_CopyBitmap(CurIcon->IconInfo.hbmMask);
|
||||
ii.hbmColor = SURFACE_CopyBitmap(CurIcon->IconInfo.hbmColor);
|
||||
|
||||
/* Copy fields */
|
||||
_SEH2_TRY
|
||||
|
@ -662,16 +662,16 @@ NtUserGetIconInfo(
|
|||
|
||||
if (pbpp)
|
||||
{
|
||||
PBITMAPOBJ bmp;
|
||||
PSURFACE psurfBmp;
|
||||
int colorBpp = 0;
|
||||
|
||||
ProbeForWrite(pbpp, sizeof(DWORD), 1);
|
||||
|
||||
bmp = BITMAPOBJ_LockBitmap(CurIcon->IconInfo.hbmColor);
|
||||
if (bmp)
|
||||
psurfBmp = SURFACE_LockSurface(CurIcon->IconInfo.hbmColor);
|
||||
if (psurfBmp)
|
||||
{
|
||||
colorBpp = BitsPerFormat(bmp->SurfObj.iBitmapFormat);
|
||||
BITMAPOBJ_UnlockBitmap(bmp);
|
||||
colorBpp = BitsPerFormat(psurfBmp->SurfObj.iBitmapFormat);
|
||||
SURFACE_UnlockSurface(psurfBmp);
|
||||
}
|
||||
|
||||
RtlCopyMemory(pbpp, &colorBpp, sizeof(DWORD));
|
||||
|
@ -1120,7 +1120,7 @@ NtUserSetCursorContents(
|
|||
{
|
||||
PCURICON_OBJECT CurIcon;
|
||||
ICONINFO IconInfo;
|
||||
PBITMAPOBJ bmp;
|
||||
PSURFACE psurfBmp;
|
||||
PWINSTATION_OBJECT WinSta;
|
||||
NTSTATUS Status;
|
||||
BOOL Ret = FALSE;
|
||||
|
@ -1162,24 +1162,24 @@ NtUserSetCursorContents(
|
|||
/* Copy new IconInfo field */
|
||||
CurIcon->IconInfo = IconInfo;
|
||||
|
||||
bmp = BITMAPOBJ_LockBitmap(CurIcon->IconInfo.hbmColor);
|
||||
if(bmp)
|
||||
psurfBmp = SURFACE_LockSurface(CurIcon->IconInfo.hbmColor);
|
||||
if(psurfBmp)
|
||||
{
|
||||
CurIcon->Size.cx = bmp->SurfObj.sizlBitmap.cx;
|
||||
CurIcon->Size.cy = bmp->SurfObj.sizlBitmap.cy;
|
||||
BITMAPOBJ_UnlockBitmap(bmp);
|
||||
CurIcon->Size.cx = psurfBmp->SurfObj.sizlBitmap.cx;
|
||||
CurIcon->Size.cy = psurfBmp->SurfObj.sizlBitmap.cy;
|
||||
SURFACE_UnlockSurface(psurfBmp);
|
||||
GDIOBJ_SetOwnership(CurIcon->IconInfo.hbmColor, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
bmp = BITMAPOBJ_LockBitmap(CurIcon->IconInfo.hbmMask);
|
||||
if(!bmp)
|
||||
psurfBmp = SURFACE_LockSurface(CurIcon->IconInfo.hbmMask);
|
||||
if(!psurfBmp)
|
||||
goto done;
|
||||
|
||||
CurIcon->Size.cx = bmp->SurfObj.sizlBitmap.cx;
|
||||
CurIcon->Size.cy = bmp->SurfObj.sizlBitmap.cy / 2;
|
||||
CurIcon->Size.cx = psurfBmp->SurfObj.sizlBitmap.cx;
|
||||
CurIcon->Size.cy = psurfBmp->SurfObj.sizlBitmap.cy / 2;
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(bmp);
|
||||
SURFACE_UnlockSurface(psurfBmp);
|
||||
GDIOBJ_SetOwnership(CurIcon->IconInfo.hbmMask, NULL);
|
||||
}
|
||||
|
||||
|
@ -1215,7 +1215,7 @@ NtUserSetCursorIconData(
|
|||
{
|
||||
PCURICON_OBJECT CurIcon;
|
||||
PWINSTATION_OBJECT WinSta;
|
||||
PBITMAPOBJ pBmpObj;
|
||||
PSURFACE psurfBmp;
|
||||
NTSTATUS Status = STATUS_SUCCESS;
|
||||
BOOL Ret = FALSE;
|
||||
DECLARE_RETURN(BOOL);
|
||||
|
@ -1244,16 +1244,16 @@ NtUserSetCursorIconData(
|
|||
ProbeForRead(pIconInfo, sizeof(ICONINFO), 1);
|
||||
RtlCopyMemory(&CurIcon->IconInfo, pIconInfo, sizeof(ICONINFO));
|
||||
|
||||
CurIcon->IconInfo.hbmMask = BITMAPOBJ_CopyBitmap(pIconInfo->hbmMask);
|
||||
CurIcon->IconInfo.hbmColor = BITMAPOBJ_CopyBitmap(pIconInfo->hbmColor);
|
||||
CurIcon->IconInfo.hbmMask = SURFACE_CopyBitmap(pIconInfo->hbmMask);
|
||||
CurIcon->IconInfo.hbmColor = SURFACE_CopyBitmap(pIconInfo->hbmColor);
|
||||
|
||||
if (CurIcon->IconInfo.hbmColor)
|
||||
{
|
||||
if ((pBmpObj = BITMAPOBJ_LockBitmap(CurIcon->IconInfo.hbmColor)))
|
||||
if ((psurfBmp = SURFACE_LockSurface(CurIcon->IconInfo.hbmColor)))
|
||||
{
|
||||
CurIcon->Size.cx = pBmpObj->SurfObj.sizlBitmap.cx;
|
||||
CurIcon->Size.cy = pBmpObj->SurfObj.sizlBitmap.cy;
|
||||
BITMAPOBJ_UnlockBitmap(pBmpObj);
|
||||
CurIcon->Size.cx = psurfBmp->SurfObj.sizlBitmap.cx;
|
||||
CurIcon->Size.cy = psurfBmp->SurfObj.sizlBitmap.cy;
|
||||
SURFACE_UnlockSurface(psurfBmp);
|
||||
GDIOBJ_SetOwnership(GdiHandleTable, CurIcon->IconInfo.hbmMask, NULL);
|
||||
}
|
||||
}
|
||||
|
@ -1261,11 +1261,11 @@ NtUserSetCursorIconData(
|
|||
{
|
||||
if (CurIcon->IconInfo.hbmColor == NULL)
|
||||
{
|
||||
if ((pBmpObj = BITMAPOBJ_LockBitmap(CurIcon->IconInfo.hbmMask)))
|
||||
if ((psurfBmp = SURFACE_LockSurface(CurIcon->IconInfo.hbmMask)))
|
||||
{
|
||||
CurIcon->Size.cx = pBmpObj->SurfObj.sizlBitmap.cx;
|
||||
CurIcon->Size.cy = pBmpObj->SurfObj.sizlBitmap.cy;
|
||||
BITMAPOBJ_UnlockBitmap(pBmpObj);
|
||||
CurIcon->Size.cx = psurfBmp->SurfObj.sizlBitmap.cx;
|
||||
CurIcon->Size.cy = psurfBmp->SurfObj.sizlBitmap.cy;
|
||||
SURFACE_UnlockSurface(psurfBmp);
|
||||
}
|
||||
}
|
||||
GDIOBJ_SetOwnership(GdiHandleTable, CurIcon->IconInfo.hbmMask, NULL);
|
||||
|
@ -1545,7 +1545,7 @@ UserDrawIconEx(
|
|||
{
|
||||
RECT r;
|
||||
BITMAP bm;
|
||||
BITMAPOBJ *BitmapObj = NULL;
|
||||
SURFACE *psurfOff = NULL;
|
||||
|
||||
r.right = cxWidth;
|
||||
r.bottom = cyHeight;
|
||||
|
@ -1566,18 +1566,18 @@ UserDrawIconEx(
|
|||
|
||||
/* make sure we have a 32 bit offscreen bitmap
|
||||
otherwise we can't do alpha blending */
|
||||
BitmapObj = BITMAPOBJ_LockBitmap(hbmOff);
|
||||
if (BitmapObj == NULL)
|
||||
psurfOff = SURFACE_LockSurface(hbmOff);
|
||||
if (psurfOff == NULL)
|
||||
{
|
||||
DPRINT1("BITMAPOBJ_LockBitmap() failed!\n");
|
||||
goto cleanup;
|
||||
}
|
||||
BITMAP_GetObject(BitmapObj, sizeof(BITMAP), (PVOID)&bm);
|
||||
BITMAP_GetObject(psurfOff, sizeof(BITMAP), (PVOID)&bm);
|
||||
|
||||
if (bm.bmBitsPixel != 32)
|
||||
bAlpha = FALSE;
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
SURFACE_UnlockSurface(psurfOff);
|
||||
|
||||
hOldOffBmp = NtGdiSelectBitmap(hdcOff, hbmOff);
|
||||
if (!hOldOffBmp)
|
||||
|
@ -1661,7 +1661,7 @@ UserDrawIconEx(
|
|||
if (bAlpha)
|
||||
{
|
||||
BITMAP bm;
|
||||
BITMAPOBJ *BitmapObj = NULL;
|
||||
SURFACE *psurfOff = NULL;
|
||||
PBYTE pBits = NULL;
|
||||
BLENDFUNCTION BlendFunc;
|
||||
DWORD Pixel;
|
||||
|
@ -1669,24 +1669,24 @@ UserDrawIconEx(
|
|||
DWORD Count = 0;
|
||||
INT i, j;
|
||||
|
||||
BitmapObj = BITMAPOBJ_LockBitmap(hbmOff);
|
||||
if (BitmapObj == NULL)
|
||||
psurfOff = SURFACE_LockSurface(hbmOff);
|
||||
if (psurfOff == NULL)
|
||||
{
|
||||
DPRINT1("BITMAPOBJ_LockBitmap() failed!\n");
|
||||
goto cleanup;
|
||||
}
|
||||
BITMAP_GetObject(BitmapObj, sizeof(BITMAP), (PVOID)&bm);
|
||||
BITMAP_GetObject(psurfOff, sizeof(BITMAP), (PVOID)&bm);
|
||||
|
||||
pBits = ExAllocatePoolWithTag(PagedPool, bm.bmWidthBytes * abs(bm.bmHeight), TAG_BITMAP);
|
||||
if (pBits == NULL)
|
||||
{
|
||||
DPRINT1("ExAllocatePoolWithTag() failed!\n");
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
SURFACE_UnlockSurface(psurfOff);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/* get icon bits */
|
||||
IntGetBitmapBits(BitmapObj, bm.bmWidthBytes * abs(bm.bmHeight), pBits);
|
||||
IntGetBitmapBits(psurfOff, bm.bmWidthBytes * abs(bm.bmHeight), pBits);
|
||||
|
||||
/* premultiply with the alpha channel value */
|
||||
for (i = 0; i < cyHeight; i++)
|
||||
|
@ -1708,10 +1708,10 @@ UserDrawIconEx(
|
|||
}
|
||||
|
||||
/* set icon bits */
|
||||
IntSetBitmapBits(BitmapObj, bm.bmWidthBytes * abs(bm.bmHeight), pBits);
|
||||
IntSetBitmapBits(psurfOff, bm.bmWidthBytes * abs(bm.bmHeight), pBits);
|
||||
ExFreePoolWithTag(pBits, TAG_BITMAP);
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
SURFACE_UnlockSurface(psurfOff);
|
||||
|
||||
BlendFunc.BlendOp = AC_SRC_OVER;
|
||||
BlendFunc.BlendFlags = 0;
|
||||
|
@ -1805,9 +1805,9 @@ UserShowCursor(BOOL bShow)
|
|||
|
||||
HDC Screen;
|
||||
PDC dc;
|
||||
HBITMAP dcbmp;
|
||||
HBITMAP hbmpDc;
|
||||
SURFOBJ *SurfObj;
|
||||
BITMAPOBJ *BitmapObj;
|
||||
SURFACE *psurfDc;
|
||||
GDIDEVICE *ppdev;
|
||||
GDIPOINTER *pgp;
|
||||
int showpointer=0;
|
||||
|
@ -1824,19 +1824,19 @@ UserShowCursor(BOOL bShow)
|
|||
return showpointer; /* No mouse */
|
||||
}
|
||||
|
||||
dcbmp = dc->w.hBitmap;
|
||||
hbmpDc = dc->w.hBitmap;
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
BitmapObj = BITMAPOBJ_LockBitmap(dcbmp);
|
||||
if ( !BitmapObj )
|
||||
psurfDc = SURFACE_LockSurface(hbmpDc);
|
||||
if ( !psurfDc )
|
||||
{
|
||||
return showpointer; /* No Mouse */
|
||||
}
|
||||
|
||||
SurfObj = &BitmapObj->SurfObj;
|
||||
SurfObj = &psurfDc->SurfObj;
|
||||
if (SurfObj == NULL)
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
SURFACE_UnlockSurface(psurfDc);
|
||||
return showpointer; /* No mouse */
|
||||
}
|
||||
|
||||
|
@ -1844,7 +1844,7 @@ UserShowCursor(BOOL bShow)
|
|||
|
||||
if(ppdev == NULL)
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
SURFACE_UnlockSurface(psurfDc);
|
||||
return showpointer; /* No mouse */
|
||||
}
|
||||
|
||||
|
@ -1881,6 +1881,6 @@ UserShowCursor(BOOL bShow)
|
|||
}
|
||||
}
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
SURFACE_UnlockSurface(psurfDc);
|
||||
return showpointer;
|
||||
}
|
||||
|
|
|
@ -449,15 +449,15 @@ IntGetDesktopWorkArea(PDESKTOP Desktop, PRECT Rect)
|
|||
if((Ret->right == -1) && ScreenDeviceContext)
|
||||
{
|
||||
PDC dc;
|
||||
BITMAPOBJ *BitmapObj;
|
||||
SURFACE *psurf;
|
||||
dc = DC_LockDc(ScreenDeviceContext);
|
||||
/* FIXME - Handle dc == NULL!!!! */
|
||||
BitmapObj = BITMAPOBJ_LockBitmap(dc->w.hBitmap);
|
||||
if(BitmapObj)
|
||||
psurf = SURFACE_LockSurface(dc->w.hBitmap);
|
||||
if(psurf)
|
||||
{
|
||||
Ret->right = BitmapObj->SurfObj.sizlBitmap.cx;
|
||||
Ret->bottom = BitmapObj->SurfObj.sizlBitmap.cy;
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
Ret->right = psurf->SurfObj.sizlBitmap.cx;
|
||||
Ret->bottom = psurf->SurfObj.sizlBitmap.cy;
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
}
|
||||
DC_UnlockDc(dc);
|
||||
}
|
||||
|
|
|
@ -984,8 +984,8 @@ IntMouseInput(MOUSEINPUT *mi)
|
|||
BOOL DoMove, SwapButtons;
|
||||
MSG Msg;
|
||||
HBITMAP hBitmap;
|
||||
BITMAPOBJ *BitmapObj;
|
||||
SURFOBJ *SurfObj;
|
||||
SURFACE *psurf;
|
||||
SURFOBJ *pso;
|
||||
PDC dc;
|
||||
PWINDOW_OBJECT DesktopWindow;
|
||||
|
||||
|
@ -1083,21 +1083,21 @@ IntMouseInput(MOUSEINPUT *mi)
|
|||
hBitmap = dc->w.hBitmap;
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
BitmapObj = BITMAPOBJ_LockBitmap(hBitmap);
|
||||
if (BitmapObj)
|
||||
psurf = SURFACE_LockSurface(hBitmap);
|
||||
if (psurf)
|
||||
{
|
||||
SurfObj = &BitmapObj->SurfObj;
|
||||
pso = &psurf->SurfObj;
|
||||
|
||||
if (CurInfo->ShowingCursor)
|
||||
{
|
||||
IntEngMovePointer(SurfObj, MousePos.x, MousePos.y, &(GDIDEV(SurfObj)->Pointer.Exclude));
|
||||
IntEngMovePointer(pso, MousePos.x, MousePos.y, &(GDIDEV(pso)->Pointer.Exclude));
|
||||
}
|
||||
/* Only now, update the info in the GDIDEVICE, so EngMovePointer can
|
||||
* use the old values to move the pointer image */
|
||||
gpsi->ptCursor.x = MousePos.x;
|
||||
gpsi->ptCursor.y = MousePos.y;
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -357,17 +357,17 @@ IntSystemParametersInfo(
|
|||
hNewBitmap = *(HBITMAP*)pvParam;
|
||||
if(hNewBitmap != NULL)
|
||||
{
|
||||
BITMAPOBJ *bmp;
|
||||
SURFACE *psurfBmp;
|
||||
/* try to get the size of the wallpaper */
|
||||
if(!(bmp = BITMAPOBJ_LockBitmap(hNewBitmap)))
|
||||
if(!(psurfBmp = SURFACE_LockSurface(hNewBitmap)))
|
||||
{
|
||||
ObDereferenceObject(WinStaObject);
|
||||
return FALSE;
|
||||
}
|
||||
WinStaObject->cxWallpaper = bmp->SurfObj.sizlBitmap.cx;
|
||||
WinStaObject->cyWallpaper = bmp->SurfObj.sizlBitmap.cy;
|
||||
WinStaObject->cxWallpaper = psurfBmp->SurfObj.sizlBitmap.cx;
|
||||
WinStaObject->cyWallpaper = psurfBmp->SurfObj.sizlBitmap.cy;
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(bmp);
|
||||
SURFACE_UnlockSurface(psurfBmp);
|
||||
|
||||
/* change the bitmap's ownership */
|
||||
GDIOBJ_SetOwnership(hNewBitmap, NULL);
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* a couple macros to fill a single pixel or a line
|
||||
*/
|
||||
#define PUTPIXEL(x,y,BrushInst) \
|
||||
ret = ret && IntEngLineTo(&BitmapObj->SurfObj, \
|
||||
ret = ret && IntEngLineTo(&psurf->SurfObj, \
|
||||
dc->CombinedClip, \
|
||||
&BrushInst.BrushObject, \
|
||||
x, y, (x)+1, y, \
|
||||
|
@ -15,7 +15,7 @@
|
|||
ROP2_TO_MIX(Dc_Attr->jROP2));
|
||||
|
||||
#define PUTLINE(x1,y1,x2,y2,BrushInst) \
|
||||
ret = ret && IntEngLineTo(&BitmapObj->SurfObj, \
|
||||
ret = ret && IntEngLineTo(&psurf->SurfObj, \
|
||||
dc->CombinedClip, \
|
||||
&BrushInst.BrushObject, \
|
||||
x1, y1, x2, y2, \
|
||||
|
@ -46,7 +46,7 @@ IntArc( DC *dc,
|
|||
RECTL RectBounds, RectSEpts;
|
||||
PGDIBRUSHOBJ PenBrushObj;
|
||||
GDIBRUSHINST PenBrushInst;
|
||||
BITMAPOBJ *BitmapObj;
|
||||
SURFACE *psurf;
|
||||
BOOL ret = TRUE;
|
||||
LONG PenWidth, PenOrigWidth;
|
||||
double AngleStart, AngleEnd;
|
||||
|
@ -158,8 +158,8 @@ IntArc( DC *dc,
|
|||
arctype,
|
||||
PenBrushObj);
|
||||
|
||||
BitmapObj = BITMAPOBJ_LockBitmap(dc->w.hBitmap);
|
||||
if (NULL == BitmapObj)
|
||||
psurf = SURFACE_LockSurface(dc->w.hBitmap);
|
||||
if (NULL == psurf)
|
||||
{
|
||||
DPRINT1("Arc Fail 2\n");
|
||||
PENOBJ_UnlockPen(PenBrushObj);
|
||||
|
@ -178,7 +178,7 @@ IntArc( DC *dc,
|
|||
PUTLINE(EfCx + CenterX, EfCy + CenterY, SfCx + CenterX, SfCy + CenterY, PenBrushInst);
|
||||
|
||||
PenBrushObj->ptPenWidth.x = PenOrigWidth;
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
PENOBJ_UnlockPen(PenBrushObj);
|
||||
DPRINT("IntArc Exit.\n");
|
||||
return ret;
|
||||
|
|
|
@ -42,7 +42,7 @@ NtGdiAlphaBlend(
|
|||
{
|
||||
PDC DCDest;
|
||||
PDC DCSrc;
|
||||
BITMAPOBJ *BitmapDest, *BitmapSrc;
|
||||
SURFACE *BitmapDest, *BitmapSrc;
|
||||
RECTL DestRect, SourceRect;
|
||||
BOOL Status;
|
||||
XLATEOBJ *XlateObj;
|
||||
|
@ -116,7 +116,7 @@ NtGdiAlphaBlend(
|
|||
}
|
||||
|
||||
/* Determine surfaces to be used in the bitblt */
|
||||
BitmapDest = BITMAPOBJ_LockBitmap(DCDest->w.hBitmap);
|
||||
BitmapDest = SURFACE_LockSurface(DCDest->w.hBitmap);
|
||||
if (!BitmapDest)
|
||||
{
|
||||
if (hDCSrc != hDCDest)
|
||||
|
@ -128,10 +128,10 @@ NtGdiAlphaBlend(
|
|||
BitmapSrc = BitmapDest;
|
||||
else
|
||||
{
|
||||
BitmapSrc = BITMAPOBJ_LockBitmap(DCSrc->w.hBitmap);
|
||||
BitmapSrc = SURFACE_LockSurface(DCSrc->w.hBitmap);
|
||||
if (!BitmapSrc)
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmap(BitmapDest);
|
||||
SURFACE_UnlockSurface(BitmapDest);
|
||||
if (hDCSrc != hDCDest)
|
||||
DC_UnlockDc(DCSrc);
|
||||
DC_UnlockDc(DCDest);
|
||||
|
@ -160,9 +160,9 @@ NtGdiAlphaBlend(
|
|||
if (XlateObj != NULL)
|
||||
EngDeleteXlate(XlateObj);
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(BitmapDest);
|
||||
SURFACE_UnlockSurface(BitmapDest);
|
||||
if (BitmapSrc != BitmapDest)
|
||||
BITMAPOBJ_UnlockBitmap(BitmapSrc);
|
||||
SURFACE_UnlockSurface(BitmapSrc);
|
||||
DC_UnlockDc(DCDest);
|
||||
if (hDCSrc != hDCDest)
|
||||
DC_UnlockDc(DCSrc);
|
||||
|
@ -187,7 +187,7 @@ NtGdiBitBlt(
|
|||
PDC DCDest;
|
||||
PDC DCSrc = NULL;
|
||||
PDC_ATTR Dc_Attr = NULL;
|
||||
BITMAPOBJ *BitmapDest, *BitmapSrc = NULL;
|
||||
SURFACE *BitmapDest, *BitmapSrc = NULL;
|
||||
RECTL DestRect;
|
||||
POINTL SourcePoint, BrushOrigin;
|
||||
BOOL Status = FALSE;
|
||||
|
@ -264,7 +264,7 @@ NtGdiBitBlt(
|
|||
BrushOrigin.y = 0;
|
||||
|
||||
/* Determine surfaces to be used in the bitblt */
|
||||
BitmapDest = BITMAPOBJ_LockBitmap(DCDest->w.hBitmap);
|
||||
BitmapDest = SURFACE_LockSurface(DCDest->w.hBitmap);
|
||||
if (!BitmapDest)
|
||||
goto cleanup;
|
||||
|
||||
|
@ -274,7 +274,7 @@ NtGdiBitBlt(
|
|||
BitmapSrc = BitmapDest;
|
||||
else
|
||||
{
|
||||
BitmapSrc = BITMAPOBJ_LockBitmap(DCSrc->w.hBitmap);
|
||||
BitmapSrc = SURFACE_LockSurface(DCSrc->w.hBitmap);
|
||||
if (!BitmapSrc)
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -319,11 +319,11 @@ cleanup:
|
|||
|
||||
if(BitmapDest != NULL)
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmap(BitmapDest);
|
||||
SURFACE_UnlockSurface(BitmapDest);
|
||||
}
|
||||
if (BitmapSrc != NULL && BitmapSrc != BitmapDest)
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmap(BitmapSrc);
|
||||
SURFACE_UnlockSurface(BitmapSrc);
|
||||
}
|
||||
if (BrushObj != NULL)
|
||||
{
|
||||
|
@ -354,7 +354,7 @@ NtGdiTransparentBlt(
|
|||
{
|
||||
PDC DCDest, DCSrc;
|
||||
RECTL rcDest, rcSrc;
|
||||
BITMAPOBJ *BitmapDest, *BitmapSrc = NULL;
|
||||
SURFACE *BitmapDest, *BitmapSrc = NULL;
|
||||
XLATEOBJ *XlateObj = NULL;
|
||||
HPALETTE SourcePalette = 0, DestPalette = 0;
|
||||
PPALGDI PalDestGDI, PalSourceGDI;
|
||||
|
@ -403,13 +403,13 @@ NtGdiTransparentBlt(
|
|||
xSrc += DCSrc->ptlDCOrig.x;
|
||||
ySrc += DCSrc->ptlDCOrig.y;
|
||||
|
||||
BitmapDest = BITMAPOBJ_LockBitmap(DCDest->w.hBitmap);
|
||||
BitmapDest = SURFACE_LockSurface(DCDest->w.hBitmap);
|
||||
if (!BitmapDest)
|
||||
{
|
||||
goto done;
|
||||
}
|
||||
|
||||
BitmapSrc = BITMAPOBJ_LockBitmap(DCSrc->w.hBitmap);
|
||||
BitmapSrc = SURFACE_LockSurface(DCSrc->w.hBitmap);
|
||||
if (!BitmapSrc)
|
||||
{
|
||||
goto done;
|
||||
|
@ -477,11 +477,11 @@ done:
|
|||
DC_UnlockDc(DCSrc);
|
||||
if (BitmapDest)
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmap(BitmapDest);
|
||||
SURFACE_UnlockSurface(BitmapDest);
|
||||
}
|
||||
if (BitmapSrc)
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmap(BitmapSrc);
|
||||
SURFACE_UnlockSurface(BitmapSrc);
|
||||
}
|
||||
if(hdcDst != hdcSrc)
|
||||
{
|
||||
|
@ -744,7 +744,7 @@ NtGdiStretchBlt(
|
|||
PDC DCDest;
|
||||
PDC DCSrc = NULL;
|
||||
PDC_ATTR Dc_Attr;
|
||||
BITMAPOBJ *BitmapDest, *BitmapSrc = NULL;
|
||||
SURFACE *BitmapDest, *BitmapSrc = NULL;
|
||||
RECTL DestRect;
|
||||
RECTL SourceRect;
|
||||
BOOL Status = FALSE;
|
||||
|
@ -825,7 +825,7 @@ NtGdiStretchBlt(
|
|||
SourceRect.bottom = YOriginSrc+HeightSrc;
|
||||
|
||||
/* Determine surfaces to be used in the bitblt */
|
||||
BitmapDest = BITMAPOBJ_LockBitmap(DCDest->w.hBitmap);
|
||||
BitmapDest = SURFACE_LockSurface(DCDest->w.hBitmap);
|
||||
if (BitmapDest == NULL)
|
||||
goto failed;
|
||||
if (UsesSource)
|
||||
|
@ -836,7 +836,7 @@ NtGdiStretchBlt(
|
|||
}
|
||||
else
|
||||
{
|
||||
BitmapSrc = BITMAPOBJ_LockBitmap(DCSrc->w.hBitmap);
|
||||
BitmapSrc = SURFACE_LockSurface(DCSrc->w.hBitmap);
|
||||
if (BitmapSrc == NULL)
|
||||
goto failed;
|
||||
}
|
||||
|
@ -928,11 +928,11 @@ failed:
|
|||
}
|
||||
if (BitmapSrc && DCSrc->w.hBitmap != DCDest->w.hBitmap)
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmap(BitmapSrc);
|
||||
SURFACE_UnlockSurface(BitmapSrc);
|
||||
}
|
||||
if (BitmapDest)
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmap(BitmapDest);
|
||||
SURFACE_UnlockSurface(BitmapDest);
|
||||
}
|
||||
if (UsesSource && hDCSrc != hDCDest)
|
||||
{
|
||||
|
@ -954,15 +954,15 @@ IntPatBlt(
|
|||
PGDIBRUSHOBJ BrushObj)
|
||||
{
|
||||
RECTL DestRect;
|
||||
BITMAPOBJ *BitmapObj;
|
||||
SURFACE *psurf;
|
||||
GDIBRUSHINST BrushInst;
|
||||
POINTL BrushOrigin;
|
||||
BOOL ret = TRUE;
|
||||
|
||||
ASSERT(BrushObj);
|
||||
|
||||
BitmapObj = BITMAPOBJ_LockBitmap(dc->w.hBitmap);
|
||||
if (BitmapObj == NULL)
|
||||
psurf = SURFACE_LockSurface(dc->w.hBitmap);
|
||||
if (psurf == NULL)
|
||||
{
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
|
@ -1000,7 +1000,7 @@ IntPatBlt(
|
|||
IntGdiInitBrushInstance(&BrushInst, BrushObj, dc->XlateBrush);
|
||||
|
||||
ret = IntEngBitBlt(
|
||||
&BitmapObj->SurfObj,
|
||||
&psurf->SurfObj,
|
||||
NULL,
|
||||
NULL,
|
||||
dc->CombinedClip,
|
||||
|
@ -1013,7 +1013,7 @@ IntPatBlt(
|
|||
ROP3_TO_ROP4(ROP));
|
||||
}
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ IntGdiCreateBitmap(
|
|||
LONG WidthBytes;
|
||||
|
||||
/* NOTE: Windows also doesn't store nr. of planes separately! */
|
||||
BitsPixel = BITMAPOBJ_GetRealBitsPixel(BitsPixel * Planes);
|
||||
BitsPixel = SURFACE_GetRealBitsPixel(BitsPixel * Planes);
|
||||
|
||||
/* Check parameters */
|
||||
if (BitsPixel == 0 || Width <= 0 || Width >= 0x8000000 || Height == 0)
|
||||
|
@ -54,7 +54,7 @@ IntGdiCreateBitmap(
|
|||
return 0;
|
||||
}
|
||||
|
||||
WidthBytes = BITMAPOBJ_GetWidthBytes(Width, BitsPixel);
|
||||
WidthBytes = SURFACE_GetWidthBytes(Width, BitsPixel);
|
||||
|
||||
Size.cx = Width;
|
||||
Size.cy = abs(Height);
|
||||
|
@ -78,22 +78,22 @@ IntGdiCreateBitmap(
|
|||
return 0;
|
||||
}
|
||||
|
||||
PBITMAPOBJ bmp = BITMAPOBJ_LockBitmap( hBitmap );
|
||||
if (bmp == NULL)
|
||||
PSURFACE psurfBmp = SURFACE_LockSurface(hBitmap);
|
||||
if (psurfBmp == NULL)
|
||||
{
|
||||
NtGdiDeleteObject(hBitmap);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bmp->flFlags = BITMAPOBJ_IS_APIBITMAP;
|
||||
bmp->hDC = NULL; // Fixme
|
||||
psurfBmp->flFlags = BITMAPOBJ_IS_APIBITMAP;
|
||||
psurfBmp->hDC = NULL; // Fixme
|
||||
|
||||
if (NULL != pBits)
|
||||
{
|
||||
IntSetBitmapBits(bmp, bmp->SurfObj.cjBits, pBits);
|
||||
IntSetBitmapBits(psurfBmp, psurfBmp->SurfObj.cjBits, pBits);
|
||||
}
|
||||
|
||||
BITMAPOBJ_UnlockBitmap( bmp );
|
||||
SURFACE_UnlockSurface(psurfBmp);
|
||||
|
||||
DPRINT("IntGdiCreateBitmap : %dx%d, %d BPP colors, topdown %d, returning %08x\n",
|
||||
Size.cx, Size.cy, BitsPixel, (Height < 0 ? 1 : 0), hBitmap);
|
||||
|
@ -113,7 +113,7 @@ NtGdiCreateBitmap(
|
|||
if (pUnsafeBits)
|
||||
{
|
||||
BOOL Hit = FALSE;
|
||||
UINT cjBits = BITMAPOBJ_GetWidthBytes(Width, BitsPixel) * abs(Height);
|
||||
UINT cjBits = SURFACE_GetWidthBytes(Width, BitsPixel) * abs(Height);
|
||||
|
||||
_SEH2_TRY
|
||||
{
|
||||
|
@ -131,40 +131,6 @@ NtGdiCreateBitmap(
|
|||
return IntGdiCreateBitmap(Width, Height, Planes, BitsPixel, pUnsafeBits);
|
||||
}
|
||||
|
||||
BOOL INTERNAL_CALL
|
||||
BITMAP_Cleanup(PVOID ObjectBody)
|
||||
{
|
||||
PBITMAPOBJ pBmp = (PBITMAPOBJ)ObjectBody;
|
||||
if (pBmp->SurfObj.pvBits != NULL &&
|
||||
(pBmp->flFlags & BITMAPOBJ_IS_APIBITMAP))
|
||||
{
|
||||
if (pBmp->dib == NULL)
|
||||
{
|
||||
ExFreePool(pBmp->SurfObj.pvBits);
|
||||
}
|
||||
else
|
||||
{
|
||||
EngFreeUserMem(pBmp->SurfObj.pvBits);
|
||||
}
|
||||
if (pBmp->hDIBPalette != NULL)
|
||||
{
|
||||
NtGdiDeleteObject(pBmp->hDIBPalette);
|
||||
}
|
||||
}
|
||||
|
||||
if (NULL != pBmp->BitsLock)
|
||||
{
|
||||
ExFreePoolWithTag(pBmp->BitsLock, TAG_BITMAPOBJ);
|
||||
pBmp->BitsLock = NULL;
|
||||
}
|
||||
|
||||
if (pBmp->dib)
|
||||
ExFreePoolWithTag(pBmp->dib, TAG_DIB);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
HBITMAP FASTCALL
|
||||
IntCreateCompatibleBitmap(
|
||||
PDC Dc,
|
||||
|
@ -192,8 +158,8 @@ IntCreateCompatibleBitmap(
|
|||
{
|
||||
DIBSECTION dibs;
|
||||
INT Count;
|
||||
PBITMAPOBJ BitmapObj = BITMAPOBJ_LockBitmap( Dc->w.hBitmap );
|
||||
Count = BITMAP_GetObject(BitmapObj, sizeof(dibs), &dibs);
|
||||
PSURFACE psurf = SURFACE_LockSurface( Dc->w.hBitmap );
|
||||
Count = BITMAP_GetObject(psurf, sizeof(dibs), &dibs);
|
||||
|
||||
if (Count)
|
||||
{
|
||||
|
@ -255,12 +221,12 @@ IntCreateCompatibleBitmap(
|
|||
{
|
||||
/* Copy the color table */
|
||||
UINT Index;
|
||||
PPALGDI PalGDI = PALETTE_LockPalette(BitmapObj->hDIBPalette);
|
||||
PPALGDI PalGDI = PALETTE_LockPalette(psurf->hDIBPalette);
|
||||
|
||||
if (!PalGDI)
|
||||
{
|
||||
ExFreePoolWithTag(bi, TAG_TEMP);
|
||||
BITMAPOBJ_UnlockBitmap( BitmapObj );
|
||||
SURFACE_UnlockSurface( psurf );
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return 0;
|
||||
}
|
||||
|
@ -276,7 +242,7 @@ IntCreateCompatibleBitmap(
|
|||
}
|
||||
PALETTE_UnlockPalette(PalGDI);
|
||||
}
|
||||
BITMAPOBJ_UnlockBitmap( BitmapObj );
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
|
||||
Bmp = DIB_CreateDIBSection ( Dc,
|
||||
bi,
|
||||
|
@ -291,7 +257,7 @@ IntCreateCompatibleBitmap(
|
|||
}
|
||||
}
|
||||
}
|
||||
BITMAPOBJ_UnlockBitmap( BitmapObj );
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
}
|
||||
}
|
||||
return Bmp;
|
||||
|
@ -337,14 +303,14 @@ NtGdiGetBitmapDimension(
|
|||
HBITMAP hBitmap,
|
||||
LPSIZE Dimension)
|
||||
{
|
||||
PBITMAPOBJ bmp;
|
||||
PSURFACE psurfBmp;
|
||||
BOOL Ret = TRUE;
|
||||
|
||||
if (hBitmap == NULL)
|
||||
return FALSE;
|
||||
|
||||
bmp = BITMAPOBJ_LockBitmap(hBitmap);
|
||||
if (bmp == NULL)
|
||||
psurfBmp = SURFACE_LockSurface(hBitmap);
|
||||
if (psurfBmp == NULL)
|
||||
{
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
|
@ -353,7 +319,7 @@ NtGdiGetBitmapDimension(
|
|||
_SEH2_TRY
|
||||
{
|
||||
ProbeForWrite(Dimension, sizeof(SIZE), 1);
|
||||
*Dimension = bmp->dimension;
|
||||
*Dimension = psurfBmp->dimension;
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
|
@ -361,7 +327,7 @@ NtGdiGetBitmapDimension(
|
|||
}
|
||||
_SEH2_END
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(bmp);
|
||||
SURFACE_UnlockSurface(psurfBmp);
|
||||
|
||||
return Ret;
|
||||
}
|
||||
|
@ -372,8 +338,8 @@ NtGdiGetPixel(HDC hDC, INT XPos, INT YPos)
|
|||
PDC dc = NULL;
|
||||
COLORREF Result = (COLORREF)CLR_INVALID; // default to failure
|
||||
BOOL bInRect = FALSE;
|
||||
BITMAPOBJ *BitmapObject;
|
||||
SURFOBJ *SurfaceObject;
|
||||
SURFACE *psurf;
|
||||
SURFOBJ *pso;
|
||||
HPALETTE Pal = 0;
|
||||
XLATEOBJ *XlateObj;
|
||||
HBITMAP hBmpTmp;
|
||||
|
@ -395,11 +361,11 @@ NtGdiGetPixel(HDC hDC, INT XPos, INT YPos)
|
|||
if ( IN_RECT(dc->CombinedClip->rclBounds,XPos,YPos) )
|
||||
{
|
||||
bInRect = TRUE;
|
||||
BitmapObject = BITMAPOBJ_LockBitmap(dc->w.hBitmap);
|
||||
SurfaceObject = &BitmapObject->SurfObj;
|
||||
if ( BitmapObject )
|
||||
psurf = SURFACE_LockSurface(dc->w.hBitmap);
|
||||
pso = &psurf->SurfObj;
|
||||
if ( psurf )
|
||||
{
|
||||
Pal = BitmapObject->hDIBPalette;
|
||||
Pal = psurf->hDIBPalette;
|
||||
if (!Pal) Pal = pPrimarySurface->DevInfo.hpalDefault;
|
||||
|
||||
/* FIXME: Verify if it shouldn't be PAL_BGR! */
|
||||
|
@ -407,15 +373,15 @@ NtGdiGetPixel(HDC hDC, INT XPos, INT YPos)
|
|||
if ( XlateObj )
|
||||
{
|
||||
// check if this DC has a DIB behind it...
|
||||
if ( SurfaceObject->pvScan0 ) // STYPE_BITMAP == SurfaceObject->iType
|
||||
if ( pso->pvScan0 ) // STYPE_BITMAP == pso->iType
|
||||
{
|
||||
ASSERT ( SurfaceObject->lDelta );
|
||||
ASSERT ( pso->lDelta );
|
||||
Result = XLATEOBJ_iXlate(XlateObj,
|
||||
DibFunctionsForBitmapFormat[SurfaceObject->iBitmapFormat].DIB_GetPixel ( SurfaceObject, XPos, YPos ) );
|
||||
DibFunctionsForBitmapFormat[pso->iBitmapFormat].DIB_GetPixel ( pso, XPos, YPos ) );
|
||||
}
|
||||
EngDeleteXlate(XlateObj);
|
||||
}
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObject);
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
}
|
||||
}
|
||||
DC_UnlockDc(dc);
|
||||
|
@ -448,18 +414,18 @@ NtGdiGetPixel(HDC hDC, INT XPos, INT YPos)
|
|||
HBITMAP hBmpOld = (HBITMAP)NtGdiSelectBitmap ( hDCTmp, hBmpTmp );
|
||||
if ( hBmpOld )
|
||||
{
|
||||
PBITMAPOBJ bmpobj;
|
||||
PSURFACE psurf;
|
||||
|
||||
NtGdiBitBlt ( hDCTmp, 0, 0, 1, 1, hDC, XPos, YPos, SRCCOPY, 0, 0 );
|
||||
NtGdiSelectBitmap ( hDCTmp, hBmpOld );
|
||||
|
||||
// our bitmap is no longer selected, so we can access it's stuff...
|
||||
bmpobj = BITMAPOBJ_LockBitmap ( hBmpTmp );
|
||||
if ( bmpobj )
|
||||
psurf = SURFACE_LockSurface(hBmpTmp);
|
||||
if ( psurf )
|
||||
{
|
||||
// Dont you need to convert something here?
|
||||
Result = *(COLORREF*)bmpobj->SurfObj.pvScan0;
|
||||
BITMAPOBJ_UnlockBitmap ( bmpobj );
|
||||
Result = *(COLORREF*)psurf->SurfObj.pvScan0;
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
}
|
||||
}
|
||||
NtGdiDeleteObject ( hBmpTmp );
|
||||
|
@ -474,7 +440,7 @@ NtGdiGetPixel(HDC hDC, INT XPos, INT YPos)
|
|||
|
||||
LONG APIENTRY
|
||||
IntGetBitmapBits(
|
||||
PBITMAPOBJ bmp,
|
||||
PSURFACE psurf,
|
||||
DWORD Bytes,
|
||||
OUT PBYTE Bits)
|
||||
{
|
||||
|
@ -483,16 +449,16 @@ IntGetBitmapBits(
|
|||
ASSERT(Bits);
|
||||
|
||||
/* Don't copy more bytes than the buffer has */
|
||||
Bytes = min(Bytes, bmp->SurfObj.cjBits);
|
||||
Bytes = min(Bytes, psurf->SurfObj.cjBits);
|
||||
|
||||
#if 0
|
||||
/* FIXME: Call DDI CopyBits here if available */
|
||||
if(bmp->DDBitmap)
|
||||
if(psurf->DDBitmap)
|
||||
{
|
||||
DPRINT("Calling device specific BitmapBits\n");
|
||||
if(bmp->DDBitmap->funcs->pBitmapBits)
|
||||
if(psurf->DDBitmap->funcs->pBitmapBits)
|
||||
{
|
||||
ret = bmp->DDBitmap->funcs->pBitmapBits(hbitmap, bits, count, DDB_GET);
|
||||
ret = psurf->DDBitmap->funcs->pBitmapBits(hbitmap, bits, count, DDB_GET);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -503,7 +469,7 @@ IntGetBitmapBits(
|
|||
else
|
||||
#endif
|
||||
{
|
||||
RtlCopyMemory(Bits, bmp->SurfObj.pvBits, Bytes);
|
||||
RtlCopyMemory(Bits, psurf->SurfObj.pvBits, Bytes);
|
||||
ret = Bytes;
|
||||
}
|
||||
return ret;
|
||||
|
@ -514,7 +480,7 @@ NtGdiGetBitmapBits(HBITMAP hBitmap,
|
|||
ULONG Bytes,
|
||||
OUT OPTIONAL PBYTE pUnsafeBits)
|
||||
{
|
||||
PBITMAPOBJ bmp;
|
||||
PSURFACE psurf;
|
||||
LONG ret;
|
||||
|
||||
if (pUnsafeBits != NULL && Bytes == 0)
|
||||
|
@ -522,8 +488,8 @@ NtGdiGetBitmapBits(HBITMAP hBitmap,
|
|||
return 0;
|
||||
}
|
||||
|
||||
bmp = BITMAPOBJ_LockBitmap (hBitmap);
|
||||
if (!bmp)
|
||||
psurf = SURFACE_LockSurface(hBitmap);
|
||||
if (!psurf)
|
||||
{
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return 0;
|
||||
|
@ -532,18 +498,18 @@ NtGdiGetBitmapBits(HBITMAP hBitmap,
|
|||
/* If the bits vector is null, the function should return the read size */
|
||||
if (pUnsafeBits == NULL)
|
||||
{
|
||||
ret = bmp->SurfObj.cjBits;
|
||||
BITMAPOBJ_UnlockBitmap (bmp);
|
||||
ret = psurf->SurfObj.cjBits;
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Don't copy more bytes than the buffer has */
|
||||
Bytes = min(Bytes, bmp->SurfObj.cjBits);
|
||||
Bytes = min(Bytes, psurf->SurfObj.cjBits);
|
||||
|
||||
_SEH2_TRY
|
||||
{
|
||||
ProbeForWrite(pUnsafeBits, Bytes, 1);
|
||||
ret = IntGetBitmapBits(bmp, Bytes, pUnsafeBits);
|
||||
ret = IntGetBitmapBits(psurf, Bytes, pUnsafeBits);
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
|
@ -551,7 +517,7 @@ NtGdiGetBitmapBits(HBITMAP hBitmap,
|
|||
}
|
||||
_SEH2_END
|
||||
|
||||
BITMAPOBJ_UnlockBitmap (bmp);
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -559,23 +525,23 @@ NtGdiGetBitmapBits(HBITMAP hBitmap,
|
|||
|
||||
LONG APIENTRY
|
||||
IntSetBitmapBits(
|
||||
PBITMAPOBJ bmp,
|
||||
PSURFACE psurf,
|
||||
DWORD Bytes,
|
||||
IN PBYTE Bits)
|
||||
{
|
||||
LONG ret;
|
||||
|
||||
/* Don't copy more bytes than the buffer has */
|
||||
Bytes = min(Bytes, bmp->SurfObj.cjBits);
|
||||
Bytes = min(Bytes, psurf->SurfObj.cjBits);
|
||||
|
||||
#if 0
|
||||
/* FIXME: call DDI specific function here if available */
|
||||
if(bmp->DDBitmap)
|
||||
if(psurf->DDBitmap)
|
||||
{
|
||||
DPRINT ("Calling device specific BitmapBits\n");
|
||||
if (bmp->DDBitmap->funcs->pBitmapBits)
|
||||
if (psurf->DDBitmap->funcs->pBitmapBits)
|
||||
{
|
||||
ret = bmp->DDBitmap->funcs->pBitmapBits(hBitmap, (void *) Bits, Bytes, DDB_SET);
|
||||
ret = psurf->DDBitmap->funcs->pBitmapBits(hBitmap, (void *) Bits, Bytes, DDB_SET);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -586,7 +552,7 @@ IntSetBitmapBits(
|
|||
else
|
||||
#endif
|
||||
{
|
||||
RtlCopyMemory(bmp->SurfObj.pvBits, Bits, Bytes);
|
||||
RtlCopyMemory(psurf->SurfObj.pvBits, Bits, Bytes);
|
||||
ret = Bytes;
|
||||
}
|
||||
|
||||
|
@ -601,15 +567,15 @@ NtGdiSetBitmapBits(
|
|||
IN PBYTE pUnsafeBits)
|
||||
{
|
||||
LONG ret;
|
||||
PBITMAPOBJ bmp;
|
||||
PSURFACE psurf;
|
||||
|
||||
if (pUnsafeBits == NULL || Bytes == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bmp = BITMAPOBJ_LockBitmap(hBitmap);
|
||||
if (bmp == NULL)
|
||||
psurf = SURFACE_LockSurface(hBitmap);
|
||||
if (psurf == NULL)
|
||||
{
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return 0;
|
||||
|
@ -618,7 +584,7 @@ NtGdiSetBitmapBits(
|
|||
_SEH2_TRY
|
||||
{
|
||||
ProbeForRead(pUnsafeBits, Bytes, 1);
|
||||
ret = IntSetBitmapBits(bmp, Bytes, pUnsafeBits);
|
||||
ret = IntSetBitmapBits(psurf, Bytes, pUnsafeBits);
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
|
@ -626,7 +592,7 @@ NtGdiSetBitmapBits(
|
|||
}
|
||||
_SEH2_END
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(bmp);
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -638,14 +604,14 @@ NtGdiSetBitmapDimension(
|
|||
INT Height,
|
||||
LPSIZE Size)
|
||||
{
|
||||
PBITMAPOBJ bmp;
|
||||
PSURFACE psurf;
|
||||
BOOL Ret = TRUE;
|
||||
|
||||
if (hBitmap == NULL)
|
||||
return FALSE;
|
||||
|
||||
bmp = BITMAPOBJ_LockBitmap(hBitmap);
|
||||
if (bmp == NULL)
|
||||
psurf = SURFACE_LockSurface(hBitmap);
|
||||
if (psurf == NULL)
|
||||
{
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
|
@ -656,7 +622,7 @@ NtGdiSetBitmapDimension(
|
|||
_SEH2_TRY
|
||||
{
|
||||
ProbeForWrite(Size, sizeof(SIZE), 1);
|
||||
*Size = bmp->dimension;
|
||||
*Size = psurf->dimension;
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
|
@ -666,10 +632,10 @@ NtGdiSetBitmapDimension(
|
|||
}
|
||||
|
||||
/* The dimension is changed even if writing the old value failed */
|
||||
bmp->dimension.cx = Width;
|
||||
bmp->dimension.cy = Height;
|
||||
psurf->dimension.cx = Width;
|
||||
psurf->dimension.cy = Height;
|
||||
|
||||
BITMAPOBJ_UnlockBitmap (bmp);
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
|
||||
return Ret;
|
||||
}
|
||||
|
@ -723,7 +689,7 @@ NtGdiSetPixel(
|
|||
/* Internal Functions */
|
||||
|
||||
UINT FASTCALL
|
||||
BITMAPOBJ_GetRealBitsPixel(UINT nBitsPixel)
|
||||
SURFACE_GetRealBitsPixel(UINT nBitsPixel)
|
||||
{
|
||||
if (nBitsPixel <= 1)
|
||||
return 1;
|
||||
|
@ -742,7 +708,7 @@ BITMAPOBJ_GetRealBitsPixel(UINT nBitsPixel)
|
|||
}
|
||||
|
||||
INT FASTCALL
|
||||
BITMAPOBJ_GetWidthBytes (INT bmWidth, INT bpp)
|
||||
SURFACE_GetWidthBytes (INT bmWidth, INT bpp)
|
||||
{
|
||||
#if 0
|
||||
switch(bpp)
|
||||
|
@ -776,11 +742,11 @@ BITMAPOBJ_GetWidthBytes (INT bmWidth, INT bpp)
|
|||
}
|
||||
|
||||
HBITMAP FASTCALL
|
||||
BITMAPOBJ_CopyBitmap(HBITMAP hBitmap)
|
||||
SURFACE_CopyBitmap(HBITMAP hBitmap)
|
||||
{
|
||||
HBITMAP res;
|
||||
BITMAP bm;
|
||||
BITMAPOBJ *Bitmap, *resBitmap;
|
||||
SURFACE *Bitmap, *resBitmap;
|
||||
SIZEL Size;
|
||||
|
||||
if (hBitmap == NULL)
|
||||
|
@ -841,7 +807,7 @@ BITMAPOBJ_CopyBitmap(HBITMAP hBitmap)
|
|||
}
|
||||
|
||||
INT APIENTRY
|
||||
BITMAP_GetObject(BITMAPOBJ * bmp, INT Count, LPVOID buffer)
|
||||
BITMAP_GetObject(SURFACE * bmp, INT Count, LPVOID buffer)
|
||||
{
|
||||
if ((UINT)Count < sizeof(BITMAP)) return 0;
|
||||
|
||||
|
@ -891,11 +857,11 @@ NtGdiGetDCforBitmap(
|
|||
IN HBITMAP hsurf)
|
||||
{
|
||||
HDC hDC = NULL;
|
||||
PBITMAPOBJ bmp = BITMAPOBJ_LockBitmap( hsurf );
|
||||
if (bmp)
|
||||
PSURFACE psurf = SURFACE_LockSurface(hsurf);
|
||||
if (psurf)
|
||||
{
|
||||
hDC = bmp->hDC;
|
||||
BITMAPOBJ_UnlockBitmap( bmp );
|
||||
hDC = psurf->hDC;
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
}
|
||||
return hDC;
|
||||
}
|
||||
|
@ -912,7 +878,7 @@ NtGdiSelectBitmap(
|
|||
PDC pDC;
|
||||
PDC_ATTR pDc_Attr;
|
||||
HBITMAP hOrgBmp;
|
||||
PBITMAPOBJ pBmp;
|
||||
PSURFACE psurfBmp;
|
||||
HRGN hVisRgn;
|
||||
BOOLEAN bFailed;
|
||||
PGDIBRUSHOBJ pBrush;
|
||||
|
@ -935,8 +901,8 @@ NtGdiSelectBitmap(
|
|||
return NULL;
|
||||
}
|
||||
|
||||
pBmp = BITMAPOBJ_LockBitmap(hBmp);
|
||||
if (!pBmp)
|
||||
psurfBmp = SURFACE_LockSurface(hBmp);
|
||||
if (!psurfBmp)
|
||||
{
|
||||
DC_UnlockDc(pDC);
|
||||
return NULL;
|
||||
|
@ -947,21 +913,21 @@ NtGdiSelectBitmap(
|
|||
pDC->w.hBitmap = hBmp;
|
||||
|
||||
// If Info DC this is zero and pSurface is moved to DC->pSurfInfo.
|
||||
pDC->DcLevel.pSurface = pBmp;
|
||||
pBmp->hDC = hDC;
|
||||
pDC->DcLevel.pSurface = psurfBmp;
|
||||
psurfBmp->hDC = hDC;
|
||||
|
||||
// if we're working with a DIB, get the palette [fixme: only create if the selected palette is null]
|
||||
if(pBmp->dib)
|
||||
if(psurfBmp->dib)
|
||||
{
|
||||
pDC->w.bitsPerPixel = pBmp->dib->dsBmih.biBitCount;
|
||||
pDC->w.bitsPerPixel = psurfBmp->dib->dsBmih.biBitCount;
|
||||
}
|
||||
else
|
||||
{
|
||||
pDC->w.bitsPerPixel = BitsPerFormat(pBmp->SurfObj.iBitmapFormat);
|
||||
pDC->w.bitsPerPixel = BitsPerFormat(psurfBmp->SurfObj.iBitmapFormat);
|
||||
}
|
||||
|
||||
hVisRgn = NtGdiCreateRectRgn(0, 0, pBmp->SurfObj.sizlBitmap.cx, pBmp->SurfObj.sizlBitmap.cy);
|
||||
BITMAPOBJ_UnlockBitmap(pBmp);
|
||||
hVisRgn = NtGdiCreateRectRgn(0, 0, psurfBmp->SurfObj.sizlBitmap.cx, psurfBmp->SurfObj.sizlBitmap.cy);
|
||||
SURFACE_UnlockSurface(psurfBmp);
|
||||
|
||||
/* Regenerate the XLATEOBJs. */
|
||||
pBrush = BRUSHOBJ_LockBrush(pDc_Attr->hbrush);
|
||||
|
|
|
@ -119,14 +119,14 @@ XLATEOBJ* FASTCALL
|
|||
IntGdiCreateBrushXlate(PDC Dc, GDIBRUSHOBJ *BrushObj, BOOLEAN *Failed)
|
||||
{
|
||||
XLATEOBJ *Result = NULL;
|
||||
BITMAPOBJ * pSurface;
|
||||
SURFACE * psurf;
|
||||
HPALETTE hPalette = NULL;
|
||||
|
||||
pSurface = BITMAPOBJ_LockBitmap(Dc->w.hBitmap);
|
||||
if (pSurface)
|
||||
psurf = SURFACE_LockSurface(Dc->w.hBitmap);
|
||||
if (psurf)
|
||||
{
|
||||
hPalette = pSurface->hDIBPalette;
|
||||
BITMAPOBJ_UnlockBitmap(pSurface);
|
||||
hPalette = psurf->hDIBPalette;
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
}
|
||||
if (!hPalette) hPalette = pPrimarySurface->DevInfo.hpalDefault;
|
||||
|
||||
|
@ -142,7 +142,7 @@ IntGdiCreateBrushXlate(PDC Dc, GDIBRUSHOBJ *BrushObj, BOOLEAN *Failed)
|
|||
}
|
||||
else
|
||||
{
|
||||
BITMAPOBJ *Pattern = BITMAPOBJ_LockBitmap(BrushObj->hbmPattern);
|
||||
SURFACE *Pattern = SURFACE_LockSurface(BrushObj->hbmPattern);
|
||||
if (Pattern == NULL)
|
||||
return NULL;
|
||||
|
||||
|
@ -160,7 +160,7 @@ IntGdiCreateBrushXlate(PDC Dc, GDIBRUSHOBJ *BrushObj, BOOLEAN *Failed)
|
|||
Result = IntEngCreateXlate(0, 0, hPalette, Pattern->hDIBPalette);
|
||||
}
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(Pattern);
|
||||
SURFACE_UnlockSurface(Pattern);
|
||||
*Failed = FALSE;
|
||||
}
|
||||
|
||||
|
@ -330,7 +330,7 @@ IntGdiCreateDIBBrush(
|
|||
HBITMAP hPattern;
|
||||
ULONG_PTR DataPtr;
|
||||
UINT PaletteEntryCount;
|
||||
PBITMAPOBJ BitmapObject;
|
||||
PSURFACE psurfPattern;
|
||||
INT PaletteType;
|
||||
|
||||
if (BitmapInfo->bmiHeader.biSize < sizeof(BITMAPINFOHEADER))
|
||||
|
@ -363,10 +363,10 @@ IntGdiCreateDIBBrush(
|
|||
return NULL;
|
||||
}
|
||||
|
||||
BitmapObject = BITMAPOBJ_LockBitmap(hPattern);
|
||||
ASSERT(BitmapObject != NULL);
|
||||
BitmapObject->hDIBPalette = BuildDIBPalette(BitmapInfo, &PaletteType);
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObject);
|
||||
psurfPattern = SURFACE_LockSurface(hPattern);
|
||||
ASSERT(psurfPattern != NULL);
|
||||
psurfPattern->hDIBPalette = BuildDIBPalette(BitmapInfo, &PaletteType);
|
||||
SURFACE_UnlockSurface(psurfPattern);
|
||||
|
||||
BrushObject = BRUSHOBJ_AllocBrushWithHandle();
|
||||
if (BrushObject == NULL)
|
||||
|
@ -437,7 +437,7 @@ IntGdiCreatePatternBrush(
|
|||
PGDIBRUSHOBJ BrushObject;
|
||||
HBITMAP hPattern;
|
||||
|
||||
hPattern = BITMAPOBJ_CopyBitmap(hBitmap);
|
||||
hPattern = SURFACE_CopyBitmap(hBitmap);
|
||||
if (hPattern == NULL)
|
||||
{
|
||||
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
|
||||
|
|
|
@ -73,7 +73,7 @@ UINT APIENTRY
|
|||
IntSetDIBColorTable(HDC hDC, UINT StartIndex, UINT Entries, CONST RGBQUAD *Colors)
|
||||
{
|
||||
PDC dc;
|
||||
PBITMAPOBJ BitmapObj;
|
||||
PSURFACE psurf;
|
||||
PPALGDI PalGDI;
|
||||
UINT Index;
|
||||
|
||||
|
@ -84,32 +84,32 @@ IntSetDIBColorTable(HDC hDC, UINT StartIndex, UINT Entries, CONST RGBQUAD *Color
|
|||
return 0;
|
||||
}
|
||||
|
||||
BitmapObj = BITMAPOBJ_LockBitmap(dc->w.hBitmap);
|
||||
if (BitmapObj == NULL)
|
||||
psurf = SURFACE_LockSurface(dc->w.hBitmap);
|
||||
if (psurf == NULL)
|
||||
{
|
||||
DC_UnlockDc(dc);
|
||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (BitmapObj->dib == NULL)
|
||||
if (psurf->dib == NULL)
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
DC_UnlockDc(dc);
|
||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (BitmapObj->dib->dsBmih.biBitCount <= 8 &&
|
||||
StartIndex < (1 << BitmapObj->dib->dsBmih.biBitCount))
|
||||
if (psurf->dib->dsBmih.biBitCount <= 8 &&
|
||||
StartIndex < (1 << psurf->dib->dsBmih.biBitCount))
|
||||
{
|
||||
if (StartIndex + Entries > (1 << BitmapObj->dib->dsBmih.biBitCount))
|
||||
Entries = (1 << BitmapObj->dib->dsBmih.biBitCount) - StartIndex;
|
||||
if (StartIndex + Entries > (1 << psurf->dib->dsBmih.biBitCount))
|
||||
Entries = (1 << psurf->dib->dsBmih.biBitCount) - StartIndex;
|
||||
|
||||
PalGDI = PALETTE_LockPalette(BitmapObj->hDIBPalette);
|
||||
PalGDI = PALETTE_LockPalette(psurf->hDIBPalette);
|
||||
if (PalGDI == NULL)
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
DC_UnlockDc(dc);
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return 0;
|
||||
|
@ -128,7 +128,7 @@ IntSetDIBColorTable(HDC hDC, UINT StartIndex, UINT Entries, CONST RGBQUAD *Color
|
|||
else
|
||||
Entries = 0;
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
return Entries;
|
||||
|
@ -138,7 +138,7 @@ UINT APIENTRY
|
|||
IntGetDIBColorTable(HDC hDC, UINT StartIndex, UINT Entries, RGBQUAD *Colors)
|
||||
{
|
||||
PDC dc;
|
||||
PBITMAPOBJ BitmapObj;
|
||||
PSURFACE psurf;
|
||||
PPALGDI PalGDI;
|
||||
UINT Index;
|
||||
|
||||
|
@ -149,32 +149,32 @@ IntGetDIBColorTable(HDC hDC, UINT StartIndex, UINT Entries, RGBQUAD *Colors)
|
|||
return 0;
|
||||
}
|
||||
|
||||
BitmapObj = BITMAPOBJ_LockBitmap(dc->w.hBitmap);
|
||||
if (BitmapObj == NULL)
|
||||
psurf = SURFACE_LockSurface(dc->w.hBitmap);
|
||||
if (psurf == NULL)
|
||||
{
|
||||
DC_UnlockDc(dc);
|
||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (BitmapObj->dib == NULL)
|
||||
if (psurf->dib == NULL)
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
DC_UnlockDc(dc);
|
||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (BitmapObj->dib->dsBmih.biBitCount <= 8 &&
|
||||
StartIndex < (1 << BitmapObj->dib->dsBmih.biBitCount))
|
||||
if (psurf->dib->dsBmih.biBitCount <= 8 &&
|
||||
StartIndex < (1 << psurf->dib->dsBmih.biBitCount))
|
||||
{
|
||||
if (StartIndex + Entries > (1 << BitmapObj->dib->dsBmih.biBitCount))
|
||||
Entries = (1 << BitmapObj->dib->dsBmih.biBitCount) - StartIndex;
|
||||
if (StartIndex + Entries > (1 << psurf->dib->dsBmih.biBitCount))
|
||||
Entries = (1 << psurf->dib->dsBmih.biBitCount) - StartIndex;
|
||||
|
||||
PalGDI = PALETTE_LockPalette(BitmapObj->hDIBPalette);
|
||||
PalGDI = PALETTE_LockPalette(psurf->hDIBPalette);
|
||||
if (PalGDI == NULL)
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
DC_UnlockDc(dc);
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return 0;
|
||||
|
@ -194,7 +194,7 @@ IntGetDIBColorTable(HDC hDC, UINT StartIndex, UINT Entries, RGBQUAD *Colors)
|
|||
else
|
||||
Entries = 0;
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
return Entries;
|
||||
|
@ -211,7 +211,7 @@ IntSetDIBits(
|
|||
CONST BITMAPINFO *bmi,
|
||||
UINT ColorUse)
|
||||
{
|
||||
BITMAPOBJ *bitmap;
|
||||
SURFACE *bitmap;
|
||||
HBITMAP SourceBitmap;
|
||||
INT result = 0;
|
||||
BOOL copyBitsResult;
|
||||
|
@ -227,7 +227,7 @@ IntSetDIBits(
|
|||
INT DIBWidth;
|
||||
|
||||
// Check parameters
|
||||
if (!(bitmap = BITMAPOBJ_LockBitmap(hBitmap)))
|
||||
if (!(bitmap = SURFACE_LockSurface(hBitmap)))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -254,7 +254,7 @@ IntSetDIBits(
|
|||
(PVOID) Bits);
|
||||
if (0 == SourceBitmap)
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmap(bitmap);
|
||||
SURFACE_UnlockSurface(bitmap);
|
||||
SetLastWin32Error(ERROR_NO_SYSTEM_RESOURCES);
|
||||
return 0;
|
||||
}
|
||||
|
@ -263,7 +263,7 @@ IntSetDIBits(
|
|||
if (NULL == SourceSurf)
|
||||
{
|
||||
EngDeleteSurface((HSURF)SourceBitmap);
|
||||
BITMAPOBJ_UnlockBitmap(bitmap);
|
||||
SURFACE_UnlockSurface(bitmap);
|
||||
SetLastWin32Error(ERROR_NO_SYSTEM_RESOURCES);
|
||||
return 0;
|
||||
}
|
||||
|
@ -274,7 +274,7 @@ IntSetDIBits(
|
|||
{
|
||||
EngUnlockSurface(SourceSurf);
|
||||
EngDeleteSurface((HSURF)SourceBitmap);
|
||||
BITMAPOBJ_UnlockBitmap(bitmap);
|
||||
SURFACE_UnlockSurface(bitmap);
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return 0;
|
||||
}
|
||||
|
@ -288,7 +288,7 @@ IntSetDIBits(
|
|||
{
|
||||
EngUnlockSurface(SourceSurf);
|
||||
EngDeleteSurface((HSURF)SourceBitmap);
|
||||
BITMAPOBJ_UnlockBitmap(bitmap);
|
||||
SURFACE_UnlockSurface(bitmap);
|
||||
SetLastWin32Error(ERROR_NO_SYSTEM_RESOURCES);
|
||||
return 0;
|
||||
}
|
||||
|
@ -300,7 +300,7 @@ IntSetDIBits(
|
|||
PALETTE_FreePaletteByHandle(DIB_Palette);
|
||||
EngUnlockSurface(SourceSurf);
|
||||
EngDeleteSurface((HSURF)SourceBitmap);
|
||||
BITMAPOBJ_UnlockBitmap(bitmap);
|
||||
SURFACE_UnlockSurface(bitmap);
|
||||
SetLastWin32Error(ERROR_NO_SYSTEM_RESOURCES);
|
||||
return 0;
|
||||
}
|
||||
|
@ -334,7 +334,7 @@ IntSetDIBits(
|
|||
// if (ColorUse == DIB_PAL_COLORS)
|
||||
// WinFree((LPSTR)lpRGB);
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(bitmap);
|
||||
SURFACE_UnlockSurface(bitmap);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -583,7 +583,7 @@ NtGdiGetDIBitsInternal(HDC hDC,
|
|||
UINT MaxInfo)
|
||||
{
|
||||
PDC Dc;
|
||||
BITMAPOBJ *BitmapObj = NULL;
|
||||
SURFACE *psurf = NULL;
|
||||
HBITMAP hDestBitmap = NULL;
|
||||
HPALETTE hSourcePalette = NULL;
|
||||
HPALETTE hDestPalette = NULL;
|
||||
|
@ -632,11 +632,11 @@ NtGdiGetDIBitsInternal(HDC hDC,
|
|||
DC_UnlockDc(Dc);
|
||||
|
||||
/* Get a pointer to the source bitmap object */
|
||||
BitmapObj = BITMAPOBJ_LockBitmap(hBitmap);
|
||||
if (BitmapObj == NULL)
|
||||
psurf = SURFACE_LockSurface(hBitmap);
|
||||
if (psurf == NULL)
|
||||
return 0;
|
||||
|
||||
hSourcePalette = BitmapObj->hDIBPalette;
|
||||
hSourcePalette = psurf->hDIBPalette;
|
||||
if (!hSourcePalette)
|
||||
{
|
||||
hSourcePalette = pPrimarySurface->DevInfo.hpalDefault;
|
||||
|
@ -653,25 +653,25 @@ NtGdiGetDIBitsInternal(HDC hDC,
|
|||
BITMAPCOREHEADER* coreheader = (BITMAPCOREHEADER*) Info;
|
||||
|
||||
coreheader = (BITMAPCOREHEADER*) Info;
|
||||
coreheader->bcWidth = BitmapObj->SurfObj.sizlBitmap.cx;
|
||||
coreheader->bcWidth = psurf->SurfObj.sizlBitmap.cx;
|
||||
coreheader->bcPlanes = 1;
|
||||
coreheader->bcBitCount = BitsPerFormat(BitmapObj->SurfObj.iBitmapFormat);
|
||||
coreheader->bcBitCount = BitsPerFormat(psurf->SurfObj.iBitmapFormat);
|
||||
/* Resulting height may be smaller than original height */
|
||||
coreheader->bcHeight = BitmapObj->SurfObj.sizlBitmap.cy;
|
||||
coreheader->bcHeight = psurf->SurfObj.sizlBitmap.cy;
|
||||
coreheader->bcSize = DIB_GetDIBWidthBytes(coreheader->bcWidth,
|
||||
coreheader->bcBitCount) * coreheader->bcHeight;
|
||||
if (BitmapObj->SurfObj.lDelta > 0)
|
||||
if (psurf->SurfObj.lDelta > 0)
|
||||
coreheader->bcHeight = -coreheader->bcHeight;
|
||||
}
|
||||
|
||||
if (Info->bmiHeader.biSize >= sizeof(BITMAPINFOHEADER))
|
||||
{
|
||||
Info->bmiHeader.biWidth = BitmapObj->SurfObj.sizlBitmap.cx;
|
||||
Info->bmiHeader.biWidth = psurf->SurfObj.sizlBitmap.cx;
|
||||
/* Resulting height may be smaller than original height */
|
||||
Info->bmiHeader.biHeight = BitmapObj->SurfObj.sizlBitmap.cy;
|
||||
Info->bmiHeader.biHeight = psurf->SurfObj.sizlBitmap.cy;
|
||||
Info->bmiHeader.biPlanes = 1;
|
||||
Info->bmiHeader.biBitCount = BitsPerFormat(BitmapObj->SurfObj.iBitmapFormat);
|
||||
switch (BitmapObj->SurfObj.iBitmapFormat)
|
||||
Info->bmiHeader.biBitCount = BitsPerFormat(psurf->SurfObj.iBitmapFormat);
|
||||
switch (psurf->SurfObj.iBitmapFormat)
|
||||
{
|
||||
case BMF_1BPP:
|
||||
case BMF_4BPP:
|
||||
|
@ -702,10 +702,10 @@ NtGdiGetDIBitsInternal(HDC hDC,
|
|||
Info->bmiHeader.biClrUsed = 0;
|
||||
Info->bmiHeader.biClrImportant = 1 << Info->bmiHeader.biBitCount; /* FIXME */
|
||||
/* Report negtive height for top-down bitmaps. */
|
||||
if (BitmapObj->SurfObj.lDelta > 0)
|
||||
if (psurf->SurfObj.lDelta > 0)
|
||||
Info->bmiHeader.biHeight = -Info->bmiHeader.biHeight;
|
||||
}
|
||||
Result = BitmapObj->SurfObj.sizlBitmap.cy;
|
||||
Result = psurf->SurfObj.sizlBitmap.cy;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -715,7 +715,7 @@ NtGdiGetDIBitsInternal(HDC hDC,
|
|||
POINTL SourcePoint;
|
||||
ULONG Index;
|
||||
|
||||
if (Info->bmiHeader.biBitCount == BitsPerFormat(BitmapObj->SurfObj.iBitmapFormat))
|
||||
if (Info->bmiHeader.biBitCount == BitsPerFormat(psurf->SurfObj.iBitmapFormat))
|
||||
{
|
||||
hDestPalette = hSourcePalette;
|
||||
bPaletteMatch = TRUE;
|
||||
|
@ -750,7 +750,7 @@ NtGdiGetDIBitsInternal(HDC hDC,
|
|||
case 4:
|
||||
case 8:
|
||||
Info->bmiHeader.biClrUsed = 0;
|
||||
if ( BitmapObj->dib && BitmapObj->dib->dsBm.bmBitsPixel == Info->bmiHeader.biBitCount)
|
||||
if ( psurf->dib && psurf->dib->dsBm.bmBitsPixel == Info->bmiHeader.biBitCount)
|
||||
{
|
||||
if (Usage == DIB_RGB_COLORS)
|
||||
{
|
||||
|
@ -873,14 +873,14 @@ NtGdiGetDIBitsInternal(HDC hDC,
|
|||
// If we have a good dib pointer, why not just copy bits from there w/o XLATE'ing them.
|
||||
//
|
||||
/* Create the destination bitmap too for the copy operation */
|
||||
if (StartScan > BitmapObj->SurfObj.sizlBitmap.cy)
|
||||
if (StartScan > psurf->SurfObj.sizlBitmap.cy)
|
||||
{
|
||||
goto cleanup;
|
||||
}
|
||||
else
|
||||
{
|
||||
ScanLines = min(ScanLines, BitmapObj->SurfObj.sizlBitmap.cy - StartScan);
|
||||
DestSize.cx = BitmapObj->SurfObj.sizlBitmap.cx;
|
||||
ScanLines = min(ScanLines, psurf->SurfObj.sizlBitmap.cy - StartScan);
|
||||
DestSize.cx = psurf->SurfObj.sizlBitmap.cx;
|
||||
DestSize.cy = ScanLines;
|
||||
|
||||
hDestBitmap = NULL;
|
||||
|
@ -926,7 +926,7 @@ NtGdiGetDIBitsInternal(HDC hDC,
|
|||
hSourcePalette);
|
||||
|
||||
SourcePoint.x = 0;
|
||||
SourcePoint.y = BitmapObj->SurfObj.sizlBitmap.cy - (StartScan + ScanLines);
|
||||
SourcePoint.y = psurf->SurfObj.sizlBitmap.cy - (StartScan + ScanLines);
|
||||
|
||||
/* Determine destination rectangle */
|
||||
DestRect.top = 0;
|
||||
|
@ -937,7 +937,7 @@ NtGdiGetDIBitsInternal(HDC hDC,
|
|||
DestSurfObj = EngLockSurface((HSURF)hDestBitmap);
|
||||
|
||||
if (EngCopyBits( DestSurfObj,
|
||||
&BitmapObj->SurfObj,
|
||||
&psurf->SurfObj,
|
||||
NULL,
|
||||
XlateObj,
|
||||
&DestRect,
|
||||
|
@ -958,7 +958,7 @@ cleanup:
|
|||
if (hDestPalette != NULL && bPaletteMatch == FALSE)
|
||||
PALETTE_FreePaletteByHandle(hDestPalette);
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
|
||||
DPRINT("leaving NtGdiGetDIBitsInternal\n");
|
||||
|
||||
|
@ -1241,8 +1241,8 @@ NtGdiCreateDIBitmapInternal(IN HDC hDc,
|
|||
{
|
||||
DIBSECTION dibs;
|
||||
INT Count;
|
||||
BITMAPOBJ *BitmapObject = BITMAPOBJ_LockBitmap(Dc->w.hBitmap);
|
||||
Count = BITMAP_GetObject(BitmapObject, sizeof(dibs), &dibs);
|
||||
SURFACE *psurf = SURFACE_LockSurface(Dc->w.hBitmap);
|
||||
Count = BITMAP_GetObject(psurf, sizeof(dibs), &dibs);
|
||||
if (!Count)
|
||||
bpp = 1;
|
||||
else
|
||||
|
@ -1254,7 +1254,7 @@ NtGdiCreateDIBitmapInternal(IN HDC hDc,
|
|||
/* A DIB section is selected in the DC */
|
||||
bpp = dibs.dsBmih.biBitCount;
|
||||
}
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObject);
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
}
|
||||
}
|
||||
Bmp = IntCreateDIBitmap(Dc, cx, cy, bpp, fInit, pjInit, pbmi, iUsage);
|
||||
|
@ -1315,7 +1315,7 @@ DIB_CreateDIBSection(
|
|||
DWORD ovr_pitch)
|
||||
{
|
||||
HBITMAP res = 0;
|
||||
BITMAPOBJ *bmp = NULL;
|
||||
SURFACE *bmp = NULL;
|
||||
DIBSECTION *dib = NULL;
|
||||
void *mapBits = NULL;
|
||||
PDC_ATTR pDc_Attr;
|
||||
|
@ -1462,7 +1462,7 @@ DIB_CreateDIBSection(
|
|||
SetLastWin32Error(ERROR_NO_SYSTEM_RESOURCES);
|
||||
return NULL;
|
||||
}
|
||||
bmp = BITMAPOBJ_LockBitmap(res);
|
||||
bmp = SURFACE_LockSurface(res);
|
||||
if (NULL == bmp)
|
||||
{
|
||||
if (lpRGB != bmi->bmiColors)
|
||||
|
@ -1516,7 +1516,7 @@ DIB_CreateDIBSection(
|
|||
|
||||
if (dib) { ExFreePoolWithTag(dib, TAG_DIB); dib = NULL; }
|
||||
if (bmp) { bmp = NULL; }
|
||||
if (res) { BITMAPOBJ_FreeBitmapByHandle(res); res = 0; }
|
||||
if (res) { SURFACE_FreeSurfaceByHandle(res); res = 0; }
|
||||
}
|
||||
|
||||
if (lpRGB != bmi->bmiColors)
|
||||
|
@ -1526,7 +1526,7 @@ DIB_CreateDIBSection(
|
|||
|
||||
if (bmp)
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmap(bmp);
|
||||
SURFACE_UnlockSurface(bmp);
|
||||
}
|
||||
|
||||
// Return BITMAP handle and storage location
|
||||
|
|
|
@ -1191,7 +1191,7 @@ IntFillRect( DC *dc,
|
|||
{
|
||||
DWORD ROP = PATCOPY;
|
||||
RECTL DestRect;
|
||||
BITMAPOBJ *BitmapObj;
|
||||
SURFACE *psurf;
|
||||
GDIBRUSHINST BrushInst;
|
||||
POINTL BrushOrigin;
|
||||
BOOL Ret = TRUE;
|
||||
|
@ -1199,8 +1199,8 @@ IntFillRect( DC *dc,
|
|||
|
||||
ASSERT(BrushObj);
|
||||
|
||||
BitmapObj = BITMAPOBJ_LockBitmap(dc->w.hBitmap);
|
||||
if (BitmapObj == NULL)
|
||||
psurf = SURFACE_LockSurface(dc->w.hBitmap);
|
||||
if (psurf == NULL)
|
||||
{
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return 0;
|
||||
|
@ -1243,7 +1243,7 @@ IntFillRect( DC *dc,
|
|||
IntGdiInitBrushInstance(&BrushInst, BrushObj, dc->XlateBrush);
|
||||
|
||||
Ret = IntEngBitBlt(
|
||||
&BitmapObj->SurfObj,
|
||||
&psurf->SurfObj,
|
||||
NULL,
|
||||
NULL,
|
||||
dc->CombinedClip,
|
||||
|
@ -1256,7 +1256,7 @@ IntFillRect( DC *dc,
|
|||
ROP3_TO_ROP4(ROP));
|
||||
}
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
return (int)Ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
* a couple macros to fill a single pixel or a line
|
||||
*/
|
||||
#define PUTPIXEL(x,y,BrushInst) \
|
||||
ret = ret && IntEngLineTo(&BitmapObj->SurfObj, \
|
||||
ret = ret && IntEngLineTo(&psurf->SurfObj, \
|
||||
dc->CombinedClip, \
|
||||
&BrushInst.BrushObject, \
|
||||
x, y, (x)+1, y, \
|
||||
|
@ -34,7 +34,7 @@
|
|||
ROP2_TO_MIX(Dc_Attr->jROP2));
|
||||
|
||||
#define PUTLINE(x1,y1,x2,y2,BrushInst) \
|
||||
ret = ret && IntEngLineTo(&BitmapObj->SurfObj, \
|
||||
ret = ret && IntEngLineTo(&psurf->SurfObj, \
|
||||
dc->CombinedClip, \
|
||||
&BrushInst.BrushObject, \
|
||||
x1, y1, x2, y2, \
|
||||
|
@ -54,7 +54,7 @@ IntGdiPolygon(PDC dc,
|
|||
PPOINT Points,
|
||||
int Count)
|
||||
{
|
||||
BITMAPOBJ *BitmapObj;
|
||||
SURFACE *psurf;
|
||||
PGDIBRUSHOBJ PenBrushObj, FillBrushObj;
|
||||
GDIBRUSHINST PenBrushInst, FillBrushInst;
|
||||
BOOL ret = FALSE; // default to failure
|
||||
|
@ -104,15 +104,15 @@ IntGdiPolygon(PDC dc,
|
|||
/* Special locking order to avoid lock-ups */
|
||||
FillBrushObj = BRUSHOBJ_LockBrush(Dc_Attr->hbrush);
|
||||
PenBrushObj = PENOBJ_LockPen(Dc_Attr->hpen);
|
||||
BitmapObj = BITMAPOBJ_LockBitmap(dc->w.hBitmap);
|
||||
/* FIXME - BitmapObj can be NULL!!!! don't assert but handle this case gracefully! */
|
||||
ASSERT(BitmapObj);
|
||||
psurf = SURFACE_LockSurface(dc->w.hBitmap);
|
||||
/* FIXME - psurf can be NULL!!!! don't assert but handle this case gracefully! */
|
||||
ASSERT(psurf);
|
||||
|
||||
/* Now fill the polygon with the current brush. */
|
||||
if (FillBrushObj && !(FillBrushObj->flAttrs & GDIBRUSH_IS_NULL))
|
||||
{
|
||||
IntGdiInitBrushInstance(&FillBrushInst, FillBrushObj, dc->XlateBrush);
|
||||
ret = FillPolygon ( dc, BitmapObj, &FillBrushInst.BrushObject, ROP2_TO_MIX(Dc_Attr->jROP2), Points, Count, DestRect );
|
||||
ret = FillPolygon ( dc, psurf, &FillBrushInst.BrushObject, ROP2_TO_MIX(Dc_Attr->jROP2), Points, Count, DestRect );
|
||||
}
|
||||
if (FillBrushObj)
|
||||
BRUSHOBJ_UnlockBrush(FillBrushObj);
|
||||
|
@ -131,7 +131,7 @@ IntGdiPolygon(PDC dc,
|
|||
// Points[0].x, Points[0].y,
|
||||
// Points[1].x, Points[1].y );
|
||||
|
||||
ret = IntEngLineTo(&BitmapObj->SurfObj,
|
||||
ret = IntEngLineTo(&psurf->SurfObj,
|
||||
dc->CombinedClip,
|
||||
&PenBrushInst.BrushObject,
|
||||
Points[i].x, /* From */
|
||||
|
@ -145,7 +145,7 @@ IntGdiPolygon(PDC dc,
|
|||
/* Close the polygon */
|
||||
if (ret)
|
||||
{
|
||||
ret = IntEngLineTo(&BitmapObj->SurfObj,
|
||||
ret = IntEngLineTo(&psurf->SurfObj,
|
||||
dc->CombinedClip,
|
||||
&PenBrushInst.BrushObject,
|
||||
Points[Count-1].x, /* From */
|
||||
|
@ -159,7 +159,7 @@ IntGdiPolygon(PDC dc,
|
|||
if (PenBrushObj)
|
||||
PENOBJ_UnlockPen(PenBrushObj);
|
||||
}
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -505,7 +505,7 @@ IntRectangle(PDC dc,
|
|||
int RightRect,
|
||||
int BottomRect)
|
||||
{
|
||||
BITMAPOBJ *BitmapObj = NULL;
|
||||
SURFACE *psurf = NULL;
|
||||
PGDIBRUSHOBJ PenBrushObj = NULL, FillBrushObj = NULL;
|
||||
GDIBRUSHINST PenBrushInst, FillBrushInst;
|
||||
BOOL ret = FALSE; // default to failure
|
||||
|
@ -570,8 +570,8 @@ IntRectangle(PDC dc,
|
|||
ret = FALSE;
|
||||
goto cleanup;
|
||||
}
|
||||
BitmapObj = BITMAPOBJ_LockBitmap(dc->w.hBitmap);
|
||||
if (!BitmapObj)
|
||||
psurf = SURFACE_LockSurface(dc->w.hBitmap);
|
||||
if (!psurf)
|
||||
{
|
||||
ret = FALSE;
|
||||
goto cleanup;
|
||||
|
@ -582,7 +582,7 @@ IntRectangle(PDC dc,
|
|||
if (!(FillBrushObj->flAttrs & GDIBRUSH_IS_NULL))
|
||||
{
|
||||
IntGdiInitBrushInstance(&FillBrushInst, FillBrushObj, dc->XlateBrush);
|
||||
ret = IntEngBitBlt(&BitmapObj->SurfObj,
|
||||
ret = IntEngBitBlt(&psurf->SurfObj,
|
||||
NULL,
|
||||
NULL,
|
||||
dc->CombinedClip,
|
||||
|
@ -605,28 +605,28 @@ IntRectangle(PDC dc,
|
|||
if (!(PenBrushObj->flAttrs & GDIBRUSH_IS_NULL))
|
||||
{
|
||||
Mix = ROP2_TO_MIX(Dc_Attr->jROP2);
|
||||
ret = ret && IntEngLineTo(&BitmapObj->SurfObj,
|
||||
ret = ret && IntEngLineTo(&psurf->SurfObj,
|
||||
dc->CombinedClip,
|
||||
&PenBrushInst.BrushObject,
|
||||
DestRect.left, DestRect.top, DestRect.right, DestRect.top,
|
||||
&DestRect, // Bounding rectangle
|
||||
Mix);
|
||||
|
||||
ret = ret && IntEngLineTo(&BitmapObj->SurfObj,
|
||||
ret = ret && IntEngLineTo(&psurf->SurfObj,
|
||||
dc->CombinedClip,
|
||||
&PenBrushInst.BrushObject,
|
||||
DestRect.right, DestRect.top, DestRect.right, DestRect.bottom,
|
||||
&DestRect, // Bounding rectangle
|
||||
Mix);
|
||||
|
||||
ret = ret && IntEngLineTo(&BitmapObj->SurfObj,
|
||||
ret = ret && IntEngLineTo(&psurf->SurfObj,
|
||||
dc->CombinedClip,
|
||||
&PenBrushInst.BrushObject,
|
||||
DestRect.right, DestRect.bottom, DestRect.left, DestRect.bottom,
|
||||
&DestRect, // Bounding rectangle
|
||||
Mix);
|
||||
|
||||
ret = ret && IntEngLineTo(&BitmapObj->SurfObj,
|
||||
ret = ret && IntEngLineTo(&psurf->SurfObj,
|
||||
dc->CombinedClip,
|
||||
&PenBrushInst.BrushObject,
|
||||
DestRect.left, DestRect.bottom, DestRect.left, DestRect.top,
|
||||
|
@ -641,8 +641,8 @@ cleanup:
|
|||
if (PenBrushObj)
|
||||
PENOBJ_UnlockPen(PenBrushObj);
|
||||
|
||||
if (BitmapObj)
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
if (psurf)
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
|
||||
/* Move current position in DC?
|
||||
MSDN: The current position is neither used nor updated by Rectangle. */
|
||||
|
@ -829,7 +829,7 @@ IntGdiGradientFill(
|
|||
ULONG uMesh,
|
||||
ULONG ulMode)
|
||||
{
|
||||
BITMAPOBJ *BitmapObj;
|
||||
SURFACE *psurf;
|
||||
PPALGDI PalDestGDI;
|
||||
XLATEOBJ *XlateObj;
|
||||
RECTL Extent;
|
||||
|
@ -891,11 +891,11 @@ IntGdiGradientFill(
|
|||
Extent.top += DitherOrg.y;
|
||||
Extent.bottom += DitherOrg.y;
|
||||
|
||||
BitmapObj = BITMAPOBJ_LockBitmap(dc->w.hBitmap);
|
||||
/* FIXME - BitmapObj can be NULL!!! Don't assert but handle this case gracefully! */
|
||||
ASSERT(BitmapObj);
|
||||
psurf = SURFACE_LockSurface(dc->w.hBitmap);
|
||||
/* FIXME - psurf can be NULL!!! Don't assert but handle this case gracefully! */
|
||||
ASSERT(psurf);
|
||||
|
||||
hDestPalette = BitmapObj->hDIBPalette;
|
||||
hDestPalette = psurf->hDIBPalette;
|
||||
if (!hDestPalette) hDestPalette = pPrimarySurface->DevInfo.hpalDefault;
|
||||
|
||||
PalDestGDI = PALETTE_LockPalette(hDestPalette);
|
||||
|
@ -910,7 +910,7 @@ IntGdiGradientFill(
|
|||
XlateObj = (XLATEOBJ*)IntEngCreateXlate(Mode, PAL_RGB, hDestPalette, NULL);
|
||||
ASSERT(XlateObj);
|
||||
|
||||
Ret = IntEngGradientFill(&BitmapObj->SurfObj,
|
||||
Ret = IntEngGradientFill(&psurf->SurfObj,
|
||||
dc->CombinedClip,
|
||||
XlateObj,
|
||||
pVertex,
|
||||
|
@ -921,7 +921,7 @@ IntGdiGradientFill(
|
|||
&DitherOrg,
|
||||
ulMode);
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
EngDeleteXlate(XlateObj);
|
||||
|
||||
return Ret;
|
||||
|
@ -1050,7 +1050,7 @@ NtGdiExtFloodFill(
|
|||
{
|
||||
PDC dc;
|
||||
PDC_ATTR Dc_Attr;
|
||||
BITMAPOBJ *BitmapObj = NULL;
|
||||
SURFACE *psurf = NULL;
|
||||
PGDIBRUSHOBJ FillBrushObj = NULL;
|
||||
GDIBRUSHINST FillBrushInst;
|
||||
BOOL Ret = FALSE;
|
||||
|
@ -1098,8 +1098,8 @@ NtGdiExtFloodFill(
|
|||
Ret = FALSE;
|
||||
goto cleanup;
|
||||
}
|
||||
BitmapObj = BITMAPOBJ_LockBitmap(dc->w.hBitmap);
|
||||
if (!BitmapObj)
|
||||
psurf = SURFACE_LockSurface(dc->w.hBitmap);
|
||||
if (!psurf)
|
||||
{
|
||||
Ret = FALSE;
|
||||
goto cleanup;
|
||||
|
@ -1111,7 +1111,7 @@ NtGdiExtFloodFill(
|
|||
{
|
||||
FillBrushObj->BrushAttr.lbColor = Color;
|
||||
IntGdiInitBrushInstance(&FillBrushInst, FillBrushObj, dc->XlateBrush);
|
||||
Ret = IntEngBitBlt(&BitmapObj->SurfObj,
|
||||
Ret = IntEngBitBlt(&psurf->SurfObj,
|
||||
NULL,
|
||||
NULL,
|
||||
dc->CombinedClip,
|
||||
|
@ -1132,8 +1132,8 @@ cleanup:
|
|||
if (FillBrushObj)
|
||||
BRUSHOBJ_UnlockBrush(FillBrushObj);
|
||||
|
||||
if (BitmapObj)
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
if (psurf)
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
|
||||
DC_UnlockDc(dc);
|
||||
return Ret;
|
||||
|
|
|
@ -3099,7 +3099,7 @@ GreExtTextOutW(
|
|||
DC *dc;
|
||||
PDC_ATTR Dc_Attr;
|
||||
SURFOBJ *SurfObj;
|
||||
BITMAPOBJ *BitmapObj = NULL;
|
||||
SURFACE *psurf = NULL;
|
||||
int error, glyph_index, n, i;
|
||||
FT_Face face;
|
||||
FT_GlyphSlot glyph;
|
||||
|
@ -3179,12 +3179,12 @@ GreExtTextOutW(
|
|||
IntLPtoDP(dc, (POINT *)lprc, 2);
|
||||
}
|
||||
|
||||
BitmapObj = BITMAPOBJ_LockBitmap(dc->w.hBitmap);
|
||||
if ( !BitmapObj )
|
||||
psurf = SURFACE_LockSurface(dc->w.hBitmap);
|
||||
if (!psurf)
|
||||
{
|
||||
goto fail;
|
||||
}
|
||||
SurfObj = &BitmapObj->SurfObj;
|
||||
SurfObj = &psurf->SurfObj;
|
||||
ASSERT(SurfObj);
|
||||
|
||||
Start.x = XStart;
|
||||
|
@ -3195,7 +3195,7 @@ GreExtTextOutW(
|
|||
YStart = Start.y + dc->ptlDCOrig.y;
|
||||
|
||||
/* Create the brushes */
|
||||
hDestPalette = BitmapObj->hDIBPalette;
|
||||
hDestPalette = psurf->hDIBPalette;
|
||||
if (!hDestPalette) hDestPalette = pPrimarySurface->DevInfo.hpalDefault;
|
||||
PalDestGDI = PALETTE_LockPalette(hDestPalette);
|
||||
if ( !PalDestGDI )
|
||||
|
@ -3256,7 +3256,7 @@ GreExtTextOutW(
|
|||
DestRect.bottom = lprc->bottom + dc->ptlDCOrig.y;
|
||||
IntLPtoDP(dc, (LPPOINT)&DestRect, 2);
|
||||
IntEngBitBlt(
|
||||
&BitmapObj->SurfObj,
|
||||
&psurf->SurfObj,
|
||||
NULL,
|
||||
NULL,
|
||||
dc->CombinedClip,
|
||||
|
@ -3502,7 +3502,7 @@ GreExtTextOutW(
|
|||
DestRect.top = TextTop + yoff - ((face->size->metrics.ascender + 32) >> 6);
|
||||
DestRect.bottom = TextTop + yoff + ((32 - face->size->metrics.descender) >> 6);
|
||||
IntEngBitBlt(
|
||||
&BitmapObj->SurfObj,
|
||||
&psurf->SurfObj,
|
||||
NULL,
|
||||
NULL,
|
||||
dc->CombinedClip,
|
||||
|
@ -3618,7 +3618,7 @@ GreExtTextOutW(
|
|||
|
||||
EngDeleteXlate(XlateObj);
|
||||
EngDeleteXlate(XlateObj2);
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
if (TextObj != NULL)
|
||||
TEXTOBJ_UnlockText(TextObj);
|
||||
if (hBrushBg != NULL)
|
||||
|
@ -3640,8 +3640,8 @@ fail:
|
|||
EngDeleteXlate(XlateObj);
|
||||
if (TextObj != NULL)
|
||||
TEXTOBJ_UnlockText(TextObj);
|
||||
if (BitmapObj != NULL)
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
if (psurf != NULL)
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
if (hBrushBg != NULL)
|
||||
{
|
||||
BRUSHOBJ_UnlockBrush(BrushBg);
|
||||
|
|
|
@ -47,7 +47,7 @@ OBJ_TYPE_INFO ObjTypeInfo[BASE_OBJTYPE_COUNT] =
|
|||
{1, 0, 0, NULL}, /* 02 UNUSED1 */
|
||||
{1, 0, 0, NULL}, /* 03 UNUSED2 */
|
||||
{1, sizeof(ROSRGNDATA), TAG_REGION, REGION_Cleanup}, /* 04 RGN */
|
||||
{1, sizeof(BITMAPOBJ), TAG_SURFACE, BITMAP_Cleanup}, /* 05 SURFACE */
|
||||
{1, sizeof(SURFACE), TAG_SURFACE, SURFACE_Cleanup}, /* 05 SURFACE */
|
||||
{1, sizeof(CLIENTOBJ), TAG_CLIENTOBJ, GDI_CleanupDummy}, /* 06 CLIENTOBJ: METADC,... */
|
||||
{1, sizeof(PATH), TAG_PATH, GDI_CleanupDummy}, /* 07 PATH */
|
||||
{1, sizeof(PALGDI), TAG_PALETTE, PALETTE_Cleanup}, /* 08 PAL */
|
||||
|
@ -1655,7 +1655,7 @@ IntGdiGetObject(IN HANDLE Handle,
|
|||
break;
|
||||
|
||||
case GDI_OBJECT_TYPE_BITMAP:
|
||||
Result = BITMAP_GetObject((BITMAPOBJ *) pGdiObject, cbCount, lpBuffer);
|
||||
Result = BITMAP_GetObject((SURFACE *) pGdiObject, cbCount, lpBuffer);
|
||||
break;
|
||||
case GDI_OBJECT_TYPE_FONT:
|
||||
Result = FontGetObject((PTEXTOBJ) pGdiObject, cbCount, lpBuffer);
|
||||
|
|
|
@ -89,7 +89,7 @@ IntGdiLineTo(DC *dc,
|
|||
int XEnd,
|
||||
int YEnd)
|
||||
{
|
||||
BITMAPOBJ *BitmapObj;
|
||||
SURFACE *psurf;
|
||||
BOOL Ret = TRUE;
|
||||
PGDIBRUSHOBJ PenBrushObj;
|
||||
GDIBRUSHINST PenBrushInst;
|
||||
|
@ -121,8 +121,8 @@ IntGdiLineTo(DC *dc,
|
|||
if (Dc_Attr->ulDirty_ & DC_PEN_DIRTY)
|
||||
IntGdiSelectPen(dc,Dc_Attr->hpen);
|
||||
|
||||
BitmapObj = BITMAPOBJ_LockBitmap ( dc->w.hBitmap );
|
||||
if (NULL == BitmapObj)
|
||||
psurf = SURFACE_LockSurface( dc->w.hBitmap );
|
||||
if (NULL == psurf)
|
||||
{
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
|
@ -158,7 +158,7 @@ IntGdiLineTo(DC *dc,
|
|||
if (!(PenBrushObj->flAttrs & GDIBRUSH_IS_NULL))
|
||||
{
|
||||
IntGdiInitBrushInstance(&PenBrushInst, PenBrushObj, dc->XlatePen);
|
||||
Ret = IntEngLineTo(&BitmapObj->SurfObj,
|
||||
Ret = IntEngLineTo(&psurf->SurfObj,
|
||||
dc->CombinedClip,
|
||||
&PenBrushInst.BrushObject,
|
||||
Points[0].x, Points[0].y,
|
||||
|
@ -167,7 +167,7 @@ IntGdiLineTo(DC *dc,
|
|||
ROP2_TO_MIX(Dc_Attr->jROP2));
|
||||
}
|
||||
|
||||
BITMAPOBJ_UnlockBitmap ( BitmapObj );
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
PENOBJ_UnlockPen( PenBrushObj );
|
||||
}
|
||||
|
||||
|
@ -254,7 +254,7 @@ IntGdiPolyline(DC *dc,
|
|||
LPPOINT pt,
|
||||
int Count)
|
||||
{
|
||||
BITMAPOBJ *BitmapObj;
|
||||
SURFACE *psurf;
|
||||
GDIBRUSHOBJ *PenBrushObj;
|
||||
GDIBRUSHINST PenBrushInst;
|
||||
LPPOINT Points;
|
||||
|
@ -283,10 +283,10 @@ IntGdiPolyline(DC *dc,
|
|||
Points = EngAllocMem(0, Count * sizeof(POINT), TAG_COORD);
|
||||
if (Points != NULL)
|
||||
{
|
||||
BitmapObj = BITMAPOBJ_LockBitmap(dc->w.hBitmap);
|
||||
/* FIXME - BitmapObj can be NULL!!!!
|
||||
psurf = SURFACE_LockSurface(dc->w.hBitmap);
|
||||
/* FIXME - psurf can be NULL!!!!
|
||||
Don't assert but handle this case gracefully! */
|
||||
ASSERT(BitmapObj);
|
||||
ASSERT(psurf);
|
||||
|
||||
RtlCopyMemory(Points, pt, Count * sizeof(POINT));
|
||||
IntLPtoDP(dc, Points, Count);
|
||||
|
@ -299,14 +299,14 @@ IntGdiPolyline(DC *dc,
|
|||
}
|
||||
|
||||
IntGdiInitBrushInstance(&PenBrushInst, PenBrushObj, dc->XlatePen);
|
||||
Ret = IntEngPolyline(&BitmapObj->SurfObj,
|
||||
Ret = IntEngPolyline(&psurf->SurfObj,
|
||||
dc->CombinedClip,
|
||||
&PenBrushInst.BrushObject,
|
||||
Points,
|
||||
Count,
|
||||
ROP2_TO_MIX(Dc_Attr->jROP2));
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
EngFreeMem(Points);
|
||||
}
|
||||
else
|
||||
|
|
|
@ -404,7 +404,7 @@ POLYGONFILL_FillScanLineAlternate(
|
|||
PDC dc,
|
||||
int ScanLine,
|
||||
FILL_EDGE* ActiveHead,
|
||||
BITMAPOBJ *BitmapObj,
|
||||
SURFACE *psurf,
|
||||
BRUSHOBJ *BrushObj,
|
||||
MIX RopMode )
|
||||
{
|
||||
|
@ -430,7 +430,7 @@ POLYGONFILL_FillScanLineAlternate(
|
|||
BoundRect.right = x2;
|
||||
|
||||
//DPRINT("Fill Line (%d, %d) to (%d, %d)\n",x1, ScanLine, x2, ScanLine);
|
||||
IntEngLineTo(&BitmapObj->SurfObj,
|
||||
IntEngLineTo(&psurf->SurfObj,
|
||||
dc->CombinedClip,
|
||||
BrushObj,
|
||||
x1,
|
||||
|
@ -452,7 +452,7 @@ POLYGONFILL_FillScanLineWinding(
|
|||
PDC dc,
|
||||
int ScanLine,
|
||||
FILL_EDGE* ActiveHead,
|
||||
BITMAPOBJ *BitmapObj,
|
||||
SURFACE *psurf,
|
||||
BRUSHOBJ *BrushObj,
|
||||
MIX RopMode )
|
||||
{
|
||||
|
@ -503,7 +503,7 @@ POLYGONFILL_FillScanLineWinding(
|
|||
BoundRect.right = x2;
|
||||
|
||||
//DPRINT("Fill Line (%d, %d) to (%d, %d)\n",x1, ScanLine, x2, ScanLine);
|
||||
IntEngLineTo(&BitmapObj->SurfObj,
|
||||
IntEngLineTo(&psurf->SurfObj,
|
||||
dc->CombinedClip,
|
||||
BrushObj,
|
||||
x1,
|
||||
|
@ -526,7 +526,7 @@ POLYGONFILL_FillScanLineWinding(
|
|||
BoundRect.right = x2;
|
||||
|
||||
//DPRINT("Fill Line (%d, %d) to (%d, %d)\n",x1, ScanLine, x2, ScanLine);
|
||||
IntEngLineTo(&BitmapObj->SurfObj,
|
||||
IntEngLineTo(&psurf->SurfObj,
|
||||
dc->CombinedClip,
|
||||
BrushObj,
|
||||
x1,
|
||||
|
@ -550,7 +550,7 @@ BOOL
|
|||
APIENTRY
|
||||
FillPolygon(
|
||||
PDC dc,
|
||||
BITMAPOBJ *BitmapObj,
|
||||
SURFACE *psurf,
|
||||
BRUSHOBJ *BrushObj,
|
||||
MIX RopMode,
|
||||
CONST PPOINT Points,
|
||||
|
@ -566,7 +566,7 @@ FillPolygon(
|
|||
PDC dc,
|
||||
int ScanLine,
|
||||
FILL_EDGE* ActiveHead,
|
||||
BITMAPOBJ *BitmapObj,
|
||||
SURFACE *psurf,
|
||||
BRUSHOBJ *BrushObj,
|
||||
MIX RopMode );
|
||||
|
||||
|
@ -592,7 +592,7 @@ FillPolygon(
|
|||
{
|
||||
POLYGONFILL_BuildActiveList(ScanLine, list, &ActiveHead);
|
||||
//DEBUG_PRINT_ACTIVE_EDGELIST(ActiveHead);
|
||||
FillScanLine ( dc, ScanLine, ActiveHead, BitmapObj, BrushObj, RopMode );
|
||||
FillScanLine ( dc, ScanLine, ActiveHead, psurf, BrushObj, RopMode );
|
||||
}
|
||||
|
||||
/* Free Edge List. If any are left. */
|
||||
|
|
|
@ -114,15 +114,15 @@ IntGdiExtEscape(
|
|||
INT OutSize,
|
||||
LPSTR OutData)
|
||||
{
|
||||
BITMAPOBJ *BitmapObj = BITMAPOBJ_LockBitmap(dc->w.hBitmap);
|
||||
SURFACE *psurf = SURFACE_LockSurface(dc->w.hBitmap);
|
||||
INT Result;
|
||||
|
||||
/* FIXME - Handle BitmapObj == NULL !!!!!! */
|
||||
/* FIXME - Handle psurf == NULL !!!!!! */
|
||||
|
||||
if ( NULL == ((GDIDEVICE *)dc->pPDev)->DriverFunctions.Escape )
|
||||
{
|
||||
Result = IntEngExtEscape(
|
||||
&BitmapObj->SurfObj,
|
||||
&psurf->SurfObj,
|
||||
Escape,
|
||||
InSize,
|
||||
(PVOID)((ULONG_PTR)InData),
|
||||
|
@ -132,14 +132,14 @@ IntGdiExtEscape(
|
|||
else
|
||||
{
|
||||
Result = ((GDIDEVICE *)dc->pPDev)->DriverFunctions.Escape(
|
||||
&BitmapObj->SurfObj,
|
||||
&psurf->SurfObj,
|
||||
Escape,
|
||||
InSize,
|
||||
(PVOID)InData,
|
||||
OutSize,
|
||||
(PVOID)OutData );
|
||||
}
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
|
|
@ -2908,7 +2908,7 @@ IntGdiPaintRgn(
|
|||
PGDIBRUSHOBJ pBrush;
|
||||
GDIBRUSHINST BrushInst;
|
||||
POINTL BrushOrigin;
|
||||
BITMAPOBJ *BitmapObj;
|
||||
SURFACE *psurf;
|
||||
PDC_ATTR Dc_Attr;
|
||||
|
||||
if (!dc) return FALSE;
|
||||
|
@ -2944,16 +2944,16 @@ IntGdiPaintRgn(
|
|||
|
||||
BrushOrigin.x = Dc_Attr->ptlBrushOrigin.x;
|
||||
BrushOrigin.y = Dc_Attr->ptlBrushOrigin.y;
|
||||
BitmapObj = BITMAPOBJ_LockBitmap(dc->w.hBitmap);
|
||||
/* FIXME - Handle BitmapObj == NULL !!!! */
|
||||
psurf = SURFACE_LockSurface(dc->w.hBitmap);
|
||||
/* FIXME - Handle psurf == NULL !!!! */
|
||||
|
||||
bRet = IntEngPaint(&BitmapObj->SurfObj,
|
||||
bRet = IntEngPaint(&psurf->SurfObj,
|
||||
ClipRegion,
|
||||
&BrushInst.BrushObject,
|
||||
&BrushOrigin,
|
||||
0xFFFF);//FIXME:don't know what to put here
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
BRUSHOBJ_UnlockBrush(pBrush);
|
||||
REGION_UnlockRgn(visrgn);
|
||||
NtGdiDeleteObject(tmpVisRgn);
|
||||
|
|
Loading…
Reference in a new issue