* PROJECT: ReactOS win32 kernel mode subsystem
* LICENSE: GPL - See COPYING in the top level directory
* FILE: subsystems/win32/win32k/objects/path.c
- * PURPOSE: Freetype library support
+ * PURPOSE: Path support
* PROGRAMMER:
*/
-#include <w32k.h>
+#include <win32k.h>
#include "math.h"
#define NDEBUG
FASTCALL
PATH_Delete(HPATH hPath)
{
+ PPATH pPath;
if (!hPath) return FALSE;
- PPATH pPath = PATH_LockPath( hPath );
+ pPath = PATH_LockPath( hPath );
if (!pPath) return FALSE;
PATH_DestroyGdiPath( pPath );
PATH_UnlockPath( pPath );
FASTCALL
PATH_FillPath( PDC dc, PPATH pPath )
{
- INT mapMode, graphicsMode;
- SIZE ptViewportExt, ptWindowExt;
- POINTL ptViewportOrg, ptWindowOrg;
+ //INT mapMode, graphicsMode;
+ //SIZE ptViewportExt, ptWindowExt;
+ //POINTL ptViewportOrg, ptWindowOrg;
XFORM xform;
HRGN hrgn;
- PDC_ATTR Dc_Attr = dc->pDc_Attr;
-
- if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
+ PDC_ATTR pdcattr = dc->pdcattr;
if( pPath->state != PATH_Closed )
{
return FALSE;
}
- if( PATH_PathToRegion( pPath, Dc_Attr->jFillMode, &hrgn ))
+ if( PATH_PathToRegion( pPath, pdcattr->jFillMode, &hrgn ))
{
/* Since PaintRgn interprets the region as being in logical coordinates
* but the points we store for the path are already in device
*/
/* Save the information about the old mapping mode */
- mapMode = Dc_Attr->iMapMode;
- ptViewportExt = Dc_Attr->szlViewportExt;
- ptViewportOrg = Dc_Attr->ptlViewportOrg;
- ptWindowExt = Dc_Attr->szlWindowExt;
- ptWindowOrg = Dc_Attr->ptlWindowOrg;
+ //mapMode = pdcattr->iMapMode;
+ //ptViewportExt = pdcattr->szlViewportExt;
+ //ptViewportOrg = pdcattr->ptlViewportOrg;
+ //ptWindowExt = pdcattr->szlWindowExt;
+ //ptWindowOrg = pdcattr->ptlWindowOrg;
/* Save world transform
* NB: The Windows documentation on world transforms would lead one to
* tests show that resetting the graphics mode to GM_COMPATIBLE does
* not reset the world transform.
*/
- MatrixS2XForm(&xform, &dc->DcLevel.mxWorldToPage);
+ MatrixS2XForm(&xform, &dc->dclevel.mxWorldToPage);
/* Set MM_TEXT */
// IntGdiSetMapMode( dc, MM_TEXT );
-// Dc_Attr->ptlViewportOrg.x = 0;
-// Dc_Attr->ptlViewportOrg.y = 0;
-// Dc_Attr->ptlWindowOrg.x = 0;
-// Dc_Attr->ptlWindowOrg.y = 0;
+// pdcattr->ptlViewportOrg.x = 0;
+// pdcattr->ptlViewportOrg.y = 0;
+// pdcattr->ptlWindowOrg.x = 0;
+// pdcattr->ptlWindowOrg.y = 0;
- graphicsMode = Dc_Attr->iGraphicsMode;
-// Dc_Attr->iGraphicsMode = GM_ADVANCED;
+ // graphicsMode = pdcattr->iGraphicsMode;
+// pdcattr->iGraphicsMode = GM_ADVANCED;
// IntGdiModifyWorldTransform( dc, &xform, MWT_IDENTITY );
-// Dc_Attr->iGraphicsMode = graphicsMode;
+// pdcattr->iGraphicsMode = graphicsMode;
/* Paint the region */
IntGdiPaintRgn( dc, hrgn );
- NtGdiDeleteObject( hrgn );
+ GreDeleteObject( hrgn );
/* Restore the old mapping mode */
// IntGdiSetMapMode( dc, mapMode );
-// Dc_Attr->szlViewportExt = ptViewportExt;
-// Dc_Attr->ptlViewportOrg = ptViewportOrg;
-// Dc_Attr->szlWindowExt = ptWindowExt;
-// Dc_Attr->ptlWindowOrg = ptWindowOrg;
+// pdcattr->szlViewportExt = ptViewportExt;
+// pdcattr->ptlViewportOrg = ptViewportOrg;
+// pdcattr->szlWindowExt = ptWindowExt;
+// pdcattr->ptlWindowOrg = ptWindowOrg;
/* Go to GM_ADVANCED temporarily to restore the world transform */
- graphicsMode = Dc_Attr->iGraphicsMode;
-// Dc_Attr->iGraphicsMode = GM_ADVANCED;
+ //graphicsMode = pdcattr->iGraphicsMode;
+// pdcattr->iGraphicsMode = GM_ADVANCED;
// IntGdiModifyWorldTransform( dc, &xform, MWT_MAX+1 );
-// Dc_Attr->iGraphicsMode = graphicsMode;
+// pdcattr->iGraphicsMode = graphicsMode;
return TRUE;
}
return FALSE;
FASTCALL
PATH_MoveTo ( PDC dc )
{
- PPATH pPath = PATH_LockPath( dc->DcLevel.hPath );
+ PPATH pPath = PATH_LockPath( dc->dclevel.hPath );
if (!pPath) return FALSE;
/* Check that path is open */
PPATH pPath;
POINT point, pointCurPos;
- pPath = PATH_LockPath( dc->DcLevel.hPath );
+ pPath = PATH_LockPath( dc->dclevel.hPath );
if (!pPath) return FALSE;
/* Check that path is open */
POINT corners[2], pointTemp;
INT temp;
- pPath = PATH_LockPath( dc->DcLevel.hPath );
+ pPath = PATH_LockPath( dc->dclevel.hPath );
if (!pPath) return FALSE;
/* Check that path is open */
}
/* In GM_COMPATIBLE, don't include bottom and right edges */
- if ( IntGetGraphicsMode(dc) == GM_COMPATIBLE )
+ if (dc->pdcattr->iGraphicsMode == GM_COMPATIBLE)
{
corners[1].x--;
corners[1].y--;
POINT corners[2], pointTemp;
FLOAT_POINT ellCorners[2];
- pPath = PATH_LockPath( dc->DcLevel.hPath );
- if (!pPath) return FALSE;
+ pPath = PATH_LockPath( dc->dclevel.hPath );
+ if (!pPath) return FALSE;
/* Check that path is open */
if(pPath->state!=PATH_Open)
BOOL Ret = PATH_Arc ( dc, x1, y1, x2, y2, x1, (y1+y2)/2, x1, (y1+y2)/2, GdiTypeArc );
if (Ret)
{
- pPath = PATH_LockPath( dc->DcLevel.hPath );
+ pPath = PATH_LockPath( dc->dclevel.hPath );
if (!pPath) return FALSE;
IntGdiCloseFigure(pPath);
PATH_UnlockPath( pPath );
ASSERT ( dc );
- pPath = PATH_LockPath( dc->DcLevel.hPath );
+ pPath = PATH_LockPath( dc->dclevel.hPath );
if (!pPath) return FALSE;
- clockwise = ((dc->DcLevel.flPath & DCPATH_CLOCKWISE) != 0);
+ clockwise = ((dc->dclevel.flPath & DCPATH_CLOCKWISE) != 0);
/* Check that path is open */
if ( pPath->state != PATH_Open )
{
Ret = FALSE;
- goto ArcExit;
+ goto ArcExit;
}
/* Check for zero height / width */
}
/* In GM_COMPATIBLE, don't include bottom and right edges */
- if ( IntGetGraphicsMode(dc) == GM_COMPATIBLE )
+ if (dc->pdcattr->iGraphicsMode == GM_COMPATIBLE )
{
corners[1].x--;
corners[1].y--;
ASSERT ( pts );
ASSERT ( cbPoints );
- pPath = PATH_LockPath( dc->DcLevel.hPath );
+ pPath = PATH_LockPath( dc->dclevel.hPath );
if (!pPath) return FALSE;
-
+
/* Check that path is open */
if ( pPath->state != PATH_Open )
{
ASSERT ( pts );
ASSERT ( cbPoints );
- pPath = PATH_LockPath( dc->DcLevel.hPath );
+ pPath = PATH_LockPath( dc->dclevel.hPath );
if (!pPath) return FALSE;
/* Check that path is open */
ASSERT ( pts );
ASSERT ( cbPoints );
- pPath = PATH_LockPath( dc->DcLevel.hPath );
+ pPath = PATH_LockPath( dc->dclevel.hPath );
if (!pPath) return FALSE;
/* Check that path is open */
ASSERT ( pts );
ASSERT ( cbPoints );
- pPath = PATH_LockPath( dc->DcLevel.hPath );
+ pPath = PATH_LockPath( dc->dclevel.hPath );
if (!pPath) return FALSE;
-
+
/* Check that path is open */
if ( pPath->state != PATH_Open )
{
ASSERT ( dc );
ASSERT ( pts );
- pPath = PATH_LockPath( dc->DcLevel.hPath );
+ pPath = PATH_LockPath( dc->dclevel.hPath );
if (!pPath) return FALSE;
/* Check that path is open */
ASSERT ( counts );
ASSERT ( polygons );
- pPath = PATH_LockPath( dc->DcLevel.hPath );
+ pPath = PATH_LockPath( dc->dclevel.hPath );
if (!pPath) return FALSE;
/* Check that path is open */
ASSERT ( counts );
ASSERT ( polylines );
- pPath = PATH_LockPath( dc->DcLevel.hPath );
+ pPath = PATH_LockPath( dc->dclevel.hPath );
if (!pPath) return FALSE;
/* Check that path is open */
BOOL PATH_CheckCorners(DC *dc, POINT corners[], INT x1, INT y1, INT x2, INT y2)
{
INT temp;
- PDC_ATTR Dc_Attr = dc->pDc_Attr;
- if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
+ PDC_ATTR pdcattr = dc->pdcattr;
/* Convert points to device coordinates */
corners[0].x=x1;
}
/* In GM_COMPATIBLE, don't include bottom and right edges */
- if(Dc_Attr->iGraphicsMode==GM_COMPATIBLE)
+ if(pdcattr->iGraphicsMode==GM_COMPATIBLE)
{
corners[1].x--;
corners[1].y--;
PATH_FlattenPath ( pPath );
- /* FIXME: What happens when number of points is zero? */
-
/* First pass: Find out how many strokes there are in the path */
/* FIXME: We could eliminate this with some bookkeeping in GdiPath */
numStrokes=0;
if((pPath->pFlags[i] & ~PT_CLOSEFIGURE) == PT_MOVETO)
numStrokes++;
+ if(numStrokes == 0)
+ {
+ return FALSE;
+ }
+
/* Allocate memory for number-of-points-in-stroke array */
pNumPointsInStroke = ExAllocatePoolWithTag(PagedPool, sizeof(ULONG) * numStrokes, TAG_PATH);
if(!pNumPointsInStroke)
SIZE szViewportExt, szWindowExt;
DWORD mapMode, graphicsMode;
XFORM xform;
- PDC_ATTR Dc_Attr = dc->pDc_Attr;
+ PDC_ATTR pdcattr = dc->pdcattr;
DPRINT("Enter %s\n", __FUNCTION__);
if (pPath->state != PATH_Closed)
return FALSE;
- if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
+ /* Save the mapping mode info */
+ mapMode = pdcattr->iMapMode;
+ DC_vUpdateViewportExt(dc);
+ szViewportExt = dc->pdcattr->szlViewportExt;
+ ptViewportOrg = dc->pdcattr->ptlViewportOrg;
+ szWindowExt = dc->pdcattr->szlWindowExt;
+ ptWindowOrg = dc->pdcattr->ptlWindowOrg;
- /* Save the mapping mode info */
- mapMode = Dc_Attr->iMapMode;
- IntGetViewportExtEx(dc, &szViewportExt);
- IntGetViewportOrgEx(dc, &ptViewportOrg);
- IntGetWindowExtEx(dc, &szWindowExt);
- IntGetWindowOrgEx(dc, &ptWindowOrg);
-
- MatrixS2XForm(&xform, &dc->DcLevel.mxWorldToPage);
+ MatrixS2XForm(&xform, &dc->dclevel.mxWorldToPage);
/* Set MM_TEXT */
- Dc_Attr->iMapMode = MM_TEXT;
- Dc_Attr->ptlViewportOrg.x = 0;
- Dc_Attr->ptlViewportOrg.y = 0;
- Dc_Attr->ptlWindowOrg.x = 0;
- Dc_Attr->ptlWindowOrg.y = 0;
- graphicsMode = Dc_Attr->iGraphicsMode;
- Dc_Attr->iGraphicsMode = GM_ADVANCED;
+ pdcattr->iMapMode = MM_TEXT;
+ pdcattr->ptlViewportOrg.x = 0;
+ pdcattr->ptlViewportOrg.y = 0;
+ pdcattr->ptlWindowOrg.x = 0;
+ pdcattr->ptlWindowOrg.y = 0;
+ graphicsMode = pdcattr->iGraphicsMode;
+ pdcattr->iGraphicsMode = GM_ADVANCED;
IntGdiModifyWorldTransform(dc, &xform, MWT_IDENTITY);
- Dc_Attr->iGraphicsMode = graphicsMode;
+ pdcattr->iGraphicsMode = graphicsMode;
/* Allocate enough memory for the worst case without beziers (one PT_MOVETO
* and the rest PT_LINETO with PT_CLOSEFIGURE at the end) plus some buffer
if(pLinePts) ExFreePoolWithTag(pLinePts, TAG_PATH);
/* Restore the old mapping mode */
- Dc_Attr->iMapMode = mapMode;
- Dc_Attr->szlWindowExt.cx = szWindowExt.cx;
- Dc_Attr->szlWindowExt.cy = szWindowExt.cy;
- Dc_Attr->ptlWindowOrg.x = ptWindowOrg.x;
- Dc_Attr->ptlWindowOrg.y = ptWindowOrg.y;
+ pdcattr->iMapMode = mapMode;
+ pdcattr->szlWindowExt.cx = szWindowExt.cx;
+ pdcattr->szlWindowExt.cy = szWindowExt.cy;
+ pdcattr->ptlWindowOrg.x = ptWindowOrg.x;
+ pdcattr->ptlWindowOrg.y = ptWindowOrg.y;
- Dc_Attr->szlViewportExt.cx = szViewportExt.cx;
- Dc_Attr->szlViewportExt.cy = szViewportExt.cy;
- Dc_Attr->ptlViewportOrg.x = ptViewportOrg.x;
- Dc_Attr->ptlViewportOrg.y = ptViewportOrg.y;
+ pdcattr->szlViewportExt.cx = szViewportExt.cx;
+ pdcattr->szlViewportExt.cy = szViewportExt.cy;
+ pdcattr->ptlViewportOrg.x = ptViewportOrg.x;
+ pdcattr->ptlViewportOrg.y = ptViewportOrg.y;
/* Restore the world transform */
- XForm2MatrixS(&dc->DcLevel.mxWorldToPage, &xform);
+ XForm2MatrixS(&dc->dclevel.mxWorldToPage, &xform);
/* If we've moved the current point then get its new position
which will be in device (MM_TEXT) co-ords, convert it to
POINT pt;
IntGetCurrentPositionEx(dc, &pt);
IntDPtoLP(dc, &pt, 1);
- IntGdiMoveToEx(dc, pt.x, pt.y, NULL);
+ IntGdiMoveToEx(dc, pt.x, pt.y, NULL, FALSE);
}
DPRINT("Leave %s, ret=%d\n", __FUNCTION__, ret);
return ret;
FASTCALL
PATH_WidenPath(DC *dc)
{
- INT i, j, numStrokes, numOldStrokes, penWidth, penWidthIn, penWidthOut, size, penStyle;
+ INT i, j, numStrokes, penWidth, penWidthIn, penWidthOut, size, penStyle;
BOOL ret = FALSE;
- PPATH pPath, pNewPath, *pStrokes, *pOldStrokes, pUpPath, pDownPath;
+ PPATH pPath, pNewPath, *pStrokes = NULL, *pOldStrokes, pUpPath, pDownPath;
EXTLOGPEN *elp;
DWORD obj_type, joint, endcap, penType;
- PDC_ATTR Dc_Attr = dc->pDc_Attr;
+ PDC_ATTR pdcattr = dc->pdcattr;
- pPath = PATH_LockPath( dc->DcLevel.hPath );
+ pPath = PATH_LockPath( dc->dclevel.hPath );
if (!pPath) return FALSE;
if(pPath->state == PATH_Open)
return FALSE;
}
- if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
-
PATH_FlattenPath(pPath);
- size = IntGdiGetObject( Dc_Attr->hpen, 0, NULL);
+ size = IntGdiGetObject( pdcattr->hpen, 0, NULL);
if (!size)
{
PATH_UnlockPath( pPath );
}
elp = ExAllocatePoolWithTag(PagedPool, size, TAG_PATH);
- (VOID) IntGdiGetObject( Dc_Attr->hpen, size, elp);
+ (VOID) IntGdiGetObject( pdcattr->hpen, size, elp);
- obj_type = GDIOBJ_GetObjectType(Dc_Attr->hpen);
+ obj_type = GDIOBJ_GetObjectType(pdcattr->hpen);
if(obj_type == GDI_OBJECT_TYPE_PEN)
{
penStyle = ((LOGPEN*)elp)->lopnStyle;
penWidthOut++;
numStrokes = 0;
- numOldStrokes = 1;
-
- pStrokes = ExAllocatePoolWithTag(PagedPool, sizeof(PPATH), TAG_PATH);
- pStrokes[0] = ExAllocatePoolWithTag(PagedPool, sizeof(PATH), TAG_PATH);
- PATH_InitGdiPath(pStrokes[0]);
- pStrokes[0]->pFlags = ExAllocatePoolWithTag(PagedPool, pPath->numEntriesUsed * sizeof(INT), TAG_PATH);
- pStrokes[0]->pPoints = ExAllocatePoolWithTag(PagedPool, pPath->numEntriesUsed * sizeof(POINT), TAG_PATH);
- pStrokes[0]->numEntriesUsed = 0;
for(i = 0, j = 0; i < pPath->numEntriesUsed; i++, j++)
{
}
numStrokes++;
j = 0;
- pOldStrokes = pStrokes; // Save old pointer.
- pStrokes = ExAllocatePoolWithTag(PagedPool, numStrokes * sizeof(PPATH), TAG_PATH);
- RtlCopyMemory(pStrokes, pOldStrokes, numOldStrokes * sizeof(PPATH));
- numOldStrokes = numStrokes; // Save orig count.
- ExFreePoolWithTag(pOldStrokes, TAG_PATH); // Free old pointer.
+ if (numStrokes == 1)
+ pStrokes = ExAllocatePoolWithTag(PagedPool, numStrokes * sizeof(PPATH), TAG_PATH);
+ else
+ {
+ pOldStrokes = pStrokes; // Save old pointer.
+ pStrokes = ExAllocatePoolWithTag(PagedPool, numStrokes * sizeof(PPATH), TAG_PATH);
+ if (!pStrokes) return FALSE;
+ RtlCopyMemory(pStrokes, pOldStrokes, numStrokes * sizeof(PPATH));
+ ExFreePoolWithTag(pOldStrokes, TAG_PATH); // Free old pointer.
+ }
+ if (!pStrokes) return FALSE;
pStrokes[numStrokes - 1] = ExAllocatePoolWithTag(PagedPool, sizeof(PATH), TAG_PATH);
PATH_InitGdiPath(pStrokes[numStrokes - 1]);
}
}
- pNewPath = ExAllocatePoolWithTag(PagedPool, sizeof(PATH), TAG_PATH);
+ pNewPath = ExAllocatePoolWithTag(PagedPool, sizeof(PATH), TAG_PATH);
PATH_InitGdiPath(pNewPath);
pNewPath->state = PATH_Open;
alpha = atan2( yb - yo, xb - xo ) - theta;
if (alpha > 0) alpha -= M_PI;
else alpha += M_PI;
- if(_joint == PS_JOIN_MITER && dc->DcLevel.laPath.eMiterLimit < fabs(1 / sin(alpha/2)))
+ if(_joint == PS_JOIN_MITER && dc->dclevel.laPath.eMiterLimit < fabs(1 / sin(alpha/2)))
{
_joint = PS_JOIN_BEVEL;
}
start = header;
- pPath = PATH_LockPath(dc->DcLevel.hPath);
+ pPath = PATH_LockPath(dc->dclevel.hPath);
{
return FALSE;
}
}
IntGdiCloseFigure( pPath );
- PATH_UnlockPath( pPath );
+ PATH_UnlockPath( pPath );
return TRUE;
}
* PATH_ExtTextOut
*/
BOOL
-FASTCALL
+FASTCALL
PATH_ExtTextOut(PDC dc, INT x, INT y, UINT flags, const RECTL *lprc,
LPCWSTR str, UINT count, const INT *dx)
{
unsigned int idx;
double cosEsc, sinEsc;
- PDC_ATTR Dc_Attr;
+ PDC_ATTR pdcattr;
PTEXTOBJ TextObj;
LOGFONTW lf;
POINTL org;
if (!count) return TRUE;
- Dc_Attr = dc->pDc_Attr;
- if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
+ pdcattr = dc->pdcattr;
- TextObj = RealizeFontInit( Dc_Attr->hlfntNew);
+ TextObj = RealizeFontInit( pdcattr->hlfntNew);
if ( !TextObj ) return FALSE;
FontGetObject( TextObj, sizeof(lf), &lf);
return FALSE;
}
- pPath = PATH_LockPath(dc->DcLevel.hPath);
+ pPath = PATH_LockPath(dc->dclevel.hPath);
{
DC_UnlockDc(dc);
return FALSE;
}
/* If path is already open, do nothing. Check if not Save DC state */
- if ((dc->DcLevel.flPath & DCPATH_ACTIVE) && !(dc->DcLevel.flPath & DCPATH_SAVE))
+ if ((dc->dclevel.flPath & DCPATH_ACTIVE) && !(dc->dclevel.flPath & DCPATH_SAVE))
{
DC_UnlockDc ( dc );
return TRUE;
}
- if ( dc->DcLevel.hPath )
+ if ( dc->dclevel.hPath )
{
- DPRINT1("BeginPath 1 0x%x\n", dc->DcLevel.hPath);
- if ( !(dc->DcLevel.flPath & DCPATH_SAVE) )
+ DPRINT1("BeginPath 1 0x%x\n", dc->dclevel.hPath);
+ if ( !(dc->dclevel.flPath & DCPATH_SAVE) )
{ // Remove previous handle.
- if (!PATH_Delete(dc->DcLevel.hPath))
+ if (!PATH_Delete(dc->dclevel.hPath))
{
DC_UnlockDc ( dc );
return FALSE;
}
else
{ // Clear flags and Handle.
- dc->DcLevel.flPath &= ~(DCPATH_SAVE|DCPATH_ACTIVE);
- dc->DcLevel.hPath = NULL;
+ dc->dclevel.flPath &= ~(DCPATH_SAVE|DCPATH_ACTIVE);
+ dc->dclevel.hPath = NULL;
}
}
pPath = PATH_AllocPathWithHandle();
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
return FALSE;
}
- dc->DcLevel.flPath |= DCPATH_ACTIVE; // Set active ASAP!
+ dc->dclevel.flPath |= DCPATH_ACTIVE; // Set active ASAP!
- dc->DcLevel.hPath = pPath->BaseObject.hHmgr;
+ dc->dclevel.hPath = pPath->BaseObject.hHmgr;
- DPRINT1("BeginPath 2 h 0x%x p 0x%x\n", dc->DcLevel.hPath, pPath);
+ DPRINT1("BeginPath 2 h 0x%x p 0x%x\n", dc->dclevel.hPath, pPath);
// Path handles are shared. Also due to recursion with in the same thread.
GDIOBJ_UnlockObjByPtr((POBJ)pPath); // Unlock
- pPath = PATH_LockPath(dc->DcLevel.hPath); // Share Lock.
+ pPath = PATH_LockPath(dc->dclevel.hPath); // Share Lock.
/* Make sure that path is empty */
PATH_EmptyPath( pPath );
{
SetLastWin32Error(ERROR_INVALID_PARAMETER);
return FALSE;
- }
- pPath = PATH_LockPath( pDc->DcLevel.hPath );
+ }
+ pPath = PATH_LockPath( pDc->dclevel.hPath );
if (!pPath)
{
DC_UnlockDc(pDc);
return FALSE;
}
- pPath = PATH_LockPath( dc->DcLevel.hPath );
+ pPath = PATH_LockPath( dc->dclevel.hPath );
if (!pPath)
{
DC_UnlockDc ( dc );
return FALSE;
}
/* Check that path is currently being constructed */
- if ( (pPath->state != PATH_Open) || !(dc->DcLevel.flPath & DCPATH_ACTIVE) )
+ if ( (pPath->state != PATH_Open) || !(dc->dclevel.flPath & DCPATH_ACTIVE) )
{
- DPRINT1("EndPath ERROR! 0x%x\n", dc->DcLevel.hPath);
+ DPRINT1("EndPath ERROR! 0x%x\n", dc->dclevel.hPath);
SetLastWin32Error(ERROR_CAN_NOT_COMPLETE);
ret = FALSE;
}
/* Set flag to indicate that path is finished */
else
{
- DPRINT1("EndPath 0x%x\n", dc->DcLevel.hPath);
+ DPRINT1("EndPath 0x%x\n", dc->dclevel.hPath);
pPath->state = PATH_Closed;
- dc->DcLevel.flPath &= ~DCPATH_ACTIVE;
+ dc->dclevel.flPath &= ~DCPATH_ACTIVE;
}
PATH_UnlockPath( pPath );
DC_UnlockDc ( dc );
{
BOOL ret = FALSE;
PPATH pPath;
- PDC_ATTR pDc_Attr;
+ PDC_ATTR pdcattr;
PDC dc = DC_LockDc ( hDC );
-
+
if ( !dc )
{
SetLastWin32Error(ERROR_INVALID_PARAMETER);
return FALSE;
}
- pPath = PATH_LockPath( dc->DcLevel.hPath );
+ pPath = PATH_LockPath( dc->dclevel.hPath );
if (!pPath)
{
DC_UnlockDc ( dc );
return FALSE;
}
- pDc_Attr = dc->pDc_Attr;
- if (!pDc_Attr) pDc_Attr = &dc->Dc_Attr;
+ DC_vPrepareDCsForBlit(dc, dc->rosdc.CombinedClip->rclBounds,
+ NULL, dc->rosdc.CombinedClip->rclBounds);
+
+ pdcattr = dc->pdcattr;
+
+ if (pdcattr->ulDirty_ & (DIRTY_LINE | DC_PEN_DIRTY))
+ DC_vUpdateLineBrush(dc);
- if (pDc_Attr->ulDirty_ & DC_BRUSH_DIRTY)
- IntGdiSelectBrush(dc,pDc_Attr->hbrush);
+ if (pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY))
+ DC_vUpdateFillBrush(dc);
ret = PATH_FillPath( dc, pPath );
if ( ret )
}
PATH_UnlockPath( pPath );
+ DC_vFinishBlit(dc, NULL);
DC_UnlockDc ( dc );
return ret;
}
pDc = DC_LockDc(hDC);
if (!pDc)
{
- SetLastWin32Error(ERROR_INVALID_HANDLE);
+ SetLastWin32Error(ERROR_INVALID_HANDLE);
return FALSE;
}
- pPath = PATH_LockPath( pDc->DcLevel.hPath );
+ pPath = PATH_LockPath( pDc->dclevel.hPath );
if (!pPath)
{
DC_UnlockDc ( pDc );
return FALSE;
}
- worker.f = pDc->DcLevel.laPath.eMiterLimit;
+ worker.f = pDc->dclevel.laPath.eMiterLimit;
if (pdwOut)
{
return -1;
}
- pPath = PATH_LockPath( dc->DcLevel.hPath );
+ pPath = PATH_LockPath( dc->dclevel.hPath );
if (!pPath)
{
DC_UnlockDc ( dc );
PPATH pPath;
HRGN hrgnRval = 0;
DC *pDc;
- PDC_ATTR Dc_Attr;
+ PDC_ATTR pdcattr;
DPRINT("Enter %s\n", __FUNCTION__);
return NULL;
}
- Dc_Attr = pDc->pDc_Attr;
- if(!Dc_Attr) Dc_Attr = &pDc->Dc_Attr;
+ pdcattr = pDc->pdcattr;
- pPath = PATH_LockPath( pDc->DcLevel.hPath );
+ pPath = PATH_LockPath( pDc->dclevel.hPath );
if (!pPath)
{
DC_UnlockDc ( pDc );
else
{
/* FIXME: Should we empty the path even if conversion failed? */
- if(PATH_PathToRegion(pPath, Dc_Attr->jFillMode, &hrgnRval))
+ if(PATH_PathToRegion(pPath, pdcattr->jFillMode, &hrgnRval))
PATH_EmptyPath(pPath);
}
}
worker.l = dwNew;
- worker1.f = pDc->DcLevel.laPath.eMiterLimit;
- pDc->DcLevel.laPath.eMiterLimit = worker.f;
+ worker1.f = pDc->dclevel.laPath.eMiterLimit;
+ pDc->dclevel.laPath.eMiterLimit = worker.f;
if (pdwOut)
{
NtGdiStrokeAndFillPath(HDC hDC)
{
DC *pDc;
- PDC_ATTR pDc_Attr;
+ PDC_ATTR pdcattr;
PPATH pPath;
BOOL bRet = FALSE;
SetLastWin32Error(ERROR_INVALID_PARAMETER);
return FALSE;
}
- pPath = PATH_LockPath( pDc->DcLevel.hPath );
+ pPath = PATH_LockPath( pDc->dclevel.hPath );
if (!pPath)
{
DC_UnlockDc ( pDc );
return FALSE;
}
- pDc_Attr = pDc->pDc_Attr;
- if (!pDc_Attr) pDc_Attr = &pDc->Dc_Attr;
+ DC_vPrepareDCsForBlit(pDc, pDc->rosdc.CombinedClip->rclBounds,
+ NULL, pDc->rosdc.CombinedClip->rclBounds);
- if (pDc_Attr->ulDirty_ & DC_BRUSH_DIRTY)
- IntGdiSelectBrush(pDc,pDc_Attr->hbrush);
- if (pDc_Attr->ulDirty_ & DC_PEN_DIRTY)
- IntGdiSelectPen(pDc,pDc_Attr->hpen);
+ pdcattr = pDc->pdcattr;
+
+ if (pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY))
+ DC_vUpdateFillBrush(pDc);
+
+ if (pdcattr->ulDirty_ & (DIRTY_LINE | DC_PEN_DIRTY))
+ DC_vUpdateLineBrush(pDc);
bRet = PATH_FillPath(pDc, pPath);
if (bRet) bRet = PATH_StrokePath(pDc, pPath);
if (bRet) PATH_EmptyPath(pPath);
PATH_UnlockPath( pPath );
+ DC_vFinishBlit(pDc, NULL);
DC_UnlockDc(pDc);
return bRet;
}
NtGdiStrokePath(HDC hDC)
{
DC *pDc;
- PDC_ATTR pDc_Attr;
+ PDC_ATTR pdcattr;
PPATH pPath;
BOOL bRet = FALSE;
SetLastWin32Error(ERROR_INVALID_PARAMETER);
return FALSE;
}
- pPath = PATH_LockPath( pDc->DcLevel.hPath );
+ pPath = PATH_LockPath( pDc->dclevel.hPath );
if (!pPath)
{
DC_UnlockDc ( pDc );
return FALSE;
}
- pDc_Attr = pDc->pDc_Attr;
- if (!pDc_Attr) pDc_Attr = &pDc->Dc_Attr;
+ DC_vPrepareDCsForBlit(pDc, pDc->rosdc.CombinedClip->rclBounds,
+ NULL, pDc->rosdc.CombinedClip->rclBounds);
- if (pDc_Attr->ulDirty_ & DC_PEN_DIRTY)
- IntGdiSelectPen(pDc,pDc_Attr->hpen);
+ pdcattr = pDc->pdcattr;
+
+ if (pdcattr->ulDirty_ & (DIRTY_LINE | DC_PEN_DIRTY))
+ DC_vUpdateLineBrush(pDc);
bRet = PATH_StrokePath(pDc, pPath);
+
+ DC_vFinishBlit(pDc, NULL);
PATH_EmptyPath(pPath);
PATH_UnlockPath( pPath );
NtGdiWidenPath(HDC hDC)
{
BOOL Ret;
- PDC pdc = DC_LockDc ( hDC );
+ PDC pdc = DC_LockDc ( hDC );
if ( !pdc )
{
SetLastWin32Error(ERROR_INVALID_PARAMETER);
return Ret;
}
-BOOL
-APIENTRY
-NtGdiSelectClipPath(HDC hDC,
- int Mode)
-{
- HRGN hrgnPath;
- PPATH pPath;
- BOOL success = FALSE;
- PDC_ATTR Dc_Attr;
- PDC dc = DC_LockDc ( hDC );
-
- if ( !dc )
- {
- SetLastWin32Error(ERROR_INVALID_PARAMETER);
- return FALSE;
- }
-
- Dc_Attr = dc->pDc_Attr;
- if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
-
- pPath = PATH_LockPath( dc->DcLevel.hPath );
- if (!pPath)
- {
- DC_UnlockDc ( dc );
- return FALSE;
- }
- /* Check that path is closed */
- if( pPath->state != PATH_Closed )
- {
- SetLastWin32Error(ERROR_CAN_NOT_COMPLETE);
- return FALSE;
- }
- /* Construct a region from the path */
- else if( PATH_PathToRegion( pPath, Dc_Attr->jFillMode, &hrgnPath ) )
- {
- success = GdiExtSelectClipRgn( dc, hrgnPath, Mode ) != ERROR;
- NtGdiDeleteObject( hrgnPath );
-
- /* Empty the path */
- if( success )
- PATH_EmptyPath( pPath);
- /* FIXME: Should this function delete the path even if it failed? */
- }
- PATH_UnlockPath( pPath );
- DC_UnlockDc ( dc );
- return success;
-}
-
/* EOF */