Author: jimtabor Date: Tue Dec 4 10:51:03 2007 New Revision: 30994
URL: http://svn.reactos.org/svn/reactos?rev=30994&view=rev Log: Fix NtGdiFlush so it will not spam the debug list. Add changes and fixups.
Modified: trunk/reactos/subsystems/win32/win32k/include/dc.h trunk/reactos/subsystems/win32/win32k/objects/dc.c trunk/reactos/subsystems/win32/win32k/objects/gdibatch.c
Modified: trunk/reactos/subsystems/win32/win32k/include/dc.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/inc... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/dc.h (original) +++ trunk/reactos/subsystems/win32/win32k/include/dc.h Tue Dec 4 10:51:03 2007 @@ -51,7 +51,7 @@
typedef struct { - HANDLE Handle; + HANDLE Handle; // HSURF PVOID pvEntry; ULONG lucExcLock; ULONG Tid; @@ -60,7 +60,6 @@ PERESOURCE hsemDevLock;
PVOID pvGammaRamp; - PVOID pfnSync;
DHPDEV PDev; DEVMODEW DMW; @@ -94,6 +93,7 @@
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);
Modified: trunk/reactos/subsystems/win32/win32k/objects/dc.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/obj... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/dc.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/dc.c Tue Dec 4 10:51:03 2007 @@ -541,7 +541,7 @@
PrimarySurface.PreparedDriver = TRUE; PrimarySurface.DisplayNumber = DisplayNumber; - + PrimarySurface.flFlags = PDEV_DISPLAY; // Hard set,, add more flags. PrimarySurface.hsemDevLock = (PERESOURCE)EngCreateSemaphore();
ret = TRUE; @@ -826,6 +826,9 @@ NewDC->w.bitsPerPixel = ((PGDIDEVICE)NewDC->pPDev)->GDIInfo.cBitsPixel * ((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) { @@ -2678,6 +2681,17 @@ 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
Modified: trunk/reactos/subsystems/win32/win32k/objects/gdibatch.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/obj... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/gdibatch.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/gdibatch.c Tue Dec 4 10:51:03 2007 @@ -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 @@ APIENTRY NtGdiFlush(VOID) { - UNIMPLEMENTED; + SynchonizeDriver(GCAPS2_SYNCFLUSH); }
/*