mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 17:05:46 +00:00
- Removed NtGdiPie from w32ksvc.db, leaving NtGdiPie in fillshap.c and updated ntgdibad.h.
- Separated printing.c to printing.c and coord.c. This was for LP to DP. - Fixed flags. svn path=/trunk/; revision=28268
This commit is contained in:
parent
674c1a507f
commit
12fdc9f38e
7 changed files with 149 additions and 157 deletions
|
@ -485,7 +485,7 @@ PATHOBJ_vEnumStartClipLines@16
|
|||
PATHOBJ_vGetBounds@8
|
||||
PolyPatBlt@20=NtGdiPolyPatBlt@20
|
||||
PathToRegion@4
|
||||
Pie@36=NtGdiPie@36
|
||||
Pie@36
|
||||
PlayEnhMetaFile@12
|
||||
PlayEnhMetaFileRecord@16
|
||||
PlayMetaFile@8
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
<file>arc.c</file>
|
||||
<file>bitmap.c</file>
|
||||
<file>brush.c</file>
|
||||
<file>coord.c</file>
|
||||
<file>dc.c</file>
|
||||
<file>enhmfile.c</file>
|
||||
<file>font.c</file>
|
||||
|
|
|
@ -148,7 +148,6 @@ Chord(
|
|||
}
|
||||
|
||||
|
||||
#if 0
|
||||
/*
|
||||
* @unimplemented
|
||||
*/
|
||||
|
@ -166,6 +165,7 @@ Pie(
|
|||
int a8
|
||||
)
|
||||
{
|
||||
#if 0
|
||||
// Handle something other than a normal dc object.
|
||||
if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
|
||||
{
|
||||
|
@ -187,7 +187,8 @@ Pie(
|
|||
return FALSE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return NtGdiArcInternal(GdiTypePie, hDC, a1, a2, a3, a4, a5, a6, a7, a8);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
|
142
reactos/dll/win32/gdi32/objects/coord.c
Normal file
142
reactos/dll/win32/gdi32/objects/coord.c
Normal file
|
@ -0,0 +1,142 @@
|
|||
#include "precomp.h"
|
||||
|
||||
/* the following deal with IEEE single-precision numbers */
|
||||
#define EXCESS 126L
|
||||
#define SIGNBIT 0x80000000L
|
||||
#define SIGN(fp) ((fp) & SIGNBIT)
|
||||
#define EXP(fp) (((fp) >> 23L) & 0xFF)
|
||||
#define MANT(fp) ((fp) & 0x7FFFFFL)
|
||||
#define PACK(s,e,m) ((s) | ((e) << 23L) | (m))
|
||||
|
||||
// Sames as lrintf.
|
||||
#ifdef __GNUC__
|
||||
#define FLOAT_TO_INT(in,out) \
|
||||
__asm__ __volatile__ ("fistpl %0" : "=m" (out) : "t" (in) : "st");
|
||||
#else
|
||||
#define FLOAT_TO_INT(in,out) \
|
||||
__asm fld in \
|
||||
__asm fistp out
|
||||
#endif
|
||||
|
||||
LONG
|
||||
FASTCALL
|
||||
EFtoF( EFLOAT_S * efp)
|
||||
{
|
||||
long Mant, Exp, Sign = 0;
|
||||
|
||||
if (!efp->lMant) return 0;
|
||||
|
||||
Mant = efp->lMant;
|
||||
Exp = efp->lExp;
|
||||
Sign = SIGN(Mant);
|
||||
|
||||
//// M$ storage emulation
|
||||
if( Sign ) Mant = -Mant;
|
||||
Mant = ((Mant & 0x3fffffff) >> 7);
|
||||
Exp += (EXCESS-1);
|
||||
////
|
||||
Mant = MANT(Mant);
|
||||
return PACK(Sign, Exp, Mant);
|
||||
}
|
||||
|
||||
VOID
|
||||
FASTCALL
|
||||
FtoEF( EFLOAT_S * efp, FLOATL f)
|
||||
{
|
||||
long Mant, Exp, Sign = 0;
|
||||
gxf_long worker;
|
||||
|
||||
#ifdef _X86_
|
||||
worker.l = f; // It's a float stored in a long.
|
||||
#else
|
||||
worker.f = f;
|
||||
#endif
|
||||
|
||||
Exp = EXP(worker.l);
|
||||
Mant = MANT(worker.l);
|
||||
if (SIGN(worker.l)) Sign = -1;
|
||||
//// M$ storage emulation
|
||||
Mant = ((Mant << 7) | 0x40000000);
|
||||
Mant ^= Sign;
|
||||
Mant -= Sign;
|
||||
Exp -= (EXCESS-1);
|
||||
////
|
||||
efp->lMant = Mant;
|
||||
efp->lExp = Exp;
|
||||
}
|
||||
|
||||
|
||||
VOID FASTCALL
|
||||
CoordCnvP(MATRIX_S * mx, LPPOINT Point)
|
||||
{
|
||||
FLOAT x, y;
|
||||
gxf_long a, b;
|
||||
|
||||
x = (FLOAT)Point->x;
|
||||
y = (FLOAT)Point->y;
|
||||
|
||||
a.l = EFtoF( &mx->efM11 );
|
||||
b.l = EFtoF( &mx->efM21 );
|
||||
x = x * a.f + y * b.f + mx->fxDx;
|
||||
|
||||
a.l = EFtoF( &mx->efM12 );
|
||||
b.l = EFtoF( &mx->efM22 );
|
||||
y = x * a.f + y * b.f + mx->fxDy;
|
||||
|
||||
FLOAT_TO_INT(x, Point->x );
|
||||
FLOAT_TO_INT(y, Point->y );
|
||||
}
|
||||
|
||||
|
||||
BOOL
|
||||
STDCALL
|
||||
DPtoLP ( HDC hDC, LPPOINT Points, INT Count )
|
||||
{
|
||||
#if 0
|
||||
INT i;
|
||||
PDC_ATTR Dc_Attr;
|
||||
|
||||
if (!GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr)) return FALSE;
|
||||
|
||||
if (Dc_Attr->flXform & ( DEVICE_TO_WORLD_INVALID | // Force a full recalibration!
|
||||
PAGE_XLATE_CHANGED | // Changes or Updates have been made,
|
||||
PAGE_EXTENTS_CHANGED | // do processing in kernel space.
|
||||
WORLD_XFORM_CHANGED )
|
||||
#endif
|
||||
return NtGdiTransformPoints( hDC, Points, Points, Count, 0); // Last is 0 or 2
|
||||
#if 0
|
||||
else
|
||||
{
|
||||
for ( i = 0; i < Count; i++ )
|
||||
CoordCnvP ( &Dc_Attr->mxDevicetoWorld, &Points[i] );
|
||||
}
|
||||
return TRUE;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
BOOL
|
||||
STDCALL
|
||||
LPtoDP ( HDC hDC, LPPOINT Points, INT Count )
|
||||
{
|
||||
#if 0
|
||||
INT i;
|
||||
PDC_ATTR Dc_Attr;
|
||||
|
||||
if (!GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr)) return FALSE;
|
||||
|
||||
if (Dc_Attr->flXform & ( PAGE_XLATE_CHANGED | // Check for Changes and Updates
|
||||
PAGE_EXTENTS_CHANGED |
|
||||
WORLD_XFORM_CHANGED )
|
||||
#endif
|
||||
return NtGdiTransformPoints( hDC, Points, Points, Count, 0);
|
||||
#if 0
|
||||
else
|
||||
{
|
||||
for ( i = 0; i < Count; i++ )
|
||||
CoordCnvP ( &Dc_Attr->mxWorldToDevice, &Points[i] );
|
||||
}
|
||||
return TRUE;
|
||||
#endif
|
||||
}
|
||||
|
|
@ -1,144 +1,5 @@
|
|||
#include "precomp.h"
|
||||
|
||||
/* the following deal with IEEE single-precision numbers */
|
||||
#define EXCESS 126L
|
||||
#define SIGNBIT 0x80000000L
|
||||
#define SIGN(fp) ((fp) & SIGNBIT)
|
||||
#define EXP(fp) (((fp) >> 23L) & 0xFF)
|
||||
#define MANT(fp) ((fp) & 0x7FFFFFL)
|
||||
#define PACK(s,e,m) ((s) | ((e) << 23L) | (m))
|
||||
|
||||
// Sames as lrintf.
|
||||
#ifdef __GNUC__
|
||||
#define FLOAT_TO_INT(in,out) \
|
||||
__asm__ __volatile__ ("fistpl %0" : "=m" (out) : "t" (in) : "st");
|
||||
#else
|
||||
#define FLOAT_TO_INT(in,out) \
|
||||
__asm fld in \
|
||||
__asm fistp out
|
||||
#endif
|
||||
|
||||
LONG
|
||||
FASTCALL
|
||||
EFtoF( EFLOAT_S * efp)
|
||||
{
|
||||
long Mant, Exp, Sign = 0;
|
||||
|
||||
if (!efp->lMant) return 0;
|
||||
|
||||
Mant = efp->lMant;
|
||||
Exp = efp->lExp;
|
||||
Sign = SIGN(Mant);
|
||||
|
||||
//// M$ storage emulation
|
||||
if( Sign ) Mant = -Mant;
|
||||
Mant = ((Mant & 0x3fffffff) >> 7);
|
||||
Exp += (EXCESS-1);
|
||||
////
|
||||
Mant = MANT(Mant);
|
||||
return PACK(Sign, Exp, Mant);
|
||||
}
|
||||
|
||||
VOID
|
||||
FASTCALL
|
||||
FtoEF( EFLOAT_S * efp, FLOATL f)
|
||||
{
|
||||
long Mant, Exp, Sign = 0;
|
||||
gxf_long worker;
|
||||
|
||||
#ifdef _X86_
|
||||
worker.l = f; // It's a float stored in a long.
|
||||
#else
|
||||
worker.f = f;
|
||||
#endif
|
||||
|
||||
Exp = EXP(worker.l);
|
||||
Mant = MANT(worker.l);
|
||||
if (SIGN(worker.l)) Sign = -1;
|
||||
//// M$ storage emulation
|
||||
Mant = ((Mant << 7) | 0x40000000);
|
||||
Mant ^= Sign;
|
||||
Mant -= Sign;
|
||||
Exp -= (EXCESS-1);
|
||||
////
|
||||
efp->lMant = Mant;
|
||||
efp->lExp = Exp;
|
||||
}
|
||||
|
||||
|
||||
VOID FASTCALL
|
||||
CoordCnvP(MATRIX_S * mx, LPPOINT Point)
|
||||
{
|
||||
FLOAT x, y;
|
||||
gxf_long a, b;
|
||||
|
||||
x = (FLOAT)Point->x;
|
||||
y = (FLOAT)Point->y;
|
||||
|
||||
a.l = EFtoF( &mx->efM11 );
|
||||
b.l = EFtoF( &mx->efM21 );
|
||||
x = x * a.f + y * b.f + mx->fxDx;
|
||||
|
||||
a.l = EFtoF( &mx->efM12 );
|
||||
b.l = EFtoF( &mx->efM22 );
|
||||
y = x * a.f + y * b.f + mx->fxDy;
|
||||
|
||||
FLOAT_TO_INT(x, Point->x );
|
||||
FLOAT_TO_INT(y, Point->y );
|
||||
}
|
||||
|
||||
|
||||
BOOL
|
||||
STDCALL
|
||||
DPtoLP ( HDC hDC, LPPOINT Points, INT Count )
|
||||
{
|
||||
#if 0
|
||||
INT i;
|
||||
PDC_ATTR Dc_Attr;
|
||||
|
||||
if (!GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr)) return FALSE;
|
||||
|
||||
if (Dc_Attr->flXform & ( DEVICE_TO_WORLD_INVALID | // Force a full recalibration!
|
||||
PAGE_XLATE_CHANGED | // Changes or Updates have been made,
|
||||
PAGE_EXTENTS_CHANGED | // do processing in kernel space.
|
||||
WORLD_XFORM_CHANGED )
|
||||
#endif
|
||||
return NtGdiTransformPoints( hDC, Points, Points, Count, 0); // Last is 0 or 2
|
||||
#if 0
|
||||
else
|
||||
{
|
||||
for ( i = 0; i < Count; i++ )
|
||||
CoordCnvP ( &Dc_Attr->mxDevicetoWorld, &Points[i] );
|
||||
}
|
||||
return TRUE;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
BOOL
|
||||
STDCALL
|
||||
LPtoDP ( HDC hDC, LPPOINT Points, INT Count )
|
||||
{
|
||||
#if 0
|
||||
INT i;
|
||||
PDC_ATTR Dc_Attr;
|
||||
|
||||
if (!GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr)) return FALSE;
|
||||
|
||||
if (Dc_Attr->flXform & ( PAGE_XLATE_CHANGED | // Check for Changes and Updates
|
||||
PAGE_EXTENTS_CHANGED |
|
||||
WORLD_XFORM_CHANGED )
|
||||
#endif
|
||||
return NtGdiTransformPoints( hDC, Points, Points, Count, 0);
|
||||
#if 0
|
||||
else
|
||||
{
|
||||
for ( i = 0; i < Count; i++ )
|
||||
CoordCnvP ( &Dc_Attr->mxWorldToDevice, &Points[i] );
|
||||
}
|
||||
return TRUE;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if 0 /* FIXME: enable this as soon as we have working usermode gdi */
|
||||
|
||||
|
|
|
@ -538,19 +538,6 @@ STDCALL
|
|||
NtGdiPaintRgn(HDC hDC,
|
||||
HRGN hRgn);
|
||||
|
||||
/* Use NtGdiArcInternal with GdiTypePie. */
|
||||
BOOL
|
||||
STDCALL
|
||||
NtGdiPie(HDC hDC,
|
||||
int LeftRect,
|
||||
int TopRect,
|
||||
int RightRect,
|
||||
int BottomRect,
|
||||
int XRadial1,
|
||||
int YRadial1,
|
||||
int XRadial2,
|
||||
int YRadial2);
|
||||
|
||||
/* Metafiles are user-mode. */
|
||||
BOOL
|
||||
STDCALL
|
||||
|
|
|
@ -129,8 +129,8 @@
|
|||
#define DC_DIBSECTION 0x00004000
|
||||
#define DC_LAST_CLIPRGN_VALID 0x00008000
|
||||
#define DC_PRIMARY_DISPLAY 0x00010000
|
||||
#define DC_MODE_DIRTY 0x00020000
|
||||
#define DC_FONTTEXT_DIRTY 0x00040000
|
||||
#define DC_MODE_DIRTY 0x00200000
|
||||
#define DC_FONTTEXT_DIRTY 0x00400000
|
||||
|
||||
/* DC_ATTR LCD Flags */
|
||||
#define LDC_LDC 0x00000001 // (init) local DC other than a normal DC
|
||||
|
|
Loading…
Reference in a new issue