mirror of
https://github.com/reactos/reactos.git
synced 2025-06-27 20:19:50 +00:00
- Start the implementation and support for dc attribute dirty bits. See bug 3863.
svn path=/trunk/; revision=37346
This commit is contained in:
parent
122723ef7d
commit
02456c2f68
5 changed files with 155 additions and 109 deletions
|
@ -268,6 +268,8 @@ VOID FASTCALL IntGdiUnreferencePdev(PGDIDEVICE pPDev, DWORD CleanUpType);
|
|||
HDC FASTCALL IntGdiCreateDisplayDC(HDEV hDev, ULONG DcType, BOOL EmptyDC);
|
||||
BOOL FASTCALL IntGdiCleanDC(HDC hDC);
|
||||
VOID FASTCALL IntvGetDeviceCaps(PGDIDEVICE, PDEVCAPS);
|
||||
HPEN FASTCALL IntGdiSelectPen(PDC,HPEN);
|
||||
HBRUSH FASTCALL IntGdiSelectBrush(PDC,HBRUSH);
|
||||
|
||||
extern PGDIDEVICE pPrimarySurface;
|
||||
|
||||
|
|
|
@ -199,6 +199,7 @@ IntGdiArcInternal(
|
|||
int YEndArc)
|
||||
{
|
||||
BOOL Ret;
|
||||
PDC_ATTR pDc_Attr;
|
||||
|
||||
DPRINT("StartX: %d, StartY: %d, EndX: %d, EndY: %d\n",
|
||||
XStartArc,YStartArc,XEndArc,YEndArc);
|
||||
|
@ -221,6 +222,15 @@ IntGdiArcInternal(
|
|||
arctype);
|
||||
}
|
||||
|
||||
pDc_Attr = dc->pDc_Attr;
|
||||
if (!pDc_Attr) pDc_Attr = &dc->Dc_Attr;
|
||||
|
||||
if (pDc_Attr->ulDirty_ & DC_BRUSH_DIRTY)
|
||||
IntGdiSelectBrush(dc,pDc_Attr->hbrush);
|
||||
|
||||
if (pDc_Attr->ulDirty_ & DC_PEN_DIRTY)
|
||||
IntGdiSelectPen(dc,pDc_Attr->hpen);
|
||||
|
||||
if (arctype == GdiTypeArcTo)
|
||||
{
|
||||
if (dc->DcLevel.flPath & DCPATH_CLOCKWISE)
|
||||
|
|
|
@ -509,6 +509,52 @@ IntGdiCreateNullBrush(VOID)
|
|||
return hBrush;
|
||||
}
|
||||
|
||||
HBRUSH
|
||||
FASTCALL
|
||||
IntGdiSelectBrush(
|
||||
PDC pDC,
|
||||
HBRUSH hBrush)
|
||||
{
|
||||
PDC_ATTR pDc_Attr;
|
||||
HBRUSH hOrgBrush;
|
||||
PGDIBRUSHOBJ pBrush;
|
||||
XLATEOBJ *XlateObj;
|
||||
BOOLEAN bFailed;
|
||||
|
||||
if (pDC == NULL || hBrush == NULL) return NULL;
|
||||
|
||||
pDc_Attr = pDC->pDc_Attr;
|
||||
if(!pDc_Attr) pDc_Attr = &pDC->Dc_Attr;
|
||||
|
||||
pBrush = BRUSHOBJ_LockBrush(hBrush);
|
||||
if (pBrush == NULL)
|
||||
{
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
XlateObj = IntGdiCreateBrushXlate(pDC, pBrush, &bFailed);
|
||||
BRUSHOBJ_UnlockBrush(pBrush);
|
||||
if(bFailed)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
hOrgBrush = pDc_Attr->hbrush;
|
||||
pDc_Attr->hbrush = hBrush;
|
||||
|
||||
if (pDC->XlateBrush != NULL)
|
||||
{
|
||||
EngDeleteXlate(pDC->XlateBrush);
|
||||
}
|
||||
pDC->XlateBrush = XlateObj;
|
||||
|
||||
pDc_Attr->ulDirty_ &= ~DC_BRUSH_DIRTY;
|
||||
|
||||
return hOrgBrush;
|
||||
}
|
||||
|
||||
|
||||
/* PUBLIC FUNCTIONS ***********************************************************/
|
||||
|
||||
HBRUSH STDCALL
|
||||
|
@ -656,4 +702,31 @@ IntGdiSetSolidBrushColor(HBRUSH hBrush, COLORREF Color)
|
|||
BRUSHOBJ_UnlockBrush(BrushObject);
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
HBRUSH
|
||||
APIENTRY
|
||||
NtGdiSelectBrush(
|
||||
IN HDC hDC,
|
||||
IN HBRUSH hBrush)
|
||||
{
|
||||
PDC pDC;
|
||||
HBRUSH hOrgBrush;
|
||||
|
||||
if (hDC == NULL || hBrush == NULL) return NULL;
|
||||
|
||||
pDC = DC_LockDc(hDC);
|
||||
if (!pDC)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
hOrgBrush = IntGdiSelectBrush(pDC,hBrush);
|
||||
|
||||
DC_UnlockDc(pDC);
|
||||
|
||||
return hOrgBrush;
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -2139,61 +2139,6 @@ NtGdiSelectBitmap(
|
|||
return hOrgBmp;
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
HBRUSH
|
||||
APIENTRY
|
||||
NtGdiSelectBrush(
|
||||
IN HDC hDC,
|
||||
IN HBRUSH hBrush)
|
||||
{
|
||||
PDC pDC;
|
||||
PDC_ATTR pDc_Attr;
|
||||
HBRUSH hOrgBrush;
|
||||
PGDIBRUSHOBJ pBrush;
|
||||
XLATEOBJ *XlateObj;
|
||||
BOOLEAN bFailed;
|
||||
|
||||
if (hDC == NULL || hBrush == NULL) return NULL;
|
||||
|
||||
pDC = DC_LockDc(hDC);
|
||||
if (!pDC)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pDc_Attr = pDC->pDc_Attr;
|
||||
if(!pDc_Attr) pDc_Attr = &pDC->Dc_Attr;
|
||||
|
||||
pBrush = BRUSHOBJ_LockBrush(hBrush);
|
||||
if (pBrush == NULL)
|
||||
{
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
DC_UnlockDc(pDC);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
XlateObj = IntGdiCreateBrushXlate(pDC, pBrush, &bFailed);
|
||||
BRUSHOBJ_UnlockBrush(pBrush);
|
||||
if(bFailed)
|
||||
{
|
||||
DC_UnlockDc(pDC);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
hOrgBrush = pDc_Attr->hbrush;
|
||||
pDc_Attr->hbrush = hBrush;
|
||||
if (pDC->XlateBrush != NULL)
|
||||
{
|
||||
EngDeleteXlate(pDC->XlateBrush);
|
||||
}
|
||||
pDC->XlateBrush = XlateObj;
|
||||
|
||||
DC_UnlockDc(pDC);
|
||||
return hOrgBrush;
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
|
@ -2230,60 +2175,6 @@ NtGdiSelectFont(
|
|||
return hOrgFont;
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
HPEN
|
||||
APIENTRY
|
||||
NtGdiSelectPen(
|
||||
IN HDC hDC,
|
||||
IN HPEN hPen)
|
||||
{
|
||||
PDC pDC;
|
||||
PDC_ATTR pDc_Attr;
|
||||
HPEN hOrgPen = NULL;
|
||||
PGDIBRUSHOBJ pPen;
|
||||
XLATEOBJ *XlateObj;
|
||||
BOOLEAN bFailed;
|
||||
|
||||
if (hDC == NULL || hPen == NULL) return NULL;
|
||||
|
||||
pDC = DC_LockDc(hDC);
|
||||
if (!pDC)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pDc_Attr = pDC->pDc_Attr;
|
||||
if(!pDc_Attr) pDc_Attr = &pDC->Dc_Attr;
|
||||
|
||||
pPen = PENOBJ_LockPen(hPen);
|
||||
if (pPen == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
XlateObj = IntGdiCreateBrushXlate(pDC, pPen, &bFailed);
|
||||
PENOBJ_UnlockPen(pPen);
|
||||
if (bFailed)
|
||||
{
|
||||
SetLastWin32Error(ERROR_NO_SYSTEM_RESOURCES);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
hOrgPen = pDc_Attr->hpen;
|
||||
pDc_Attr->hpen = hPen;
|
||||
if (pDC->XlatePen != NULL)
|
||||
{
|
||||
EngDeleteXlate(pDC->XlatePen);
|
||||
}
|
||||
pDC->XlatePen = XlateObj;
|
||||
|
||||
DC_UnlockDc(pDC);
|
||||
|
||||
return hOrgPen;
|
||||
}
|
||||
|
||||
HPALETTE
|
||||
FASTCALL
|
||||
GdiSelectPalette(HDC hDC,
|
||||
|
|
|
@ -247,6 +247,50 @@ PEN_GetObject(PGDIBRUSHOBJ pPenObject, INT cbCount, PLOGPEN pBuffer)
|
|||
return cbRetCount;
|
||||
}
|
||||
|
||||
|
||||
HPEN
|
||||
FASTCALL
|
||||
IntGdiSelectPen(
|
||||
PDC pDC,
|
||||
HPEN hPen)
|
||||
{
|
||||
PDC_ATTR pDc_Attr;
|
||||
HPEN hOrgPen = NULL;
|
||||
PGDIBRUSHOBJ pPen;
|
||||
XLATEOBJ *XlateObj;
|
||||
BOOLEAN bFailed;
|
||||
|
||||
pDc_Attr = pDC->pDc_Attr;
|
||||
if(!pDc_Attr) pDc_Attr = &pDC->Dc_Attr;
|
||||
|
||||
pPen = PENOBJ_LockPen(hPen);
|
||||
if (pPen == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
XlateObj = IntGdiCreateBrushXlate(pDC, pPen, &bFailed);
|
||||
PENOBJ_UnlockPen(pPen);
|
||||
if (bFailed)
|
||||
{
|
||||
SetLastWin32Error(ERROR_NO_SYSTEM_RESOURCES);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
hOrgPen = pDc_Attr->hpen;
|
||||
pDc_Attr->hpen = hPen;
|
||||
|
||||
if (pDC->XlatePen != NULL)
|
||||
{
|
||||
EngDeleteXlate(pDC->XlatePen);
|
||||
}
|
||||
pDc_Attr->ulDirty_ &= ~DC_PEN_DIRTY;
|
||||
|
||||
pDC->XlatePen = XlateObj;
|
||||
|
||||
return hOrgPen;
|
||||
}
|
||||
|
||||
/* PUBLIC FUNCTIONS ***********************************************************/
|
||||
|
||||
HPEN STDCALL
|
||||
|
@ -346,5 +390,31 @@ NtGdiExtCreatePen(
|
|||
return hPen;
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
HPEN
|
||||
APIENTRY
|
||||
NtGdiSelectPen(
|
||||
IN HDC hDC,
|
||||
IN HPEN hPen)
|
||||
{
|
||||
PDC pDC;
|
||||
HPEN hOrgPen;
|
||||
|
||||
if (hDC == NULL || hPen == NULL) return NULL;
|
||||
|
||||
pDC = DC_LockDc(hDC);
|
||||
if (!pDC)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
hOrgPen = IntGdiSelectPen(pDC,hPen);
|
||||
|
||||
DC_UnlockDc(pDC);
|
||||
|
||||
return hOrgPen;
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue