mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 15:05:54 +00:00
Path needed some love Phase II:
- Fixed path coordinate problem by enabling old code and fixing arc move to issues. See that code that everyone thought that had no real use was usefull after all. - Found more image and region problems, see bug 3402. svn path=/trunk/; revision=34128
This commit is contained in:
parent
e6e9edd880
commit
4784315908
4 changed files with 30 additions and 50 deletions
|
@ -1,4 +1,3 @@
|
|||
|
||||
#include <w32k.h>
|
||||
|
||||
#define NDEBUG
|
||||
|
@ -259,8 +258,7 @@ IntGdiArcInternal(
|
|||
|
||||
if (arctype == GdiTypeArcTo)
|
||||
{
|
||||
dc->ptlDCOrig.x = EfCx;
|
||||
dc->ptlDCOrig.y = EfCy;
|
||||
IntGdiMoveToEx(dc, EfCx, EfCy, NULL);
|
||||
}
|
||||
|
||||
return Ret;
|
||||
|
@ -306,12 +304,7 @@ IntGdiAngleArc( PDC pDC,
|
|||
|
||||
if (result)
|
||||
{
|
||||
POINT point;
|
||||
point.x=x2;
|
||||
point.y=y2;
|
||||
// CoordLPtoDP ( pDC, &point );
|
||||
pDC->ptlDCOrig.x = point.x;
|
||||
pDC->ptlDCOrig.y = point.y;
|
||||
IntGdiMoveToEx(pDC, x2, y2, NULL);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -102,7 +102,7 @@ IntGdiLineTo(DC *dc,
|
|||
if (PATH_IsPathOpen(dc->DcLevel))
|
||||
{
|
||||
Ret = PATH_LineTo(dc, XEnd, YEnd);
|
||||
#if 0
|
||||
//#if 0
|
||||
if (Ret)
|
||||
{
|
||||
// FIXME - PATH_LineTo should maybe do this...
|
||||
|
@ -112,7 +112,7 @@ IntGdiLineTo(DC *dc,
|
|||
CoordLPtoDP(dc, &Dc_Attr->ptfxCurrent); // Update fx
|
||||
Dc_Attr->ulDirty_ &= ~(DIRTY_PTLCURRENT|DIRTY_PTFXCURRENT|DIRTY_STYLESTATE);
|
||||
}
|
||||
#endif
|
||||
//#endif
|
||||
return Ret;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -123,32 +123,32 @@ PATH_FillPath( PDC dc, PPATH pPath )
|
|||
xform = dc->DcLevel.xformWorld2Wnd;
|
||||
|
||||
/* 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;
|
||||
// IntGdiSetMapMode( dc, 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;
|
||||
IntGdiModifyWorldTransform( dc, &xform, MWT_IDENTITY );
|
||||
Dc_Attr->iGraphicsMode = graphicsMode;
|
||||
// Dc_Attr->iGraphicsMode = GM_ADVANCED;
|
||||
// IntGdiModifyWorldTransform( dc, &xform, MWT_IDENTITY );
|
||||
// Dc_Attr->iGraphicsMode = graphicsMode;
|
||||
|
||||
/* Paint the region */
|
||||
IntGdiPaintRgn( dc, hrgn );
|
||||
NtGdiDeleteObject( 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;
|
||||
// IntGdiSetMapMode( dc, mapMode );
|
||||
// Dc_Attr->szlViewportExt = ptViewportExt;
|
||||
// Dc_Attr->ptlViewportOrg = ptViewportOrg;
|
||||
// Dc_Attr->szlWindowExt = ptWindowExt;
|
||||
// Dc_Attr->ptlWindowOrg = ptWindowOrg;
|
||||
|
||||
/* Go to GM_ADVANCED temporarily to restore the world transform */
|
||||
graphicsMode = Dc_Attr->iGraphicsMode;
|
||||
Dc_Attr->iGraphicsMode = GM_ADVANCED;
|
||||
IntGdiModifyWorldTransform( dc, &xform, MWT_MAX+1 );
|
||||
Dc_Attr->iGraphicsMode = graphicsMode;
|
||||
// Dc_Attr->iGraphicsMode = GM_ADVANCED;
|
||||
// IntGdiModifyWorldTransform( dc, &xform, MWT_MAX+1 );
|
||||
// Dc_Attr->iGraphicsMode = graphicsMode;
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
|
|
|
@ -1959,7 +1959,7 @@ REGION_CreateFrameRgn(
|
|||
|
||||
BOOL FASTCALL
|
||||
REGION_LPTODP(
|
||||
HDC hdc,
|
||||
PDC dc,
|
||||
HRGN hDest,
|
||||
HRGN hSrc)
|
||||
{
|
||||
|
@ -1967,7 +1967,6 @@ REGION_LPTODP(
|
|||
PROSRGNDATA srcObj = NULL;
|
||||
PROSRGNDATA destObj = NULL;
|
||||
|
||||
DC * dc = DC_LockDc(hdc);
|
||||
RECT tmpRect;
|
||||
BOOL ret = FALSE;
|
||||
PDC_ATTR Dc_Attr;
|
||||
|
@ -2027,7 +2026,6 @@ REGION_LPTODP(
|
|||
REGION_UnlockRgn(destObj);
|
||||
|
||||
done:
|
||||
DC_UnlockDc(dc);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -2878,8 +2876,7 @@ IntGdiPaintRgn(
|
|||
HRGN hRgn
|
||||
)
|
||||
{
|
||||
//RECT box;
|
||||
HRGN tmpVisRgn; //, prevVisRgn;
|
||||
HRGN tmpVisRgn;
|
||||
PROSRGNDATA visrgn;
|
||||
CLIPOBJ* ClipRegion;
|
||||
BOOL bRet = FALSE;
|
||||
|
@ -2889,36 +2886,26 @@ IntGdiPaintRgn(
|
|||
BITMAPOBJ *BitmapObj;
|
||||
PDC_ATTR Dc_Attr;
|
||||
|
||||
if (!dc)
|
||||
return FALSE;
|
||||
if (!dc) return FALSE;
|
||||
Dc_Attr = dc->pDc_Attr;
|
||||
if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
|
||||
if (!(tmpVisRgn = NtGdiCreateRectRgn(0, 0, 0, 0)))
|
||||
if (!(tmpVisRgn = NtGdiCreateRectRgn(0, 0, 0, 0))) return FALSE;
|
||||
|
||||
// Transform region into device co-ords
|
||||
if (!REGION_LPTODP(dc, tmpVisRgn, hRgn) ||
|
||||
NtGdiOffsetRgn(tmpVisRgn, dc->ptlDCOrig.x, dc->ptlDCOrig.y) == ERROR)
|
||||
{
|
||||
DC_UnlockDc(dc);
|
||||
NtGdiDeleteObject(tmpVisRgn);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* ei enable later
|
||||
// Transform region into device co-ords
|
||||
if (!REGION_LPTODP(hDC, tmpVisRgn, hRgn) || NtGdiOffsetRgn(tmpVisRgn, dc->ptlDCOrig.x, dc->ptlDCOrig.y) == ERROR)
|
||||
{
|
||||
NtGdiDeleteObject(tmpVisRgn);
|
||||
DC_UnlockDc(dc);
|
||||
return FALSE;
|
||||
}
|
||||
*/
|
||||
/* enable when clipping is implemented
|
||||
NtGdiCombineRgn(tmpVisRgn, tmpVisRgn, dc->w.hGCClipRgn, RGN_AND);
|
||||
*/
|
||||
|
||||
//visrgn = REGION_LockRgn(tmpVisRgn);
|
||||
visrgn = REGION_LockRgn(hRgn);
|
||||
visrgn = REGION_LockRgn(tmpVisRgn);
|
||||
if (visrgn == NULL)
|
||||
{
|
||||
NtGdiDeleteObject(tmpVisRgn);
|
||||
DC_UnlockDc(dc);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue