mirror of
https://github.com/reactos/reactos.git
synced 2024-09-30 22:47:28 +00:00
Fix NtGdiFlush so it will not spam the debug list. Add changes and fixups.
svn path=/trunk/; revision=30994
This commit is contained in:
parent
657accd8bd
commit
124f989076
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue