* PROGRAMMER:
*/
-#include <w32k.h>
-#include "math.h"
+#include <win32k.h>
+#define _USE_MATH_DEFINES
+#include <math.h>
#define NDEBUG
#include <debug.h>
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 pdcattr = dc->pdcattr;
if( pPath->state != PATH_Closed )
{
- SetLastWin32Error(ERROR_CAN_NOT_COMPLETE);
+ EngSetLastError(ERROR_CAN_NOT_COMPLETE);
return FALSE;
}
*/
/* Save the information about the old mapping mode */
- mapMode = pdcattr->iMapMode;
- ptViewportExt = pdcattr->szlViewportExt;
- ptViewportOrg = pdcattr->ptlViewportOrg;
- ptWindowExt = pdcattr->szlWindowExt;
- ptWindowOrg = pdcattr->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
// pdcattr->ptlWindowOrg.x = 0;
// pdcattr->ptlWindowOrg.y = 0;
- graphicsMode = pdcattr->iGraphicsMode;
+ // graphicsMode = pdcattr->iGraphicsMode;
// pdcattr->iGraphicsMode = GM_ADVANCED;
// IntGdiModifyWorldTransform( dc, &xform, MWT_IDENTITY );
// pdcattr->iGraphicsMode = graphicsMode;
// pdcattr->ptlWindowOrg = ptWindowOrg;
/* Go to GM_ADVANCED temporarily to restore the world transform */
- graphicsMode = pdcattr->iGraphicsMode;
+ //graphicsMode = pdcattr->iGraphicsMode;
// pdcattr->iGraphicsMode = GM_ADVANCED;
// IntGdiModifyWorldTransform( dc, &xform, MWT_MAX+1 );
// pdcattr->iGraphicsMode = graphicsMode;
FLOAT_POINT ellCorners[2];
pPath = PATH_LockPath( dc->dclevel.hPath );
- if (!pPath) return FALSE;
+ if (!pPath) return FALSE;
/* Check that path is open */
if(pPath->state!=PATH_Open)
if ( pPath->state != PATH_Open )
{
Ret = FALSE;
- goto ArcExit;
+ goto ArcExit;
}
/* Check for zero height / width */
pPath = PATH_LockPath( dc->dclevel.hPath );
if (!pPath) return FALSE;
-
+
/* Check that path is open */
if ( pPath->state != PATH_Open )
{
pPath = PATH_LockPath( dc->dclevel.hPath );
if (!pPath) return FALSE;
-
+
/* Check that path is open */
if ( pPath->state != PATH_Open )
{
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)
{
- SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
+ EngSetLastError(ERROR_NOT_ENOUGH_MEMORY);
return FALSE;
}
nPolyFillMode);
if(hrgn==(HRGN)0)
{
- SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
+ EngSetLastError(ERROR_NOT_ENOUGH_MEMORY);
return FALSE;
}
if(!pLinePts)
{
DPRINT1("Can't allocate pool!\n");
- SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
+ EngSetLastError(ERROR_NOT_ENOUGH_MEMORY);
goto end;
}
nLinePts = 0;
if(pPath->state == PATH_Open)
{
PATH_UnlockPath( pPath );
- SetLastWin32Error(ERROR_CAN_NOT_COMPLETE);
+ EngSetLastError(ERROR_CAN_NOT_COMPLETE);
return FALSE;
}
if (!size)
{
PATH_UnlockPath( pPath );
- SetLastWin32Error(ERROR_CAN_NOT_COMPLETE);
+ EngSetLastError(ERROR_CAN_NOT_COMPLETE);
return FALSE;
}
}
else
{
- SetLastWin32Error(ERROR_CAN_NOT_COMPLETE);
+ EngSetLastError(ERROR_CAN_NOT_COMPLETE);
ExFreePoolWithTag(elp, TAG_PATH);
PATH_UnlockPath( pPath );
return FALSE;
if(obj_type == GDI_OBJECT_TYPE_EXTPEN && penType == PS_COSMETIC)
{
PATH_UnlockPath( pPath );
- SetLastWin32Error(ERROR_CAN_NOT_COMPLETE);
+ EngSetLastError(ERROR_CAN_NOT_COMPLETE);
return FALSE;
}
numStrokes++;
j = 0;
if (numStrokes == 1)
- pStrokes = ExAllocatePoolWithTag(PagedPool, numStrokes * sizeof(PPATH), TAG_PATH);
+ pStrokes = ExAllocatePoolWithTag(PagedPool, numStrokes * sizeof(PPATH), TAG_PATH);
else
{
pOldStrokes = pStrokes; // Save old pointer.
}
}
- pNewPath = ExAllocatePoolWithTag(PagedPool, sizeof(PATH), TAG_PATH);
+ pNewPath = ExAllocatePoolWithTag(PagedPool, sizeof(PATH), TAG_PATH);
PATH_InitGdiPath(pNewPath);
pNewPath->state = PATH_Open;
}
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)
{
sinEsc = 0;
}
- IntGdiGetDCOrg(dc, &org);
+ org = dc->ptlDCOrig;
for (idx = 0; idx < count; idx++)
{
PDC dc = DC_LockDc ( hDC );
if ( !dc )
{
- SetLastWin32Error(ERROR_INVALID_HANDLE);
+ EngSetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
dc = DC_LockDc ( hDC );
if ( !dc )
{
- SetLastWin32Error(ERROR_INVALID_HANDLE);
+ EngSetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
pPath = PATH_AllocPathWithHandle();
if (!pPath)
{
- SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
+ EngSetLastError(ERROR_NOT_ENOUGH_MEMORY);
return FALSE;
}
dc->dclevel.flPath |= DCPATH_ACTIVE; // Set active ASAP!
pDc = DC_LockDc(hDC);
if (!pDc)
{
- SetLastWin32Error(ERROR_INVALID_PARAMETER);
+ EngSetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
- }
+ }
pPath = PATH_LockPath( pDc->dclevel.hPath );
if (!pPath)
{
else
{
// FIXME: check if lasterror is set correctly
- SetLastWin32Error(ERROR_CAN_NOT_COMPLETE);
+ EngSetLastError(ERROR_CAN_NOT_COMPLETE);
}
PATH_UnlockPath( pPath );
if ( !dc )
{
- SetLastWin32Error(ERROR_INVALID_HANDLE);
+ EngSetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
if ( (pPath->state != PATH_Open) || !(dc->dclevel.flPath & DCPATH_ACTIVE) )
{
DPRINT1("EndPath ERROR! 0x%x\n", dc->dclevel.hPath);
- SetLastWin32Error(ERROR_CAN_NOT_COMPLETE);
+ EngSetLastError(ERROR_CAN_NOT_COMPLETE);
ret = FALSE;
}
/* Set flag to indicate that path is finished */
PPATH pPath;
PDC_ATTR pdcattr;
PDC dc = DC_LockDc ( hDC );
-
+
if ( !dc )
{
- SetLastWin32Error(ERROR_INVALID_PARAMETER);
+ EngSetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
pPath = PATH_LockPath( dc->dclevel.hPath );
return FALSE;
}
+ DC_vPrepareDCsForBlit(dc, dc->rosdc.CombinedClip->rclBounds,
+ NULL, dc->rosdc.CombinedClip->rclBounds);
+
pdcattr = dc->pdcattr;
if (pdcattr->ulDirty_ & (DIRTY_LINE | DC_PEN_DIRTY))
}
PATH_UnlockPath( pPath );
+ DC_vFinishBlit(dc, NULL);
DC_UnlockDc ( dc );
return ret;
}
pDc = DC_LockDc(hDC);
if (!pDc)
{
- SetLastWin32Error(ERROR_INVALID_HANDLE);
+ EngSetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
if (!(pDc = DC_LockDc(hdc)))
{
- SetLastWin32Error(ERROR_INVALID_PARAMETER);
+ EngSetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
if (!dc)
{
DPRINT1("Can't lock dc!\n");
- SetLastWin32Error(ERROR_INVALID_PARAMETER);
+ EngSetLastError(ERROR_INVALID_PARAMETER);
return -1;
}
if (pPath->state != PATH_Closed)
{
- SetLastWin32Error(ERROR_CAN_NOT_COMPLETE);
+ EngSetLastError(ERROR_CAN_NOT_COMPLETE);
goto done;
}
}
else if(nSize<pPath->numEntriesUsed)
{
- SetLastWin32Error(ERROR_INVALID_PARAMETER);
+ EngSetLastError(ERROR_INVALID_PARAMETER);
goto done;
}
else
pDc = DC_LockDc(hDC);
if (!pDc)
{
- SetLastWin32Error(ERROR_INVALID_PARAMETER);
+ EngSetLastError(ERROR_INVALID_PARAMETER);
return NULL;
}
if (pPath->state!=PATH_Closed)
{
//FIXME: check that setlasterror is being called correctly
- SetLastWin32Error(ERROR_CAN_NOT_COMPLETE);
+ EngSetLastError(ERROR_CAN_NOT_COMPLETE);
}
else
{
if (!(pDc = DC_LockDc(hdc)))
{
- SetLastWin32Error(ERROR_INVALID_PARAMETER);
+ EngSetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
if (!(pDc = DC_LockDc(hDC)))
{
- SetLastWin32Error(ERROR_INVALID_PARAMETER);
+ EngSetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
pPath = PATH_LockPath( pDc->dclevel.hPath );
return FALSE;
}
+ DC_vPrepareDCsForBlit(pDc, pDc->rosdc.CombinedClip->rclBounds,
+ NULL, pDc->rosdc.CombinedClip->rclBounds);
+
pdcattr = pDc->pdcattr;
if (pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY))
if (bRet) PATH_EmptyPath(pPath);
PATH_UnlockPath( pPath );
+ DC_vFinishBlit(pDc, NULL);
DC_UnlockDc(pDc);
return bRet;
}
if (!(pDc = DC_LockDc(hDC)))
{
- SetLastWin32Error(ERROR_INVALID_PARAMETER);
+ EngSetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
pPath = PATH_LockPath( pDc->dclevel.hPath );
return FALSE;
}
+ DC_vPrepareDCsForBlit(pDc, pDc->rosdc.CombinedClip->rclBounds,
+ NULL, pDc->rosdc.CombinedClip->rclBounds);
+
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);
+ EngSetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
Ret = PATH_WidenPath(pdc);