ReactOS  0.4.15-dev-4921-g25fcdc5
pandisp.c File Reference
#include <win32k.h>
#include <debug.h>
Include dependency graph for pandisp.c:

Go to the source code of this file.

Classes

struct  _PANDEV
 

Macros

#define NDEBUG
 
#define TAG_PAN   'DnaP'
 
#define GETPFN(name)   ((PFN_Drv##name)(pandev->apfn[INDEX_Drv##name]))
 

Typedefs

typedef struct _PANDEV PANDEV
 
typedef struct _PANDEVPPANDEV
 

Functions

BOOL APIENTRY PanSynchronize (_In_ DHPDEV dhpdev, _In_ PRECTL prcl)
 
DHPDEV APIENTRY PanEnablePDEV (_In_ PDEVMODEW pdm, _In_ LPWSTR pwszLogAddress, _In_ ULONG cPat, _In_reads_opt_(cPat) HSURF *phsurfPatterns, _In_ ULONG cjCaps, _Out_writes_bytes_(cjCaps) PULONG pdevcaps, _In_ ULONG cjDevInfo, _Out_writes_bytes_(cjDevInfo) PDEVINFO pdi, _In_ HDEV hdev, _In_ LPWSTR pwszDeviceName, _In_ HANDLE hDriver)
 
VOID APIENTRY PanCompletePDEV (_In_ DHPDEV dhpdev, _In_ HDEV hdev)
 
VOID APIENTRY PanDisablePDEV (_In_ DHPDEV dhpdev)
 
VOID APIENTRY PanDisableSurface (_In_ DHPDEV dhpdev)
 
HSURF APIENTRY PanEnableSurface (_In_ DHPDEV dhpdev)
 
BOOL APIENTRY PanBitBlt (_Inout_ SURFOBJ *psoTrg, _In_opt_ SURFOBJ *psoSrc, _In_opt_ SURFOBJ *psoMask, _In_ CLIPOBJ *pco, _In_opt_ XLATEOBJ *pxlo, _In_ PRECTL prclTrg, _In_opt_ PPOINTL pptlSrc, _In_opt_ PPOINTL pptlMask, _In_opt_ BRUSHOBJ *pbo, _In_opt_ PPOINTL pptlBrush, _In_ ROP4 rop4)
 
BOOL APIENTRY PanCopyBits (_Inout_ SURFOBJ *psoDest, _In_opt_ SURFOBJ *psoSrc, _In_ CLIPOBJ *pco, _In_opt_ XLATEOBJ *pxlo, _In_ PRECTL prclDest, _In_opt_ PPOINTL pptlSrc)
 
BOOL APIENTRY PanStrokePath (_Inout_ SURFOBJ *pso, _In_ PATHOBJ *ppo, _In_ CLIPOBJ *pco, _In_opt_ XFORMOBJ *pxo, _In_ BRUSHOBJ *pbo, _In_ PPOINTL pptlBrushOrg, _In_ PLINEATTRS plineattrs, _In_ MIX mix)
 
BOOL APIENTRY PanTextOut (_Inout_ SURFOBJ *pso, _In_ STROBJ *pstro, _In_ FONTOBJ *pfo, _In_ CLIPOBJ *pco, _In_opt_ PRECTL prclExtra, _In_opt_ PRECTL prclOpaque, _In_ BRUSHOBJ *pboFore, _In_ BRUSHOBJ *pboOpaque, _In_ PPOINTL pptlOrg, _In_ MIX mix)
 
VOID APIENTRY PanMovePointer (_Inout_ SURFOBJ *pso, _In_ LONG x, _In_ LONG y, _In_ PRECTL prcl)
 
BOOL APIENTRY PanAlphaBlend (_Inout_ SURFOBJ *psoDest, _In_ SURFOBJ *psoSrc, _In_ CLIPOBJ *pco, _In_opt_ XLATEOBJ *pxlo, _In_ PRECTL prclDest, _In_ PRECTL prclSrc, _In_ BLENDOBJ *pBlendObj)
 
BOOL APIENTRY PanGradientFill (_Inout_ SURFOBJ *pso, _In_ CLIPOBJ *pco, _In_opt_ XLATEOBJ *pxlo, _In_ PTRIVERTEX pVertex, _In_ ULONG nVertex, _In_ PVOID pMesh, _In_ ULONG nMesh, _In_ PRECTL prclExtents, _In_ PPOINTL pptlDitherOrg, _In_ ULONG ulMode)
 

Variables

static DHPDEV gPan
 
DRVFN gPanDispDrvFn []
 
ULONG gPanDispDrvCount = RTL_NUMBER_OF(gPanDispDrvFn)
 

Macro Definition Documentation

◆ GETPFN

#define GETPFN (   name)    ((PFN_Drv##name)(pandev->apfn[INDEX_Drv##name]))

Definition at line 15 of file pandisp.c.

◆ NDEBUG

#define NDEBUG

Definition at line 11 of file pandisp.c.

◆ TAG_PAN

#define TAG_PAN   'DnaP'

Definition at line 14 of file pandisp.c.

Typedef Documentation

◆ PANDEV

◆ PPANDEV

typedef struct _PANDEV * PPANDEV

Function Documentation

◆ PanAlphaBlend()

BOOL APIENTRY PanAlphaBlend ( _Inout_ SURFOBJ psoDest,
_In_ SURFOBJ psoSrc,
_In_ CLIPOBJ pco,
_In_opt_ XLATEOBJ pxlo,
_In_ PRECTL  prclDest,
_In_ PRECTL  prclSrc,
_In_ BLENDOBJ pBlendObj 
)

Definition at line 428 of file pandisp.c.

436 {
437  PPANDEV pandev = (PPANDEV)psoDest->dhpdev;
438  BOOL res;
439 
441 
442  /* FIXME: PanSynchronize must be called periodically, as we have the GCAPS2_SYNCTIMER flag.
443  * That's not the case, so call PanSynchronize() manually */
444  if (res)
446 
447  return res;
448 }
BOOL APIENTRY PanSynchronize(_In_ DHPDEV dhpdev, _In_ PRECTL prcl)
Definition: pandisp.c:40
_In_ SURFOBJ * psoSrc
Definition: winddi.h:3414
unsigned int BOOL
Definition: ntddk_ex.h:94
SURFOBJ * psoShadow
Definition: pandisp.c:27
_In_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL _In_ RECTL * prclSrc
Definition: winddi.h:3414
static DHPDEV gPan
Definition: pandisp.c:17
_In_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL * prclDest
Definition: winddi.h:3414
_In_ SURFOBJ _In_ CLIPOBJ * pco
Definition: winddi.h:3414
_In_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL _In_ RECTL _In_ BLENDOBJ * pBlendObj
Definition: winddi.h:3414
#define NULL
Definition: types.h:112
struct _PANDEV * PPANDEV
GLuint res
Definition: glext.h:9613
_In_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ * pxlo
Definition: winddi.h:3414
ENGAPI BOOL APIENTRY EngAlphaBlend(_Inout_ SURFOBJ *psoDest, _In_ SURFOBJ *psoSrc, _In_opt_ CLIPOBJ *pco, _In_opt_ XLATEOBJ *pxlo, _In_ RECTL *prclDest, _In_ RECTL *prclSrc, _In_ BLENDOBJ *pBlendObj)
Definition: alphablend.c:20

◆ PanBitBlt()

BOOL APIENTRY PanBitBlt ( _Inout_ SURFOBJ psoTrg,
_In_opt_ SURFOBJ psoSrc,
_In_opt_ SURFOBJ psoMask,
_In_ CLIPOBJ pco,
_In_opt_ XLATEOBJ pxlo,
_In_ PRECTL  prclTrg,
_In_opt_ PPOINTL  pptlSrc,
_In_opt_ PPOINTL  pptlMask,
_In_opt_ BRUSHOBJ pbo,
_In_opt_ PPOINTL  pptlBrush,
_In_ ROP4  rop4 
)

Definition at line 278 of file pandisp.c.

290 {
291  PPANDEV pandev;
292  BOOL res;
293 
294  if (psoTrg->iType == STYPE_DEVICE)
295  {
296  pandev = (PPANDEV)psoTrg->dhpdev;
297  psoTrg = pandev->psoShadow;
298  }
299  if (psoSrc && psoSrc->iType == STYPE_DEVICE)
300  {
301  pandev = (PPANDEV)psoSrc->dhpdev;
302  psoSrc = pandev->psoShadow;
303  }
304 
306 
307  /* FIXME: PanSynchronize must be called periodically, as we have the GCAPS2_SYNCTIMER flag.
308  * That's not the case, so call PanSynchronize() manually */
309  if (res)
311 
312  return res;
313 }
#define STYPE_DEVICE
Definition: lmshare.h:24
_In_opt_ SURFOBJ _In_opt_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL _In_opt_ POINTL _In_opt_ POINTL _In_opt_ BRUSHOBJ _In_opt_ POINTL _In_ ROP4 rop4
Definition: winddi.h:3433
_In_opt_ SURFOBJ _In_opt_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL * prclTrg
Definition: winddi.h:3433
BOOL APIENTRY PanSynchronize(_In_ DHPDEV dhpdev, _In_ PRECTL prcl)
Definition: pandisp.c:40
_In_ SURFOBJ * psoSrc
Definition: winddi.h:3414
unsigned int BOOL
Definition: ntddk_ex.h:94
SURFOBJ * psoShadow
Definition: pandisp.c:27
_In_opt_ SURFOBJ _In_opt_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL _In_opt_ POINTL _In_opt_ POINTL _In_opt_ BRUSHOBJ _In_opt_ POINTL * pptlBrush
Definition: winddi.h:3433
_In_opt_ SURFOBJ _In_opt_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL _In_opt_ POINTL _In_opt_ POINTL _In_opt_ BRUSHOBJ * pbo
Definition: winddi.h:3433
static DHPDEV gPan
Definition: pandisp.c:17
_In_ SURFOBJ _In_ CLIPOBJ * pco
Definition: winddi.h:3414
_In_opt_ SURFOBJ _In_opt_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL _In_opt_ POINTL _In_opt_ POINTL * pptlMask
Definition: winddi.h:3433
_In_opt_ SURFOBJ _In_opt_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL _In_opt_ POINTL * pptlSrc
Definition: winddi.h:3433
#define NULL
Definition: types.h:112
_In_opt_ SURFOBJ _In_opt_ SURFOBJ * psoMask
Definition: winddi.h:3433
struct _PANDEV * PPANDEV
GLuint res
Definition: glext.h:9613
ENGAPI BOOL APIENTRY EngBitBlt(_Inout_ SURFOBJ *psoTrg, _In_opt_ SURFOBJ *psoSrc, _In_opt_ SURFOBJ *psoMask, _In_opt_ CLIPOBJ *pco, _In_opt_ XLATEOBJ *pxlo, _In_ RECTL *prclTrg, _In_opt_ POINTL *pptlSrc, _In_opt_ POINTL *pptlMask, _In_opt_ BRUSHOBJ *pbo, _In_opt_ POINTL *pptlBrush, _In_ ROP4 rop4)
Definition: bitblt.c:328
_In_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ * pxlo
Definition: winddi.h:3414

Referenced by PanCopyBits().

◆ PanCompletePDEV()

VOID APIENTRY PanCompletePDEV ( _In_ DHPDEV  dhpdev,
_In_ HDEV  hdev 
)

Definition at line 140 of file pandisp.c.

143 {
144  PPANDEV pandev = (PPANDEV)dhpdev;
145 
146  DPRINT("PanCompletePDEV(%p %p)\n", dhpdev, hdev);
147 
148  pandev->hdev = hdev;
149  GETPFN(CompletePDEV)(pandev->dhpdevScreen, hdev);
150 }
HDEV hdev
Definition: pandisp.c:22
DHPDEV dhpdevScreen
Definition: pandisp.c:32
struct _PANDEV * PPANDEV
#define GETPFN(name)
Definition: pandisp.c:15
#define DPRINT
Definition: sndvol32.h:71
_In_ HDEV hdev
Definition: winddi.h:3449

◆ PanCopyBits()

BOOL APIENTRY PanCopyBits ( _Inout_ SURFOBJ psoDest,
_In_opt_ SURFOBJ psoSrc,
_In_ CLIPOBJ pco,
_In_opt_ XLATEOBJ pxlo,
_In_ PRECTL  prclDest,
_In_opt_ PPOINTL  pptlSrc 
)

Definition at line 317 of file pandisp.c.

324 {
325  /* Easy. Just call the more general function PanBitBlt */
326  return PanBitBlt(psoDest, psoSrc, NULL, pco, pxlo, prclDest, pptlSrc, NULL, NULL, NULL, ROP4_SRCCOPY);
327 }
BOOL APIENTRY PanBitBlt(_Inout_ SURFOBJ *psoTrg, _In_opt_ SURFOBJ *psoSrc, _In_opt_ SURFOBJ *psoMask, _In_ CLIPOBJ *pco, _In_opt_ XLATEOBJ *pxlo, _In_ PRECTL prclTrg, _In_opt_ PPOINTL pptlSrc, _In_opt_ PPOINTL pptlMask, _In_opt_ BRUSHOBJ *pbo, _In_opt_ PPOINTL pptlBrush, _In_ ROP4 rop4)
Definition: pandisp.c:278
_In_ SURFOBJ * psoSrc
Definition: winddi.h:3414
#define ROP4_SRCCOPY
Definition: dib.h:13
_In_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL * prclDest
Definition: winddi.h:3414
_In_ SURFOBJ _In_ CLIPOBJ * pco
Definition: winddi.h:3414
_In_opt_ SURFOBJ _In_opt_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL _In_opt_ POINTL * pptlSrc
Definition: winddi.h:3433
#define NULL
Definition: types.h:112
_In_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ * pxlo
Definition: winddi.h:3414

◆ PanDisablePDEV()

VOID APIENTRY PanDisablePDEV ( _In_ DHPDEV  dhpdev)

Definition at line 154 of file pandisp.c.

156 {
157  PPANDEV pandev = (PPANDEV)dhpdev;
158 
159  DPRINT("PanDisablePDEV(%p)\n", dhpdev);
160 
161  GETPFN(DisablePDEV)(pandev->dhpdevScreen);
162  EngFreeMem(pandev);
163 }
#define EngFreeMem
Definition: polytest.cpp:56
DHPDEV dhpdevScreen
Definition: pandisp.c:32
struct _PANDEV * PPANDEV
#define GETPFN(name)
Definition: pandisp.c:15
#define DPRINT
Definition: sndvol32.h:71

◆ PanDisableSurface()

VOID APIENTRY PanDisableSurface ( _In_ DHPDEV  dhpdev)

Definition at line 167 of file pandisp.c.

169 {
170  PPANDEV pandev = (PPANDEV)dhpdev;
171 
172  DPRINT("PanDisableSurface(%p)\n", dhpdev);
173 
174  /* Note that we must handle a not fully initialized pandev, as this
175  * function is also called from PanEnableSurface in case of error. */
176 
177  if (pandev->psoShadow)
178  {
179  EngUnlockSurface(pandev->psoShadow);
180  pandev->psoShadow = NULL;
181  }
182  if (pandev->hsurfShadow)
183  {
184  EngDeleteSurface(pandev->hsurfShadow);
185  pandev->hsurfShadow = NULL;
186  }
187  if (pandev->hsurf)
188  {
189  EngDeleteSurface(pandev->hsurf);
190  pandev->hsurf = NULL;
191  }
192  if (pandev->surfObjScreen)
193  {
195  pandev->surfObjScreen = NULL;
196  }
197  if (pandev->enabledScreen)
198  {
199  GETPFN(DisableSurface)(pandev->dhpdevScreen);
200  pandev->enabledScreen = FALSE;
201  }
202 }
HSURF hsurf
Definition: pandisp.c:25
ENGAPI BOOL APIENTRY EngDeleteSurface(_In_ _Post_ptr_invalid_ HSURF hsurf)
Definition: surface.c:567
HSURF hsurfShadow
Definition: pandisp.c:26
#define FALSE
Definition: types.h:117
SURFOBJ * psoShadow
Definition: pandisp.c:27
SURFOBJ * surfObjScreen
Definition: pandisp.c:34
DHPDEV dhpdevScreen
Definition: pandisp.c:32
BOOL enabledScreen
Definition: pandisp.c:33
ENGAPI VOID APIENTRY EngUnlockSurface(_In_ _Post_ptr_invalid_ SURFOBJ *pso)
Definition: surface.c:628
#define NULL
Definition: types.h:112
struct _PANDEV * PPANDEV
#define GETPFN(name)
Definition: pandisp.c:15
#define DPRINT
Definition: sndvol32.h:71

Referenced by PanEnableSurface().

◆ PanEnablePDEV()

DHPDEV APIENTRY PanEnablePDEV ( _In_ PDEVMODEW  pdm,
_In_ LPWSTR  pwszLogAddress,
_In_ ULONG  cPat,
_In_reads_opt_(cPat) HSURF phsurfPatterns,
_In_ ULONG  cjCaps,
_Out_writes_bytes_(cjCaps) PULONG  pdevcaps,
_In_ ULONG  cjDevInfo,
_Out_writes_bytes_(cjDevInfo) PDEVINFO  pdi,
_In_ HDEV  hdev,
_In_ LPWSTR  pwszDeviceName,
_In_ HANDLE  hDriver 
)

Definition at line 62 of file pandisp.c.

74 {
75  PPANDEV pandev;
76  PPDEVOBJ ppdev = (PPDEVOBJ)hdev;
77  DEVMODEW underlyingDevmode;
78  PGDIINFO pGdiInfo = (PGDIINFO)pdevcaps;
79 
80  DPRINT("PanEnablePDEV(ppdev %p %dx%dx%d -> %dx%dx%d %d Hz)\n",
81  ppdev,
82  pdm->dmPelsWidth, pdm->dmPelsHeight, pdm->dmBitsPerPel,
83  pdm->dmPanningWidth, pdm->dmPanningHeight, pdm->dmBitsPerPel, pdm->dmDisplayFrequency);
84 
85  ASSERT(pdm->dmPanningWidth <= pdm->dmPelsWidth && pdm->dmPanningHeight <= pdm->dmPelsHeight);
86 
87  /* Allocate PANDEV */
88  pandev = EngAllocMem(FL_ZERO_MEMORY, sizeof(PANDEV), TAG_PAN);
89  if (!pandev)
90  {
91  DPRINT1("Failed to allocate memory\n");
92  return NULL;
93  }
94 
95  /* Copy device pointers to our structure (do not copy ppdev->apfn,
96  * as it contains our local pointers!) */
97  RtlCopyMemory(pandev->apfn, ppdev->pldev->apfn, sizeof(pandev->apfn));
98 
99  /* Enable underlying PDEV */
100  underlyingDevmode = *pdm;
101  underlyingDevmode.dmPelsWidth = pdm->dmPanningWidth;
102  underlyingDevmode.dmPelsHeight = pdm->dmPanningHeight;
103  pandev->dhpdevScreen = GETPFN(EnablePDEV)(&underlyingDevmode,
105  cPat,
106  phsurfPatterns,
107  cjCaps,
108  pdevcaps,
109  cjDevInfo,
110  pdi,
111  hdev,
113  hDriver);
114  if (!pandev->dhpdevScreen)
115  {
116  DPRINT1("Failed to enable underlying PDEV\n");
117  EngFreeMem(pandev);
118  return NULL;
119  }
120 
121  pandev->iBitmapFormat = pdi->iDitherFormat;
122  pandev->szlDesktop.cx = pdm->dmPelsWidth;
123  pandev->szlDesktop.cy = pdm->dmPelsHeight;
124  pandev->szlScreen.cx = pdm->dmPanningWidth;
125  pandev->szlScreen.cy = pdm->dmPanningHeight;
126  pandev->flUnderlyingGraphicsCaps = pdi->flGraphicsCaps;
127 
128  /* Upgrade some capabilities */
129  pGdiInfo->ulHorzRes = pdm->dmPelsWidth;
130  pGdiInfo->ulVertRes = pdm->dmPelsHeight;
131  pdi->flGraphicsCaps |= GCAPS_PANNING;
132  pdi->flGraphicsCaps2 = GCAPS2_SYNCFLUSH | GCAPS2_SYNCTIMER;
133 
134  gPan = (DHPDEV)pandev;
135  return (DHPDEV)pandev;
136 }
ULONG flUnderlyingGraphicsCaps
Definition: pandisp.c:30
typedef DHPDEV(APIENTRY FN_DrvEnablePDEV)(_In_ DEVMODEW *pdm
#define GCAPS2_SYNCTIMER
Definition: winddi.h:373
struct _LDEVOBJ * pldev
Definition: pdevobj.h:119
#define EngFreeMem
Definition: polytest.cpp:56
_In_ LPWSTR _In_ ULONG _In_ ULONG _In_ ULONG _Out_ DEVINFO _In_ HDEV _In_ LPWSTR _In_ HANDLE hDriver
Definition: winddi.h:3553
ULONG iBitmapFormat
Definition: pandisp.c:21
SIZEL szlDesktop
Definition: pandisp.c:23
#define TAG_PAN
Definition: pandisp.c:14
struct _GDIINFO * PGDIINFO
ULONG ulHorzRes
Definition: winddi.h:882
LONG cx
Definition: windef.h:334
struct _PDEVOBJ * PPDEVOBJ
Definition: mdevobj.h:6
#define GCAPS_PANNING
Definition: winddi.h:339
#define ASSERT(a)
Definition: mode.c:44
static DHPDEV gPan
Definition: pandisp.c:17
DHPDEV dhpdevScreen
Definition: pandisp.c:32
PFN apfn[INDEX_LAST]
Definition: pandisp.c:35
_In_ LPWSTR pwszLogAddress
Definition: winddi.h:3548
DWORD dmPelsWidth
Definition: wingdi.h:1648
void * EngAllocMem(int zero, unsigned long size, int tag=0)
Definition: polytest.cpp:70
#define FL_ZERO_MEMORY
Definition: polytest.cpp:58
SIZEL szlScreen
Definition: pandisp.c:31
_In_ LPWSTR _In_ ULONG _In_ ULONG _In_ ULONG _Out_ DEVINFO _In_ HDEV _In_ LPWSTR pwszDeviceName
Definition: winddi.h:3553
#define GCAPS2_SYNCFLUSH
Definition: winddi.h:372
_In_ LPWSTR _In_ ULONG cPat
Definition: winddi.h:3548
_In_ LPWSTR _In_ ULONG _In_ ULONG _In_ ULONG cjDevInfo
Definition: winddi.h:3553
#define NULL
Definition: types.h:112
#define DPRINT1
Definition: precomp.h:8
DWORD dmPelsHeight
Definition: wingdi.h:1649
_In_ LPWSTR _In_ ULONG _In_ ULONG cjCaps
Definition: winddi.h:3551
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define GETPFN(name)
Definition: pandisp.c:15
ULONG ulVertRes
Definition: winddi.h:883
#define DPRINT
Definition: sndvol32.h:71
LONG cy
Definition: windef.h:335
_In_ HDEV hdev
Definition: winddi.h:3449
_In_ LPWSTR _In_ ULONG _In_ ULONG _In_ ULONG _Out_ DEVINFO * pdi
Definition: winddi.h:3553

◆ PanEnableSurface()

HSURF APIENTRY PanEnableSurface ( _In_ DHPDEV  dhpdev)

Definition at line 206 of file pandisp.c.

208 {
209  PPANDEV pandev = (PPANDEV)dhpdev;
210  HSURF surfScreen;
211 
212  /* Move viewport to center of screen */
213  pandev->rclViewport.left = (pandev->szlDesktop.cx - pandev->szlScreen.cx) / 2;
214  pandev->rclViewport.top = (pandev->szlDesktop.cy - pandev->szlScreen.cy) / 2;
215  pandev->rclViewport.right = pandev->rclViewport.left + pandev->szlScreen.cx;
216  pandev->rclViewport.bottom = pandev->rclViewport.top + pandev->szlScreen.cy;
217 
218  /* Enable underlying device */
219  surfScreen = GETPFN(EnableSurface)(pandev->dhpdevScreen);
220  if (!surfScreen)
221  {
222  DPRINT1("Failed to enable underlying surface\n");
223  goto failure;
224  }
225  pandev->enabledScreen = TRUE;
226 
227  pandev->surfObjScreen = EngLockSurface(surfScreen);
228  if (!pandev->surfObjScreen)
229  {
230  DPRINT1("Failed to lock underlying surface\n");
231  goto failure;
232  }
233 
234  /* Create device surface */
235  pandev->hsurf = EngCreateDeviceSurface(NULL, pandev->szlDesktop, pandev->iBitmapFormat);
236  if (!pandev->hsurf)
237  {
238  DPRINT1("EngCreateDeviceSurface() failed\n");
239  goto failure;
240  }
241 
242  if (!EngAssociateSurface(pandev->hsurf, pandev->hdev, HOOK_ALPHABLEND |
243  HOOK_BITBLT |
244  HOOK_COPYBITS |
248  HOOK_TEXTOUT))
249  {
250  DPRINT1("EngAssociateSurface() failed\n");
251  goto failure;
252  }
253 
254  /* Create shadow surface */
255  pandev->hsurfShadow = (HSURF)EngCreateBitmap(pandev->szlDesktop, pandev->szlDesktop.cx, pandev->iBitmapFormat, BMF_TOPDOWN, NULL);
256  if (!pandev->hsurfShadow)
257  {
258  DPRINT1("EngCreateBitmap() failed\n");
259  goto failure;
260  }
261 
262  pandev->psoShadow = EngLockSurface(pandev->hsurfShadow);
263  if (!pandev->psoShadow)
264  {
265  DPRINT1("EngLockSurface() failed\n");
266  goto failure;
267  }
268 
269  return pandev->hsurf;
270 
271 failure:
272  PanDisableSurface(dhpdev);
273  return NULL;
274 }
HSURF hsurf
Definition: pandisp.c:25
HDEV hdev
Definition: pandisp.c:22
#define TRUE
Definition: types.h:120
HSURF hsurfShadow
Definition: pandisp.c:26
#define BMF_TOPDOWN
Definition: winddi.h:1180
long bottom
Definition: polytest.cpp:53
ULONG iBitmapFormat
Definition: pandisp.c:21
SIZEL szlDesktop
Definition: pandisp.c:23
#define HOOK_GRADIENTFILL
Definition: winddi.h:1436
#define HOOK_ALPHABLEND
Definition: winddi.h:1435
long right
Definition: polytest.cpp:53
long top
Definition: polytest.cpp:53
SURFOBJ * psoShadow
Definition: pandisp.c:27
LONG cx
Definition: windef.h:334
long left
Definition: polytest.cpp:53
SURFOBJ * surfObjScreen
Definition: pandisp.c:34
typedef HSURF(APIENTRY FN_DrvEnableSurface)(_In_ DHPDEV dhpdev)
#define HOOK_TEXTOUT
Definition: winddi.h:1423
RECTL rclViewport
Definition: pandisp.c:24
#define HOOK_BITBLT
Definition: winddi.h:1420
DHPDEV dhpdevScreen
Definition: pandisp.c:32
ENGAPI SURFOBJ *APIENTRY EngLockSurface(_In_ HSURF hsurf)
Definition: surface.c:607
BOOL enabledScreen
Definition: pandisp.c:33
#define HOOK_SYNCHRONIZE
Definition: winddi.h:1431
ENGAPI BOOL APIENTRY EngAssociateSurface(_In_ HSURF hsurf, _In_ HDEV hdev, _In_ FLONG flHooks)
Definition: surface.c:431
SIZEL szlScreen
Definition: pandisp.c:31
#define HOOK_COPYBITS
Definition: winddi.h:1429
#define NULL
Definition: types.h:112
struct _PANDEV * PPANDEV
#define DPRINT1
Definition: precomp.h:8
_Must_inspect_result_ ENGAPI HSURF APIENTRY EngCreateDeviceSurface(_In_ DHSURF dhsurf, _In_ SIZEL sizl, _In_ ULONG iFormatCompat)
Definition: surface.c:391
#define GETPFN(name)
Definition: pandisp.c:15
#define HOOK_STROKEPATH
Definition: winddi.h:1425
LONG cy
Definition: windef.h:335
ENGAPI HBITMAP APIENTRY EngCreateBitmap(_In_ SIZEL sizl, _In_ LONG lWidth, _In_ ULONG iFormat, _In_ FLONG fl, _In_opt_ PVOID pvBits)
VOID APIENTRY PanDisableSurface(_In_ DHPDEV dhpdev)
Definition: pandisp.c:167

◆ PanGradientFill()

BOOL APIENTRY PanGradientFill ( _Inout_ SURFOBJ pso,
_In_ CLIPOBJ pco,
_In_opt_ XLATEOBJ pxlo,
_In_ PTRIVERTEX  pVertex,
_In_ ULONG  nVertex,
_In_ PVOID  pMesh,
_In_ ULONG  nMesh,
_In_ PRECTL  prclExtents,
_In_ PPOINTL  pptlDitherOrg,
_In_ ULONG  ulMode 
)

Definition at line 452 of file pandisp.c.

463 {
464  PPANDEV pandev = (PPANDEV)pso->dhpdev;
465  BOOL res;
466 
468 
469  /* FIXME: PanSynchronize must be called periodically, as we have the GCAPS2_SYNCTIMER flag.
470  * That's not the case, so call PanSynchronize() manually */
471  if (res)
473 
474  return res;
475 }
_In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ TRIVERTEX _In_ ULONG _In_ PVOID _In_ ULONG nMesh
Definition: winddi.h:3649
_In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ TRIVERTEX _In_ ULONG _In_ PVOID pMesh
Definition: winddi.h:3649
_In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ TRIVERTEX _In_ ULONG _In_ PVOID _In_ ULONG _In_ RECTL * prclExtents
Definition: winddi.h:3649
BOOL APIENTRY PanSynchronize(_In_ DHPDEV dhpdev, _In_ PRECTL prcl)
Definition: pandisp.c:40
unsigned int BOOL
Definition: ntddk_ex.h:94
SURFOBJ * psoShadow
Definition: pandisp.c:27
_In_ HANDLE _In_ SURFOBJ * pso
Definition: winddi.h:3664
_In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ TRIVERTEX * pVertex
Definition: winddi.h:3649
static DHPDEV gPan
Definition: pandisp.c:17
_In_ SURFOBJ _In_ CLIPOBJ * pco
Definition: winddi.h:3414
_In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ TRIVERTEX _In_ ULONG _In_ PVOID _In_ ULONG _In_ RECTL _In_ POINTL _In_ ULONG ulMode
Definition: winddi.h:3649
ENGAPI BOOL APIENTRY EngGradientFill(_Inout_ SURFOBJ *psoDest, _In_ CLIPOBJ *pco, _In_opt_ XLATEOBJ *pxlo, _In_ TRIVERTEX *pVertex, _In_ ULONG nVertex, _In_ PVOID pMesh, _In_ ULONG nMesh, _In_ RECTL *prclExtents, _In_ POINTL *pptlDitherOrg, _In_ ULONG ulMode)
Definition: gradient.c:475
#define NULL
Definition: types.h:112
struct _PANDEV * PPANDEV
GLuint res
Definition: glext.h:9613
_In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ TRIVERTEX _In_ ULONG nVertex
Definition: winddi.h:3649
_In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ TRIVERTEX _In_ ULONG _In_ PVOID _In_ ULONG _In_ RECTL _In_ POINTL * pptlDitherOrg
Definition: winddi.h:3649
_In_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ * pxlo
Definition: winddi.h:3414

◆ PanMovePointer()

VOID APIENTRY PanMovePointer ( _Inout_ SURFOBJ pso,
_In_ LONG  x,
_In_ LONG  y,
_In_ PRECTL  prcl 
)

Definition at line 367 of file pandisp.c.

372 {
373  PPANDEV pandev = (PPANDEV)pso->dhpdev;
374  PFN_DrvMovePointer pfnMovePointer;
375  BOOL bChanged = FALSE;
376 
377  DPRINT("PanMovePointer(%d, %d)\n", x, y);
378 
379  /* FIXME: MouseSafetyOnDrawStart/MouseSafetyOnDrawEnd like to call us to hide/show the cursor,
380  * without real reason (see 5b0f6dcceeae3cf21f2535e2c523c0bf2749ea6b). Ignore those calls */
381  if (x < 0 || y >= 0) return;
382 
383  /* We don't set DrvSetPointerShape, so we must not be called
384  * with x < 0 (hide cursor) or y >= 0 (we have GCAPS_PANNING) */
385  ASSERT(x >= 0 && y < 0);
386 
387  /* Call underlying MovePointer function */
389  {
390  pfnMovePointer = GETPFN(MovePointer);
391  if (pfnMovePointer)
392  pfnMovePointer(pandev->surfObjScreen, x, y, prcl);
393  }
394 
395  y += pso->sizlBitmap.cy;
396 
397  if (x < pandev->rclViewport.left)
398  {
399  pandev->rclViewport.left = x;
400  pandev->rclViewport.right = x + pandev->szlScreen.cx;
401  bChanged = TRUE;
402  }
403  else if (x >= pandev->rclViewport.right)
404  {
405  pandev->rclViewport.right = x + 1;
406  pandev->rclViewport.left = x - pandev->szlScreen.cx;
407  bChanged = TRUE;
408  }
409  if (y < pandev->rclViewport.top)
410  {
411  pandev->rclViewport.top = y;
412  pandev->rclViewport.bottom = y + pandev->szlScreen.cy;
413  bChanged = TRUE;
414  }
415  else if (y >= pandev->rclViewport.bottom)
416  {
417  pandev->rclViewport.bottom = y + 1;
418  pandev->rclViewport.top = y - pandev->szlScreen.cy;
419  bChanged = TRUE;
420  }
421 
422  if (bChanged)
423  PanSynchronize(pso->dhpdev, NULL);
424 }
ULONG flUnderlyingGraphicsCaps
Definition: pandisp.c:30
#define TRUE
Definition: types.h:120
long bottom
Definition: polytest.cpp:53
FN_DrvMovePointer * PFN_DrvMovePointer
Definition: winddi.h:3735
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
BOOL APIENTRY PanSynchronize(_In_ DHPDEV dhpdev, _In_ PRECTL prcl)
Definition: pandisp.c:40
long right
Definition: polytest.cpp:53
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
long top
Definition: polytest.cpp:53
LONG cx
Definition: windef.h:334
long left
Definition: polytest.cpp:53
SURFOBJ * surfObjScreen
Definition: pandisp.c:34
_In_ HANDLE _In_ SURFOBJ * pso
Definition: winddi.h:3664
#define GCAPS_PANNING
Definition: winddi.h:339
RECTL rclViewport
Definition: pandisp.c:24
#define ASSERT(a)
Definition: mode.c:44
SIZEL szlScreen
Definition: pandisp.c:31
#define NULL
Definition: types.h:112
struct _PANDEV * PPANDEV
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
_In_ ULONG _In_ CLIPOBJ _In_ RECTL * prcl
Definition: winddi.h:3529
#define GETPFN(name)
Definition: pandisp.c:15
#define DPRINT
Definition: sndvol32.h:71
LONG cy
Definition: windef.h:335

◆ PanStrokePath()

BOOL APIENTRY PanStrokePath ( _Inout_ SURFOBJ pso,
_In_ PATHOBJ ppo,
_In_ CLIPOBJ pco,
_In_opt_ XFORMOBJ pxo,
_In_ BRUSHOBJ pbo,
_In_ PPOINTL  pptlBrushOrg,
_In_ PLINEATTRS  plineattrs,
_In_ MIX  mix 
)

Definition at line 331 of file pandisp.c.

340 {
342  ASSERT(FALSE);
343  return FALSE;
344 }
#define FALSE
Definition: types.h:117
#define ASSERT(a)
Definition: mode.c:44
#define UNIMPLEMENTED
Definition: debug.h:115

◆ PanSynchronize()

BOOL APIENTRY PanSynchronize ( _In_ DHPDEV  dhpdev,
_In_ PRECTL  prcl 
)

Definition at line 40 of file pandisp.c.

43 {
44  PPANDEV pandev = (PPANDEV)dhpdev;
45  RECTL rclDest;
46  POINTL ptlSrc;
47 
48  /* FIXME: for now, copy the whole shadow buffer. We might try to optimize that */
49 
50  ptlSrc.x = pandev->rclViewport.left;
51  ptlSrc.y = pandev->rclViewport.top;
52 
53  rclDest.top = rclDest.left = 0;
54  rclDest.bottom = pandev->szlScreen.cy;
55  rclDest.right = pandev->szlScreen.cx;
56 
57  return EngCopyBits(pandev->surfObjScreen, pandev->psoShadow, NULL, NULL, &rclDest, &ptlSrc);
58 }
long bottom
Definition: polytest.cpp:53
LONG y
Definition: windef.h:330
long right
Definition: polytest.cpp:53
long top
Definition: polytest.cpp:53
SURFOBJ * psoShadow
Definition: pandisp.c:27
LONG cx
Definition: windef.h:334
long left
Definition: polytest.cpp:53
SURFOBJ * surfObjScreen
Definition: pandisp.c:34
RECTL rclViewport
Definition: pandisp.c:24
LONG x
Definition: windef.h:329
SIZEL szlScreen
Definition: pandisp.c:31
ENGAPI BOOL APIENTRY EngCopyBits(_In_ SURFOBJ *psoDest, _In_ SURFOBJ *psoSrc, _In_opt_ CLIPOBJ *pco, _In_opt_ XLATEOBJ *pxlo, _In_ __in_data_source(USER_MODE) RECTL *prclDest, _In_ __in_data_source(USER_MODE) POINTL *pptlSrc)
#define NULL
Definition: types.h:112
struct _PANDEV * PPANDEV
LONG cy
Definition: windef.h:335

Referenced by PanAlphaBlend(), PanBitBlt(), PanGradientFill(), and PanMovePointer().

◆ PanTextOut()

BOOL APIENTRY PanTextOut ( _Inout_ SURFOBJ pso,
_In_ STROBJ pstro,
_In_ FONTOBJ pfo,
_In_ CLIPOBJ pco,
_In_opt_ PRECTL  prclExtra,
_In_opt_ PRECTL  prclOpaque,
_In_ BRUSHOBJ pboFore,
_In_ BRUSHOBJ pboOpaque,
_In_ PPOINTL  pptlOrg,
_In_ MIX  mix 
)

Definition at line 348 of file pandisp.c.

359 {
361  ASSERT(FALSE);
362  return FALSE;
363 }
#define FALSE
Definition: types.h:117
#define ASSERT(a)
Definition: mode.c:44
#define UNIMPLEMENTED
Definition: debug.h:115

Variable Documentation

◆ gPan

DHPDEV gPan
static

Definition at line 17 of file pandisp.c.

Referenced by PanAlphaBlend(), PanBitBlt(), PanEnablePDEV(), and PanGradientFill().

◆ gPanDispDrvCount

ULONG gPanDispDrvCount = RTL_NUMBER_OF(gPanDispDrvFn)

Definition at line 501 of file pandisp.c.

Referenced by PDEVOBJ_Create().

◆ gPanDispDrvFn

DRVFN gPanDispDrvFn[]
Initial value:
=
{
}
#define INDEX_DrvStrokePath
Definition: winddi.h:430
BOOL APIENTRY PanStrokePath(_Inout_ SURFOBJ *pso, _In_ PATHOBJ *ppo, _In_ CLIPOBJ *pco, _In_opt_ XFORMOBJ *pxo, _In_ BRUSHOBJ *pbo, _In_ PPOINTL pptlBrushOrg, _In_ PLINEATTRS plineattrs, _In_ MIX mix)
Definition: pandisp.c:331
#define INDEX_DrvCompletePDEV
Definition: winddi.h:417
#define INDEX_DrvEnablePDEV
Definition: winddi.h:416
BOOL APIENTRY PanTextOut(_Inout_ SURFOBJ *pso, _In_ STROBJ *pstro, _In_ FONTOBJ *pfo, _In_ CLIPOBJ *pco, _In_opt_ PRECTL prclExtra, _In_opt_ PRECTL prclOpaque, _In_ BRUSHOBJ *pboFore, _In_ BRUSHOBJ *pboOpaque, _In_ PPOINTL pptlOrg, _In_ MIX mix)
Definition: pandisp.c:348
BOOL APIENTRY PanBitBlt(_Inout_ SURFOBJ *psoTrg, _In_opt_ SURFOBJ *psoSrc, _In_opt_ SURFOBJ *psoMask, _In_ CLIPOBJ *pco, _In_opt_ XLATEOBJ *pxlo, _In_ PRECTL prclTrg, _In_opt_ PPOINTL pptlSrc, _In_opt_ PPOINTL pptlMask, _In_opt_ BRUSHOBJ *pbo, _In_opt_ PPOINTL pptlBrush, _In_ ROP4 rop4)
Definition: pandisp.c:278
BOOL APIENTRY PanSynchronize(_In_ DHPDEV dhpdev, _In_ PRECTL prcl)
Definition: pandisp.c:40
VOID APIENTRY PanCompletePDEV(_In_ DHPDEV dhpdev, _In_ HDEV hdev)
Definition: pandisp.c:140
BOOL APIENTRY PanGradientFill(_Inout_ SURFOBJ *pso, _In_ CLIPOBJ *pco, _In_opt_ XLATEOBJ *pxlo, _In_ PTRIVERTEX pVertex, _In_ ULONG nVertex, _In_ PVOID pMesh, _In_ ULONG nMesh, _In_ PRECTL prclExtents, _In_ PPOINTL pptlDitherOrg, _In_ ULONG ulMode)
Definition: pandisp.c:452
BOOL APIENTRY PanAlphaBlend(_Inout_ SURFOBJ *psoDest, _In_ SURFOBJ *psoSrc, _In_ CLIPOBJ *pco, _In_opt_ XLATEOBJ *pxlo, _In_ PRECTL prclDest, _In_ PRECTL prclSrc, _In_ BLENDOBJ *pBlendObj)
Definition: pandisp.c:428
DHPDEV APIENTRY PanEnablePDEV(_In_ PDEVMODEW pdm, _In_ LPWSTR pwszLogAddress, _In_ ULONG cPat, _In_reads_opt_(cPat) HSURF *phsurfPatterns, _In_ ULONG cjCaps, _Out_writes_bytes_(cjCaps) PULONG pdevcaps, _In_ ULONG cjDevInfo, _Out_writes_bytes_(cjDevInfo) PDEVINFO pdi, _In_ HDEV hdev, _In_ LPWSTR pwszDeviceName, _In_ HANDLE hDriver)
Definition: pandisp.c:62
VOID APIENTRY PanMovePointer(_Inout_ SURFOBJ *pso, _In_ LONG x, _In_ LONG y, _In_ PRECTL prcl)
Definition: pandisp.c:367
#define INDEX_DrvDisableSurface
Definition: winddi.h:420
#define INDEX_DrvBitBlt
Definition: winddi.h:434
#define INDEX_DrvEnableSurface
Definition: winddi.h:419
HSURF APIENTRY PanEnableSurface(_In_ DHPDEV dhpdev)
Definition: pandisp.c:206
BOOLEAN(* PFN)(PARGS)
Definition: parse.h:47
#define INDEX_DrvAlphaBlend
Definition: winddi.h:487
VOID APIENTRY PanDisablePDEV(_In_ DHPDEV dhpdev)
Definition: pandisp.c:154
#define INDEX_DrvTextOut
Definition: winddi.h:439
#define INDEX_DrvDisablePDEV
Definition: winddi.h:418
#define INDEX_DrvMovePointer
Definition: winddi.h:446
#define INDEX_DrvCopyBits
Definition: winddi.h:435
#define INDEX_DrvSynchronize
Definition: winddi.h:454
BOOL APIENTRY PanCopyBits(_Inout_ SURFOBJ *psoDest, _In_opt_ SURFOBJ *psoSrc, _In_ CLIPOBJ *pco, _In_opt_ XLATEOBJ *pxlo, _In_ PRECTL prclDest, _In_opt_ PPOINTL pptlSrc)
Definition: pandisp.c:317
VOID APIENTRY PanDisableSurface(_In_ DHPDEV dhpdev)
Definition: pandisp.c:167
#define INDEX_DrvGradientFill
Definition: winddi.h:484

Definition at line 477 of file pandisp.c.

Referenced by PDEVOBJ_Create().