From 78a54aa150c40cf3d87de7e2ae44a3b10b4dae1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9=20van=20Geldorp?= Date: Sun, 6 Feb 2005 18:24:31 +0000 Subject: [PATCH] Properly synchronize with GPU svn path=/trunk/; revision=13444 --- reactos/include/win32k/driver.h | 3 +++ reactos/subsys/win32k/eng/misc.c | 14 ++++++++++++++ reactos/subsys/win32k/misc/driver.c | 1 + 3 files changed, 18 insertions(+) diff --git a/reactos/include/win32k/driver.h b/reactos/include/win32k/driver.h index d93effbf172..a18ff7d7648 100644 --- a/reactos/include/win32k/driver.h +++ b/reactos/include/win32k/driver.h @@ -97,6 +97,8 @@ typedef LONG (STDCALL *PGD_QUERYSPOOLTYPE)(DHPDEV, LPWSTR); typedef BOOL (STDCALL *PGD_GRADIENTFILL)(SURFOBJ*, CLIPOBJ*, XLATEOBJ*, TRIVERTEX*, ULONG, PVOID, ULONG, RECTL*, POINTL*, ULONG); +typedef VOID (STDCALL *PGD_SYNCHRONIZESURFACE)(SURFOBJ*, RECTL *, FLONG); + typedef struct _DRIVER_FUNCTIONS { PGD_ENABLEDRIVER EnableDriver; @@ -158,6 +160,7 @@ typedef struct _DRIVER_FUNCTIONS PGD_DISABLEDIRECTDRAW DisableDirectDraw; PGD_QUERYSPOOLTYPE QuerySpoolType; PGD_GRADIENTFILL GradientFill; + PGD_SYNCHRONIZESURFACE SynchronizeSurface; } DRIVER_FUNCTIONS, *PDRIVER_FUNCTIONS; BOOL DRIVER_RegisterDriver(LPCWSTR Name, PGD_ENABLEDRIVER EnableDriver); diff --git a/reactos/subsys/win32k/eng/misc.c b/reactos/subsys/win32k/eng/misc.c index 7fea4feecf0..2fcba3b633a 100644 --- a/reactos/subsys/win32k/eng/misc.c +++ b/reactos/subsys/win32k/eng/misc.c @@ -123,6 +123,20 @@ IntEngEnter(PINTENG_ENTER_LEAVE EnterLeave, *OutputObj = DestObj; } + if (NULL != *OutputObj + && 0 != (((BITMAPOBJ*) *OutputObj)->flHooks & HOOK_SYNCHRONIZE)) + { + if (NULL != GDIDEVFUNCS(*OutputObj).SynchronizeSurface) + { + GDIDEVFUNCS(*OutputObj).SynchronizeSurface(*OutputObj, DestRect, 0); + } + else if (STYPE_BITMAP == (*OutputObj)->iType + && NULL != GDIDEVFUNCS(*OutputObj).Synchronize) + { + GDIDEVFUNCS(*OutputObj).Synchronize((*OutputObj)->dhpdev, DestRect); + } + } + EnterLeave->DestObj = DestObj; EnterLeave->OutputObj = *OutputObj; EnterLeave->ReadOnly = ReadOnly; diff --git a/reactos/subsys/win32k/misc/driver.c b/reactos/subsys/win32k/misc/driver.c index 5ce41fd4ed4..67618a1400e 100644 --- a/reactos/subsys/win32k/misc/driver.c +++ b/reactos/subsys/win32k/misc/driver.c @@ -239,6 +239,7 @@ BOOL DRIVER_BuildDDIFunctions(PDRVENABLEDATA DED, DRIVER_FUNCTION(DisableDirectDraw); DRIVER_FUNCTION(QuerySpoolType); DRIVER_FUNCTION(GradientFill); + DRIVER_FUNCTION(SynchronizeSurface); END_FUNCTION_MAP();