mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 18:25:58 +00:00
- rename painting.c to bitblt.c
- move NtGdi/Int(Poly)PatBlt to bitblt.c svn path=/trunk/; revision=28478
This commit is contained in:
parent
3883e58615
commit
c74dd37de0
3 changed files with 224 additions and 224 deletions
|
@ -1012,3 +1012,226 @@ failed:
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOL FASTCALL
|
||||||
|
IntPatBlt(
|
||||||
|
PDC dc,
|
||||||
|
INT XLeft,
|
||||||
|
INT YLeft,
|
||||||
|
INT Width,
|
||||||
|
INT Height,
|
||||||
|
DWORD ROP,
|
||||||
|
PGDIBRUSHOBJ BrushObj)
|
||||||
|
{
|
||||||
|
RECTL DestRect;
|
||||||
|
BITMAPOBJ *BitmapObj;
|
||||||
|
GDIBRUSHINST BrushInst;
|
||||||
|
POINTL BrushOrigin;
|
||||||
|
BOOL ret = TRUE;
|
||||||
|
|
||||||
|
ASSERT(BrushObj);
|
||||||
|
|
||||||
|
BitmapObj = BITMAPOBJ_LockBitmap(dc->w.hBitmap);
|
||||||
|
if (BitmapObj == NULL)
|
||||||
|
{
|
||||||
|
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(BrushObj->flAttrs & GDIBRUSH_IS_NULL))
|
||||||
|
{
|
||||||
|
if (Width > 0)
|
||||||
|
{
|
||||||
|
DestRect.left = XLeft + dc->w.DCOrgX;
|
||||||
|
DestRect.right = XLeft + Width + dc->w.DCOrgX;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DestRect.left = XLeft + Width + 1 + dc->w.DCOrgX;
|
||||||
|
DestRect.right = XLeft + dc->w.DCOrgX + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Height > 0)
|
||||||
|
{
|
||||||
|
DestRect.top = YLeft + dc->w.DCOrgY;
|
||||||
|
DestRect.bottom = YLeft + Height + dc->w.DCOrgY;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DestRect.top = YLeft + Height + dc->w.DCOrgY + 1;
|
||||||
|
DestRect.bottom = YLeft + dc->w.DCOrgY + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
IntLPtoDP(dc, (LPPOINT)&DestRect, 2);
|
||||||
|
|
||||||
|
BrushOrigin.x = BrushObj->ptOrigin.x + dc->w.DCOrgX;
|
||||||
|
BrushOrigin.y = BrushObj->ptOrigin.y + dc->w.DCOrgY;
|
||||||
|
|
||||||
|
IntGdiInitBrushInstance(&BrushInst, BrushObj, dc->XlateBrush);
|
||||||
|
|
||||||
|
ret = IntEngBitBlt(
|
||||||
|
&BitmapObj->SurfObj,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
dc->CombinedClip,
|
||||||
|
NULL,
|
||||||
|
&DestRect,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
&BrushInst.BrushObject,
|
||||||
|
&BrushOrigin,
|
||||||
|
ROP3_TO_ROP4(ROP));
|
||||||
|
}
|
||||||
|
|
||||||
|
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL FASTCALL
|
||||||
|
IntGdiPolyPatBlt(
|
||||||
|
HDC hDC,
|
||||||
|
DWORD dwRop,
|
||||||
|
PPATRECT pRects,
|
||||||
|
int cRects,
|
||||||
|
ULONG Reserved)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
PPATRECT r;
|
||||||
|
PGDIBRUSHOBJ BrushObj;
|
||||||
|
DC *dc;
|
||||||
|
|
||||||
|
dc = DC_LockDc(hDC);
|
||||||
|
if (dc == NULL)
|
||||||
|
{
|
||||||
|
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
if (dc->IsIC)
|
||||||
|
{
|
||||||
|
DC_UnlockDc(dc);
|
||||||
|
/* Yes, Windows really returns TRUE in this case */
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (r = pRects, i = 0; i < cRects; i++)
|
||||||
|
{
|
||||||
|
BrushObj = BRUSHOBJ_LockBrush(r->hBrush);
|
||||||
|
if(BrushObj != NULL)
|
||||||
|
{
|
||||||
|
IntPatBlt(
|
||||||
|
dc,
|
||||||
|
r->r.left,
|
||||||
|
r->r.top,
|
||||||
|
r->r.right,
|
||||||
|
r->r.bottom,
|
||||||
|
dwRop,
|
||||||
|
BrushObj);
|
||||||
|
BRUSHOBJ_UnlockBrush(BrushObj);
|
||||||
|
}
|
||||||
|
r++;
|
||||||
|
}
|
||||||
|
|
||||||
|
DC_UnlockDc(dc);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BOOL STDCALL
|
||||||
|
NtGdiPatBlt(
|
||||||
|
HDC hDC,
|
||||||
|
INT XLeft,
|
||||||
|
INT YLeft,
|
||||||
|
INT Width,
|
||||||
|
INT Height,
|
||||||
|
DWORD ROP)
|
||||||
|
{
|
||||||
|
PGDIBRUSHOBJ BrushObj;
|
||||||
|
DC *dc = DC_LockDc(hDC);
|
||||||
|
BOOL ret;
|
||||||
|
|
||||||
|
if (dc == NULL)
|
||||||
|
{
|
||||||
|
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
if (dc->IsIC)
|
||||||
|
{
|
||||||
|
DC_UnlockDc(dc);
|
||||||
|
/* Yes, Windows really returns TRUE in this case */
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
BrushObj = BRUSHOBJ_LockBrush(dc->Dc_Attr.hbrush);
|
||||||
|
if (BrushObj == NULL)
|
||||||
|
{
|
||||||
|
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||||
|
DC_UnlockDc(dc);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = IntPatBlt(
|
||||||
|
dc,
|
||||||
|
XLeft,
|
||||||
|
YLeft,
|
||||||
|
Width,
|
||||||
|
Height,
|
||||||
|
ROP,
|
||||||
|
BrushObj);
|
||||||
|
|
||||||
|
BRUSHOBJ_UnlockBrush(BrushObj);
|
||||||
|
DC_UnlockDc(dc);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL STDCALL
|
||||||
|
NtGdiPolyPatBlt(
|
||||||
|
HDC hDC,
|
||||||
|
DWORD dwRop,
|
||||||
|
IN PPOLYPATBLT pRects,
|
||||||
|
IN DWORD cRects,
|
||||||
|
IN DWORD Mode)
|
||||||
|
{
|
||||||
|
PPATRECT rb = NULL;
|
||||||
|
NTSTATUS Status = STATUS_SUCCESS;
|
||||||
|
BOOL Ret;
|
||||||
|
|
||||||
|
if (cRects > 0)
|
||||||
|
{
|
||||||
|
rb = ExAllocatePoolWithTag(PagedPool, sizeof(PATRECT) * cRects, TAG_PATBLT);
|
||||||
|
if (!rb)
|
||||||
|
{
|
||||||
|
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
_SEH_TRY
|
||||||
|
{
|
||||||
|
ProbeForRead(pRects,
|
||||||
|
cRects * sizeof(PATRECT),
|
||||||
|
1);
|
||||||
|
RtlCopyMemory(rb,
|
||||||
|
pRects,
|
||||||
|
cRects * sizeof(PATRECT));
|
||||||
|
}
|
||||||
|
_SEH_HANDLE
|
||||||
|
{
|
||||||
|
Status = _SEH_GetExceptionCode();
|
||||||
|
}
|
||||||
|
_SEH_END;
|
||||||
|
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
ExFreePool(rb);
|
||||||
|
SetLastNtError(Status);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Ret = IntGdiPolyPatBlt(hDC, dwRop, (PPATRECT)pRects, cRects, Mode);
|
||||||
|
|
||||||
|
if (cRects > 0)
|
||||||
|
ExFreePool(rb);
|
||||||
|
|
||||||
|
return Ret;
|
||||||
|
}
|
|
@ -492,130 +492,6 @@ IntGdiCreateNullBrush(VOID)
|
||||||
return hBrush;
|
return hBrush;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL FASTCALL
|
|
||||||
IntPatBlt(
|
|
||||||
PDC dc,
|
|
||||||
INT XLeft,
|
|
||||||
INT YLeft,
|
|
||||||
INT Width,
|
|
||||||
INT Height,
|
|
||||||
DWORD ROP,
|
|
||||||
PGDIBRUSHOBJ BrushObj)
|
|
||||||
{
|
|
||||||
RECTL DestRect;
|
|
||||||
BITMAPOBJ *BitmapObj;
|
|
||||||
GDIBRUSHINST BrushInst;
|
|
||||||
POINTL BrushOrigin;
|
|
||||||
BOOL ret = TRUE;
|
|
||||||
|
|
||||||
ASSERT(BrushObj);
|
|
||||||
|
|
||||||
BitmapObj = BITMAPOBJ_LockBitmap(dc->w.hBitmap);
|
|
||||||
if (BitmapObj == NULL)
|
|
||||||
{
|
|
||||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(BrushObj->flAttrs & GDIBRUSH_IS_NULL))
|
|
||||||
{
|
|
||||||
if (Width > 0)
|
|
||||||
{
|
|
||||||
DestRect.left = XLeft + dc->w.DCOrgX;
|
|
||||||
DestRect.right = XLeft + Width + dc->w.DCOrgX;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
DestRect.left = XLeft + Width + 1 + dc->w.DCOrgX;
|
|
||||||
DestRect.right = XLeft + dc->w.DCOrgX + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Height > 0)
|
|
||||||
{
|
|
||||||
DestRect.top = YLeft + dc->w.DCOrgY;
|
|
||||||
DestRect.bottom = YLeft + Height + dc->w.DCOrgY;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
DestRect.top = YLeft + Height + dc->w.DCOrgY + 1;
|
|
||||||
DestRect.bottom = YLeft + dc->w.DCOrgY + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
IntLPtoDP(dc, (LPPOINT)&DestRect, 2);
|
|
||||||
|
|
||||||
BrushOrigin.x = BrushObj->ptOrigin.x + dc->w.DCOrgX;
|
|
||||||
BrushOrigin.y = BrushObj->ptOrigin.y + dc->w.DCOrgY;
|
|
||||||
|
|
||||||
IntGdiInitBrushInstance(&BrushInst, BrushObj, dc->XlateBrush);
|
|
||||||
|
|
||||||
ret = IntEngBitBlt(
|
|
||||||
&BitmapObj->SurfObj,
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
dc->CombinedClip,
|
|
||||||
NULL,
|
|
||||||
&DestRect,
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
&BrushInst.BrushObject,
|
|
||||||
&BrushOrigin,
|
|
||||||
ROP3_TO_ROP4(ROP));
|
|
||||||
}
|
|
||||||
|
|
||||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOL FASTCALL
|
|
||||||
IntGdiPolyPatBlt(
|
|
||||||
HDC hDC,
|
|
||||||
DWORD dwRop,
|
|
||||||
PPATRECT pRects,
|
|
||||||
int cRects,
|
|
||||||
ULONG Reserved)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
PPATRECT r;
|
|
||||||
PGDIBRUSHOBJ BrushObj;
|
|
||||||
DC *dc;
|
|
||||||
|
|
||||||
dc = DC_LockDc(hDC);
|
|
||||||
if (dc == NULL)
|
|
||||||
{
|
|
||||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
if (dc->IsIC)
|
|
||||||
{
|
|
||||||
DC_UnlockDc(dc);
|
|
||||||
/* Yes, Windows really returns TRUE in this case */
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (r = pRects, i = 0; i < cRects; i++)
|
|
||||||
{
|
|
||||||
BrushObj = BRUSHOBJ_LockBrush(r->hBrush);
|
|
||||||
if(BrushObj != NULL)
|
|
||||||
{
|
|
||||||
IntPatBlt(
|
|
||||||
dc,
|
|
||||||
r->r.left,
|
|
||||||
r->r.top,
|
|
||||||
r->r.right,
|
|
||||||
r->r.bottom,
|
|
||||||
dwRop,
|
|
||||||
BrushObj);
|
|
||||||
BRUSHOBJ_UnlockBrush(BrushObj);
|
|
||||||
}
|
|
||||||
r++;
|
|
||||||
}
|
|
||||||
|
|
||||||
DC_UnlockDc(dc);
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* PUBLIC FUNCTIONS ***********************************************************/
|
/* PUBLIC FUNCTIONS ***********************************************************/
|
||||||
|
|
||||||
HBRUSH STDCALL
|
HBRUSH STDCALL
|
||||||
|
@ -747,105 +623,6 @@ NtGdiSetBrushOrg(HDC hDC, INT XOrg, INT YOrg, LPPOINT Point)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL STDCALL
|
|
||||||
NtGdiPolyPatBlt(
|
|
||||||
HDC hDC,
|
|
||||||
DWORD dwRop,
|
|
||||||
IN PPOLYPATBLT pRects,
|
|
||||||
IN DWORD cRects,
|
|
||||||
IN DWORD Mode)
|
|
||||||
{
|
|
||||||
PPATRECT rb = NULL;
|
|
||||||
NTSTATUS Status = STATUS_SUCCESS;
|
|
||||||
BOOL Ret;
|
|
||||||
|
|
||||||
if (cRects > 0)
|
|
||||||
{
|
|
||||||
rb = ExAllocatePoolWithTag(PagedPool, sizeof(PATRECT) * cRects, TAG_PATBLT);
|
|
||||||
if (!rb)
|
|
||||||
{
|
|
||||||
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
_SEH_TRY
|
|
||||||
{
|
|
||||||
ProbeForRead(pRects,
|
|
||||||
cRects * sizeof(PATRECT),
|
|
||||||
1);
|
|
||||||
RtlCopyMemory(rb,
|
|
||||||
pRects,
|
|
||||||
cRects * sizeof(PATRECT));
|
|
||||||
}
|
|
||||||
_SEH_HANDLE
|
|
||||||
{
|
|
||||||
Status = _SEH_GetExceptionCode();
|
|
||||||
}
|
|
||||||
_SEH_END;
|
|
||||||
|
|
||||||
if (!NT_SUCCESS(Status))
|
|
||||||
{
|
|
||||||
ExFreePool(rb);
|
|
||||||
SetLastNtError(Status);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Ret = IntGdiPolyPatBlt(hDC, dwRop, (PPATRECT)pRects, cRects, Mode);
|
|
||||||
|
|
||||||
if (cRects > 0)
|
|
||||||
ExFreePool(rb);
|
|
||||||
|
|
||||||
return Ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOL STDCALL
|
|
||||||
NtGdiPatBlt(
|
|
||||||
HDC hDC,
|
|
||||||
INT XLeft,
|
|
||||||
INT YLeft,
|
|
||||||
INT Width,
|
|
||||||
INT Height,
|
|
||||||
DWORD ROP)
|
|
||||||
{
|
|
||||||
PGDIBRUSHOBJ BrushObj;
|
|
||||||
DC *dc = DC_LockDc(hDC);
|
|
||||||
BOOL ret;
|
|
||||||
|
|
||||||
if (dc == NULL)
|
|
||||||
{
|
|
||||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
if (dc->IsIC)
|
|
||||||
{
|
|
||||||
DC_UnlockDc(dc);
|
|
||||||
/* Yes, Windows really returns TRUE in this case */
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
BrushObj = BRUSHOBJ_LockBrush(dc->Dc_Attr.hbrush);
|
|
||||||
if (BrushObj == NULL)
|
|
||||||
{
|
|
||||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
|
||||||
DC_UnlockDc(dc);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = IntPatBlt(
|
|
||||||
dc,
|
|
||||||
XLeft,
|
|
||||||
YLeft,
|
|
||||||
Width,
|
|
||||||
Height,
|
|
||||||
ROP,
|
|
||||||
BrushObj);
|
|
||||||
|
|
||||||
BRUSHOBJ_UnlockBrush(BrushObj);
|
|
||||||
DC_UnlockDc(dc);
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID FASTCALL
|
VOID FASTCALL
|
||||||
IntGdiSetSolidBrushColor(HBRUSH hBrush, COLORREF Color)
|
IntGdiSetSolidBrushColor(HBRUSH hBrush, COLORREF Color)
|
||||||
{
|
{
|
||||||
|
|
|
@ -134,6 +134,7 @@
|
||||||
<directory name="objects">
|
<directory name="objects">
|
||||||
<file>arc.c</file>
|
<file>arc.c</file>
|
||||||
<file>bezier.c</file>
|
<file>bezier.c</file>
|
||||||
|
<file>bitblt.c</file>
|
||||||
<file>bitmaps.c</file>
|
<file>bitmaps.c</file>
|
||||||
<file>brush.c</file>
|
<file>brush.c</file>
|
||||||
<file>cliprgn.c</file>
|
<file>cliprgn.c</file>
|
||||||
|
@ -147,7 +148,6 @@
|
||||||
<file>icm.c</file>
|
<file>icm.c</file>
|
||||||
<file>line.c</file>
|
<file>line.c</file>
|
||||||
<file>metafile.c</file>
|
<file>metafile.c</file>
|
||||||
<file>painting.c</file>
|
|
||||||
<file>paintobj.c</file>
|
<file>paintobj.c</file>
|
||||||
<file>palobj.c</file>
|
<file>palobj.c</file>
|
||||||
<file>path.c</file>
|
<file>path.c</file>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue