mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 15:02:59 +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>
|
#include <w32k.h>
|
||||||
|
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
|
@ -259,8 +258,7 @@ IntGdiArcInternal(
|
||||||
|
|
||||||
if (arctype == GdiTypeArcTo)
|
if (arctype == GdiTypeArcTo)
|
||||||
{
|
{
|
||||||
dc->ptlDCOrig.x = EfCx;
|
IntGdiMoveToEx(dc, EfCx, EfCy, NULL);
|
||||||
dc->ptlDCOrig.y = EfCy;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Ret;
|
return Ret;
|
||||||
|
@ -306,12 +304,7 @@ IntGdiAngleArc( PDC pDC,
|
||||||
|
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
POINT point;
|
IntGdiMoveToEx(pDC, x2, y2, NULL);
|
||||||
point.x=x2;
|
|
||||||
point.y=y2;
|
|
||||||
// CoordLPtoDP ( pDC, &point );
|
|
||||||
pDC->ptlDCOrig.x = point.x;
|
|
||||||
pDC->ptlDCOrig.y = point.y;
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,7 +102,7 @@ IntGdiLineTo(DC *dc,
|
||||||
if (PATH_IsPathOpen(dc->DcLevel))
|
if (PATH_IsPathOpen(dc->DcLevel))
|
||||||
{
|
{
|
||||||
Ret = PATH_LineTo(dc, XEnd, YEnd);
|
Ret = PATH_LineTo(dc, XEnd, YEnd);
|
||||||
#if 0
|
//#if 0
|
||||||
if (Ret)
|
if (Ret)
|
||||||
{
|
{
|
||||||
// FIXME - PATH_LineTo should maybe do this...
|
// FIXME - PATH_LineTo should maybe do this...
|
||||||
|
@ -112,7 +112,7 @@ IntGdiLineTo(DC *dc,
|
||||||
CoordLPtoDP(dc, &Dc_Attr->ptfxCurrent); // Update fx
|
CoordLPtoDP(dc, &Dc_Attr->ptfxCurrent); // Update fx
|
||||||
Dc_Attr->ulDirty_ &= ~(DIRTY_PTLCURRENT|DIRTY_PTFXCURRENT|DIRTY_STYLESTATE);
|
Dc_Attr->ulDirty_ &= ~(DIRTY_PTLCURRENT|DIRTY_PTFXCURRENT|DIRTY_STYLESTATE);
|
||||||
}
|
}
|
||||||
#endif
|
//#endif
|
||||||
return Ret;
|
return Ret;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -123,32 +123,32 @@ PATH_FillPath( PDC dc, PPATH pPath )
|
||||||
xform = dc->DcLevel.xformWorld2Wnd;
|
xform = dc->DcLevel.xformWorld2Wnd;
|
||||||
|
|
||||||
/* Set MM_TEXT */
|
/* Set MM_TEXT */
|
||||||
IntGdiSetMapMode( dc, MM_TEXT );
|
// IntGdiSetMapMode( dc, MM_TEXT );
|
||||||
Dc_Attr->ptlViewportOrg.x = 0;
|
// Dc_Attr->ptlViewportOrg.x = 0;
|
||||||
Dc_Attr->ptlViewportOrg.y = 0;
|
// Dc_Attr->ptlViewportOrg.y = 0;
|
||||||
Dc_Attr->ptlWindowOrg.x = 0;
|
// Dc_Attr->ptlWindowOrg.x = 0;
|
||||||
Dc_Attr->ptlWindowOrg.y = 0;
|
// Dc_Attr->ptlWindowOrg.y = 0;
|
||||||
|
|
||||||
graphicsMode = Dc_Attr->iGraphicsMode;
|
graphicsMode = Dc_Attr->iGraphicsMode;
|
||||||
Dc_Attr->iGraphicsMode = GM_ADVANCED;
|
// Dc_Attr->iGraphicsMode = GM_ADVANCED;
|
||||||
IntGdiModifyWorldTransform( dc, &xform, MWT_IDENTITY );
|
// IntGdiModifyWorldTransform( dc, &xform, MWT_IDENTITY );
|
||||||
Dc_Attr->iGraphicsMode = graphicsMode;
|
// Dc_Attr->iGraphicsMode = graphicsMode;
|
||||||
|
|
||||||
/* Paint the region */
|
/* Paint the region */
|
||||||
IntGdiPaintRgn( dc, hrgn );
|
IntGdiPaintRgn( dc, hrgn );
|
||||||
NtGdiDeleteObject( hrgn );
|
NtGdiDeleteObject( hrgn );
|
||||||
/* Restore the old mapping mode */
|
/* Restore the old mapping mode */
|
||||||
IntGdiSetMapMode( dc, mapMode );
|
// IntGdiSetMapMode( dc, mapMode );
|
||||||
Dc_Attr->szlViewportExt = ptViewportExt;
|
// Dc_Attr->szlViewportExt = ptViewportExt;
|
||||||
Dc_Attr->ptlViewportOrg = ptViewportOrg;
|
// Dc_Attr->ptlViewportOrg = ptViewportOrg;
|
||||||
Dc_Attr->szlWindowExt = ptWindowExt;
|
// Dc_Attr->szlWindowExt = ptWindowExt;
|
||||||
Dc_Attr->ptlWindowOrg = ptWindowOrg;
|
// Dc_Attr->ptlWindowOrg = ptWindowOrg;
|
||||||
|
|
||||||
/* Go to GM_ADVANCED temporarily to restore the world transform */
|
/* Go to GM_ADVANCED temporarily to restore the world transform */
|
||||||
graphicsMode = Dc_Attr->iGraphicsMode;
|
graphicsMode = Dc_Attr->iGraphicsMode;
|
||||||
Dc_Attr->iGraphicsMode = GM_ADVANCED;
|
// Dc_Attr->iGraphicsMode = GM_ADVANCED;
|
||||||
IntGdiModifyWorldTransform( dc, &xform, MWT_MAX+1 );
|
// IntGdiModifyWorldTransform( dc, &xform, MWT_MAX+1 );
|
||||||
Dc_Attr->iGraphicsMode = graphicsMode;
|
// Dc_Attr->iGraphicsMode = graphicsMode;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
|
@ -1959,7 +1959,7 @@ REGION_CreateFrameRgn(
|
||||||
|
|
||||||
BOOL FASTCALL
|
BOOL FASTCALL
|
||||||
REGION_LPTODP(
|
REGION_LPTODP(
|
||||||
HDC hdc,
|
PDC dc,
|
||||||
HRGN hDest,
|
HRGN hDest,
|
||||||
HRGN hSrc)
|
HRGN hSrc)
|
||||||
{
|
{
|
||||||
|
@ -1967,7 +1967,6 @@ REGION_LPTODP(
|
||||||
PROSRGNDATA srcObj = NULL;
|
PROSRGNDATA srcObj = NULL;
|
||||||
PROSRGNDATA destObj = NULL;
|
PROSRGNDATA destObj = NULL;
|
||||||
|
|
||||||
DC * dc = DC_LockDc(hdc);
|
|
||||||
RECT tmpRect;
|
RECT tmpRect;
|
||||||
BOOL ret = FALSE;
|
BOOL ret = FALSE;
|
||||||
PDC_ATTR Dc_Attr;
|
PDC_ATTR Dc_Attr;
|
||||||
|
@ -2027,7 +2026,6 @@ REGION_LPTODP(
|
||||||
REGION_UnlockRgn(destObj);
|
REGION_UnlockRgn(destObj);
|
||||||
|
|
||||||
done:
|
done:
|
||||||
DC_UnlockDc(dc);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2878,8 +2876,7 @@ IntGdiPaintRgn(
|
||||||
HRGN hRgn
|
HRGN hRgn
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
//RECT box;
|
HRGN tmpVisRgn;
|
||||||
HRGN tmpVisRgn; //, prevVisRgn;
|
|
||||||
PROSRGNDATA visrgn;
|
PROSRGNDATA visrgn;
|
||||||
CLIPOBJ* ClipRegion;
|
CLIPOBJ* ClipRegion;
|
||||||
BOOL bRet = FALSE;
|
BOOL bRet = FALSE;
|
||||||
|
@ -2889,36 +2886,26 @@ IntGdiPaintRgn(
|
||||||
BITMAPOBJ *BitmapObj;
|
BITMAPOBJ *BitmapObj;
|
||||||
PDC_ATTR Dc_Attr;
|
PDC_ATTR Dc_Attr;
|
||||||
|
|
||||||
if (!dc)
|
if (!dc) return FALSE;
|
||||||
return FALSE;
|
|
||||||
Dc_Attr = dc->pDc_Attr;
|
Dc_Attr = dc->pDc_Attr;
|
||||||
if (!Dc_Attr) Dc_Attr = &dc->Dc_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;
|
||||||
{
|
|
||||||
DC_UnlockDc(dc);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ei enable later
|
|
||||||
// Transform region into device co-ords
|
// Transform region into device co-ords
|
||||||
if (!REGION_LPTODP(hDC, tmpVisRgn, hRgn) || NtGdiOffsetRgn(tmpVisRgn, dc->ptlDCOrig.x, dc->ptlDCOrig.y) == ERROR)
|
if (!REGION_LPTODP(dc, tmpVisRgn, hRgn) ||
|
||||||
|
NtGdiOffsetRgn(tmpVisRgn, dc->ptlDCOrig.x, dc->ptlDCOrig.y) == ERROR)
|
||||||
{
|
{
|
||||||
NtGdiDeleteObject(tmpVisRgn);
|
NtGdiDeleteObject(tmpVisRgn);
|
||||||
DC_UnlockDc(dc);
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
/* enable when clipping is implemented
|
|
||||||
NtGdiCombineRgn(tmpVisRgn, tmpVisRgn, dc->w.hGCClipRgn, RGN_AND);
|
|
||||||
*/
|
|
||||||
|
|
||||||
//visrgn = REGION_LockRgn(tmpVisRgn);
|
NtGdiCombineRgn(tmpVisRgn, tmpVisRgn, dc->w.hGCClipRgn, RGN_AND);
|
||||||
visrgn = REGION_LockRgn(hRgn);
|
|
||||||
|
visrgn = REGION_LockRgn(tmpVisRgn);
|
||||||
if (visrgn == NULL)
|
if (visrgn == NULL)
|
||||||
{
|
{
|
||||||
NtGdiDeleteObject(tmpVisRgn);
|
NtGdiDeleteObject(tmpVisRgn);
|
||||||
DC_UnlockDc(dc);
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue