Fix NtGdiFlush so it will not spam the debug list. Add changes and fixups.

svn path=/trunk/; revision=30994
This commit is contained in:
James Tabor 2007-12-04 07:51:03 +00:00
parent 657accd8bd
commit 124f989076
3 changed files with 63 additions and 4 deletions

View file

@ -51,7 +51,7 @@ typedef struct _GDIPOINTER /* should stay private to ENG */
typedef struct
{
HANDLE Handle;
HANDLE Handle; // HSURF
PVOID pvEntry;
ULONG lucExcLock;
ULONG Tid;
@ -60,7 +60,6 @@ typedef struct
PERESOURCE hsemDevLock;
PVOID pvGammaRamp;
PVOID pfnSync;
DHPDEV PDev;
DEVMODEW DMW;
@ -94,6 +93,7 @@ typedef struct
NTSTATUS FASTCALL InitDcImpl(VOID);
HDC FASTCALL RetrieveDisplayHDC(VOID);
PGDIDEVICE FASTCALL IntEnumHDev(VOID);
HDC FASTCALL DC_AllocDC(PUNICODE_STRING Driver);
VOID FASTCALL DC_InitDC(HDC DCToInit);
HDC FASTCALL DC_FindOpenDC(PUNICODE_STRING Driver);

View file

@ -541,7 +541,7 @@ IntPrepareDriver()
PrimarySurface.PreparedDriver = TRUE;
PrimarySurface.DisplayNumber = DisplayNumber;
PrimarySurface.flFlags = PDEV_DISPLAY; // Hard set,, add more flags.
PrimarySurface.hsemDevLock = (PERESOURCE)EngCreateSemaphore();
ret = TRUE;
@ -827,6 +827,9 @@ IntGdiCreateDC(PUNICODE_STRING Driver,
((PGDIDEVICE)NewDC->pPDev)->GDIInfo.cPlanes;
DPRINT("Bits per pel: %u\n", NewDC->w.bitsPerPixel);
NewDC->flGraphics = PrimarySurface.DevInfo.flGraphicsCaps;
NewDC->flGraphics2 = PrimarySurface.DevInfo.flGraphicsCaps2;
if (!CreateAsIC)
{
NewDC->PalIndexed = NtGdiGetStockObject(DEFAULT_PALETTE);
@ -2678,6 +2681,17 @@ IntIsPrimarySurface(SURFOBJ *SurfObj)
return SurfObj->hsurf == PrimarySurface.Handle;
}
//
// Enumerate HDev
//
PGDIDEVICE FASTCALL
IntEnumHDev(VOID)
{
// I guess we will soon have more than one primary surface.
// This will do for now.
return &PrimarySurface;
}
#define SIZEOF_DEVMODEW_300 188
#define SIZEOF_DEVMODEW_400 212
#define SIZEOF_DEVMODEW_500 220

View file

@ -10,6 +10,51 @@
// Gdi Batch Flush support functions.
//
//
// DoDeviceSync
//
// based on IntEngEnter from eng/engmisc.c
//
VOID
FASTCALL
DoDeviceSync( SURFOBJ *Surface, PRECTL Rect, FLONG fl)
{
PGDIDEVICE Device = (GDIDEVICE*)Surface->hdev;
// No punting and "Handle to a surface, provided that the surface is device-managed.
// Otherwise, dhsurf is zero".
if (!(Device->flFlags & PDEV_DRIVER_PUNTED_CALL) && (Surface->dhsurf))
{
if (Device->DriverFunctions.SynchronizeSurface)
return Device->DriverFunctions.SynchronizeSurface(Surface, Rect, fl);
else
{
if (Device->DriverFunctions.Synchronize)
return Device->DriverFunctions.Synchronize(Surface->dhpdev, Rect);
}
}
return;
}
VOID
FASTCALL
SynchonizeDriver(FLONG Flags)
{
SURFOBJ *SurfObj;
PGDIDEVICE Device;
if (Flags & GCAPS2_SYNCFLUSH)
Flags = DSS_FLUSH_EVENT;
if (Flags & GCAPS2_SYNCTIMER)
Flags = DSS_TIMER_EVENT;
Device = IntEnumHDev();
SurfObj = EngLockSurface((HSURF)Device->Handle);
if(!SurfObj) return;
DoDeviceSync( SurfObj, NULL, Flags);
EngUnlockSurface(SurfObj);
return;
}
//
// Process the batch.
@ -80,7 +125,7 @@ VOID
APIENTRY
NtGdiFlush(VOID)
{
UNIMPLEMENTED;
SynchonizeDriver(GCAPS2_SYNCFLUSH);
}
/*