VirtualBox

source: vbox/trunk/src/VBox/Main/include/DisplayImpl.h@ 51552

Last change on this file since 51552 was 51552, checked in by vboxsync, 11 years ago

Main: removed obsolete GetFramebuffer, updateDisplayData methods.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 19.1 KB
Line 
1/* $Id: DisplayImpl.h 51552 2014-06-05 12:33:13Z vboxsync $ */
2/** @file
3 * VirtualBox COM class implementation
4 */
5
6/*
7 * Copyright (C) 2006-2014 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.215389.xyz. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef ____H_DISPLAYIMPL
19#define ____H_DISPLAYIMPL
20
21#include "VirtualBoxBase.h"
22#include "SchemaDefs.h"
23
24#include <iprt/semaphore.h>
25#include <VBox/vmm/pdmdrv.h>
26#include <VBox/VMMDev.h>
27#include <VBox/VBoxVideo.h>
28#include <VBox/vmm/pdmifs.h>
29
30#ifdef VBOX_WITH_CROGL
31# include <VBox/HostServices/VBoxCrOpenGLSvc.h>
32#endif
33
34#include "DisplaySourceBitmapWrap.h"
35
36class Console;
37struct VIDEORECCONTEXT;
38
39enum
40{
41 ResizeStatus_Void,
42 ResizeStatus_InProgress,
43 ResizeStatus_UpdateDisplayData
44};
45
46typedef struct _DISPLAYFBINFO
47{
48 uint32_t u32Offset;
49 uint32_t u32MaxFramebufferSize;
50 uint32_t u32InformationSize;
51
52 ComPtr<IFramebuffer> pFramebuffer;
53 ComPtr<IDisplaySourceBitmap> pSourceBitmap;
54 bool fDisabled;
55
56 LONG xOrigin;
57 LONG yOrigin;
58
59 ULONG w;
60 ULONG h;
61
62 uint16_t u16BitsPerPixel;
63 uint8_t *pu8FramebufferVRAM;
64 uint32_t u32LineSize;
65
66 uint16_t flags;
67
68 /** For saving the rectangles arrived during fb resize is in progress. */
69 PRTRECT mpSavedVisibleRegion;
70 uint32_t mcSavedVisibleRegion;
71
72 VBOXVIDEOINFOHOSTEVENTS *pHostEvents;
73
74 volatile uint32_t u32ResizeStatus;
75
76 /** The framebuffer has default format and must be updates immediately. */
77 bool fDefaultFormat;
78
79 struct
80 {
81 /* The rectangle that includes all dirty rectangles. */
82 int32_t xLeft;
83 int32_t xRight;
84 int32_t yTop;
85 int32_t yBottom;
86 } dirtyRect;
87
88 struct
89 {
90 bool fPending;
91 ULONG pixelFormat;
92 void *pvVRAM;
93 uint32_t bpp;
94 uint32_t cbLine;
95 uint32_t w;
96 uint32_t h;
97 uint16_t flags;
98 } pendingResize;
99
100#ifdef VBOX_WITH_HGSMI
101 bool fVBVAEnabled;
102 bool fVBVAForceResize;
103 bool fRenderThreadMode;
104 uint32_t cVBVASkipUpdate;
105 struct
106 {
107 int32_t xLeft;
108 int32_t yTop;
109 int32_t xRight;
110 int32_t yBottom;
111 } vbvaSkippedRect;
112 PVBVAHOSTFLAGS pVBVAHostFlags;
113#endif /* VBOX_WITH_HGSMI */
114
115#ifdef VBOX_WITH_CROGL
116 struct
117 {
118 bool fPending;
119 ULONG x;
120 ULONG y;
121 ULONG width;
122 ULONG height;
123 } pendingViewportInfo;
124#endif /* VBOX_WITH_CROGL */
125} DISPLAYFBINFO;
126
127class DisplayMouseInterface
128{
129public:
130 virtual int getScreenResolution(uint32_t cScreen, ULONG *pcx,
131 ULONG *pcy, ULONG *pcBPP, LONG *pXOrigin, LONG *pYOrigin) = 0;
132 virtual void getFramebufferDimensions(int32_t *px1, int32_t *py1,
133 int32_t *px2, int32_t *py2) = 0;
134};
135
136class VMMDev;
137
138class ATL_NO_VTABLE Display :
139 public VirtualBoxBase,
140 VBOX_SCRIPTABLE_IMPL(IEventListener),
141 VBOX_SCRIPTABLE_IMPL(IDisplay),
142 public DisplayMouseInterface
143{
144public:
145
146 VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(Display, IDisplay)
147
148 DECLARE_NOT_AGGREGATABLE(Display)
149
150 DECLARE_PROTECT_FINAL_CONSTRUCT()
151
152 BEGIN_COM_MAP(Display)
153 VBOX_DEFAULT_INTERFACE_ENTRIES(IDisplay)
154 COM_INTERFACE_ENTRY(IEventListener)
155 END_COM_MAP()
156
157 DECLARE_EMPTY_CTOR_DTOR(Display)
158
159 HRESULT FinalConstruct();
160 void FinalRelease();
161
162 // public initializer/uninitializer for internal purposes only
163 HRESULT init(Console *aParent);
164 void uninit();
165 int registerSSM(PUVM pUVM);
166
167 // public methods only for internal purposes
168 int handleDisplayResize(unsigned uScreenId, uint32_t bpp, void *pvVRAM, uint32_t cbLine, uint32_t w, uint32_t h, uint16_t flags);
169 void handleDisplayUpdateLegacy(int x, int y, int cx, int cy);
170 void handleDisplayUpdate(unsigned uScreenId, int x, int y, int w, int h);
171#ifdef VBOX_WITH_VIDEOHWACCEL
172 int handleVHWACommandProcess(PVBOXVHWACMD pCommand);
173#endif
174#ifdef VBOX_WITH_CRHGSMI
175 void handleCrHgsmiCommandCompletion(int32_t result, uint32_t u32Function, PVBOXHGCMSVCPARM pParam);
176 void handleCrHgsmiControlCompletion(int32_t result, uint32_t u32Function, PVBOXHGCMSVCPARM pParam);
177 void handleCrHgsmiCommandProcess(PVBOXVDMACMD_CHROMIUM_CMD pCmd, uint32_t cbCmd);
178 void handleCrHgsmiControlProcess(PVBOXVDMACMD_CHROMIUM_CTL pCtl, uint32_t cbCtl);
179#endif
180#if defined(VBOX_WITH_HGCM) && defined(VBOX_WITH_CROGL)
181 int handleCrHgcmCtlSubmit(struct VBOXCRCMDCTL* pCmd, uint32_t cbCmd,
182 PFNCRCTLCOMPLETION pfnCompletion,
183 void *pvCompletion);
184 void handleCrVRecScreenshotPerform(uint32_t uScreen,
185 uint32_t x, uint32_t y, uint32_t uPixelFormat, uint32_t uBitsPerPixel,
186 uint32_t uBytesPerLine, uint32_t uGuestWidth, uint32_t uGuestHeight,
187 uint8_t *pu8BufferAddress, uint64_t u64TimeStamp);
188 bool handleCrVRecScreenshotBegin(uint32_t uScreen, uint64_t u64TimeStamp);
189 void handleCrVRecScreenshotEnd(uint32_t uScreen, uint64_t u64TimeStamp);
190 void handleVRecCompletion(int32_t result, uint32_t u32Function, PVBOXHGCMSVCPARM pParam, void *pvContext);
191#endif
192
193 int notifyCroglResize(const PVBVAINFOVIEW pView, const PVBVAINFOSCREEN pScreen, void *pvVRAM);
194
195 void getFramebufferDimensions(int32_t *px1, int32_t *py1, int32_t *px2, int32_t *py2);
196 int getScreenResolution(uint32_t cScreen, ULONG *pcx, ULONG *pcy,
197 ULONG *pcBPP, LONG *pXOrigin, LONG *pYOrigin)
198 {
199 return GetScreenResolution(cScreen, pcx, pcy, pcBPP, pXOrigin, pYOrigin);
200 }
201
202 int handleSetVisibleRegion(uint32_t cRect, PRTRECT pRect);
203 int handleQueryVisibleRegion(uint32_t *pcRect, PRTRECT pRect);
204
205 int VideoAccelEnable(bool fEnable, VBVAMEMORY *pVbvaMemory);
206 void VideoAccelFlush(void);
207 bool VideoAccelAllowed(void);
208 void VideoAccelVRDP(bool fEnable);
209
210 int VideoCaptureStart();
211 void VideoCaptureStop();
212 int VideoCaptureEnableScreens(ComSafeArrayIn(BOOL, aScreens));
213
214 void notifyPowerDown(void);
215
216 // IEventListener methods
217 STDMETHOD(HandleEvent)(IEvent * aEvent);
218
219 // IDisplay methods
220 STDMETHOD(GetScreenResolution)(ULONG aScreenId, ULONG *aWidth, ULONG *aHeight, ULONG *aBitsPerPixel, LONG *aXOrigin, LONG *aYOrigin);
221 STDMETHOD(SetFramebuffer)(ULONG aScreenId, IFramebuffer *aFramebuffer);
222 STDMETHOD(AttachFramebuffer)(ULONG aScreenId,
223 IFramebuffer *aFramebuffer);
224 STDMETHOD(DetachFramebuffer)(ULONG aScreenId);
225 STDMETHOD(QueryFramebuffer)(ULONG aScreenId,
226 IFramebuffer **aFramebuffer);
227 STDMETHOD(SetVideoModeHint)(ULONG aDisplay, BOOL aEnabled, BOOL aChangeOrigin, LONG aOriginX, LONG aOriginY, ULONG aWidth, ULONG aHeight, ULONG aBitsPerPixel);
228 STDMETHOD(TakeScreenShot)(ULONG aScreenId, BYTE *address, ULONG width, ULONG height);
229 STDMETHOD(TakeScreenShotToArray)(ULONG aScreenId, ULONG width, ULONG height, ComSafeArrayOut(BYTE, aScreenData));
230 STDMETHOD(TakeScreenShotPNGToArray)(ULONG aScreenId, ULONG width, ULONG height, ComSafeArrayOut(BYTE, aScreenData));
231 STDMETHOD(DrawToScreen)(ULONG aScreenId, BYTE *address, ULONG x, ULONG y, ULONG width, ULONG height);
232 STDMETHOD(InvalidateAndUpdate)();
233 STDMETHOD(SetSeamlessMode)(BOOL enabled);
234
235 STDMETHOD(CompleteVHWACommand)(BYTE *pCommand);
236
237 STDMETHOD(ViewportChanged)(ULONG aScreenId, ULONG x, ULONG y, ULONG width, ULONG height);
238 STDMETHOD(QuerySourceBitmap)(ULONG aScreenId,
239 IDisplaySourceBitmap **aDisplaySourceBitmap);
240
241 static const PDMDRVREG DrvReg;
242
243private:
244
245 HRESULT querySourceBitmap(ULONG aScreenId,
246 IDisplaySourceBitmap **ppDisplaySourceBitmap);
247
248#ifdef VBOX_WITH_CRHGSMI
249 void setupCrHgsmiData(void);
250 void destructCrHgsmiData(void);
251#endif
252
253#if defined(VBOX_WITH_HGCM) && defined(VBOX_WITH_CROGL)
254 int crViewportNotify(ULONG aScreenId, ULONG x, ULONG y, ULONG width, ULONG height);
255#endif
256
257 static DECLCALLBACK(int) changeFramebuffer(Display *that, IFramebuffer *aFB, unsigned uScreenId);
258
259 static DECLCALLBACK(void*) drvQueryInterface(PPDMIBASE pInterface, const char *pszIID);
260 static DECLCALLBACK(int) drvConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags);
261 static DECLCALLBACK(void) drvDestruct(PPDMDRVINS pDrvIns);
262 static DECLCALLBACK(int) displayResizeCallback(PPDMIDISPLAYCONNECTOR pInterface, uint32_t bpp, void *pvVRAM, uint32_t cbLine, uint32_t cx, uint32_t cy);
263 static DECLCALLBACK(void) displayUpdateCallback(PPDMIDISPLAYCONNECTOR pInterface,
264 uint32_t x, uint32_t y, uint32_t cx, uint32_t cy);
265 static DECLCALLBACK(void) displayRefreshCallback(PPDMIDISPLAYCONNECTOR pInterface);
266 static DECLCALLBACK(void) displayResetCallback(PPDMIDISPLAYCONNECTOR pInterface);
267 static DECLCALLBACK(void) displayLFBModeChangeCallback(PPDMIDISPLAYCONNECTOR pInterface, bool fEnabled);
268 static DECLCALLBACK(void) displayProcessAdapterDataCallback(PPDMIDISPLAYCONNECTOR pInterface, void *pvVRAM, uint32_t u32VRAMSize);
269 static DECLCALLBACK(void) displayProcessDisplayDataCallback(PPDMIDISPLAYCONNECTOR pInterface, void *pvVRAM, unsigned uScreenId);
270
271#ifdef VBOX_WITH_VIDEOHWACCEL
272 static DECLCALLBACK(int) displayVHWACommandProcess(PPDMIDISPLAYCONNECTOR pInterface, PVBOXVHWACMD pCommand);
273#endif
274
275#ifdef VBOX_WITH_CRHGSMI
276 static DECLCALLBACK(void) displayCrHgsmiCommandProcess(PPDMIDISPLAYCONNECTOR pInterface, PVBOXVDMACMD_CHROMIUM_CMD pCmd, uint32_t cbCmd);
277 static DECLCALLBACK(void) displayCrHgsmiControlProcess(PPDMIDISPLAYCONNECTOR pInterface, PVBOXVDMACMD_CHROMIUM_CTL pCtl, uint32_t cbCtl);
278
279 static DECLCALLBACK(void) displayCrHgsmiCommandCompletion(int32_t result, uint32_t u32Function, PVBOXHGCMSVCPARM pParam, void *pvContext);
280 static DECLCALLBACK(void) displayCrHgsmiControlCompletion(int32_t result, uint32_t u32Function, PVBOXHGCMSVCPARM pParam, void *pvContext);
281#endif
282#if defined(VBOX_WITH_HGCM) && defined(VBOX_WITH_CROGL)
283 static DECLCALLBACK(int) displayCrHgcmCtlSubmit(PPDMIDISPLAYCONNECTOR pInterface,
284 struct VBOXCRCMDCTL* pCmd, uint32_t cbCmd,
285 PFNCRCTLCOMPLETION pfnCompletion,
286 void *pvCompletion);
287 static DECLCALLBACK(void) displayCrHgcmCtlSubmitCompletion(int32_t result, uint32_t u32Function, PVBOXHGCMSVCPARM pParam, void *pvContext);
288#endif
289#ifdef VBOX_WITH_HGSMI
290 static DECLCALLBACK(int) displayVBVAEnable(PPDMIDISPLAYCONNECTOR pInterface, unsigned uScreenId, PVBVAHOSTFLAGS pHostFlags, bool fRenderThreadMode);
291 static DECLCALLBACK(void) displayVBVADisable(PPDMIDISPLAYCONNECTOR pInterface, unsigned uScreenId);
292 static DECLCALLBACK(void) displayVBVAUpdateBegin(PPDMIDISPLAYCONNECTOR pInterface, unsigned uScreenId);
293 static DECLCALLBACK(void) displayVBVAUpdateProcess(PPDMIDISPLAYCONNECTOR pInterface, unsigned uScreenId, const PVBVACMDHDR pCmd, size_t cbCmd);
294 static DECLCALLBACK(void) displayVBVAUpdateEnd(PPDMIDISPLAYCONNECTOR pInterface, unsigned uScreenId, int32_t x, int32_t y, uint32_t cx, uint32_t cy);
295 static DECLCALLBACK(int) displayVBVAResize(PPDMIDISPLAYCONNECTOR pInterface, const PVBVAINFOVIEW pView, const PVBVAINFOSCREEN pScreen, void *pvVRAM);
296 static DECLCALLBACK(int) displayVBVAMousePointerShape(PPDMIDISPLAYCONNECTOR pInterface, bool fVisible, bool fAlpha, uint32_t xHot, uint32_t yHot, uint32_t cx, uint32_t cy, const void *pvShape);
297#endif
298
299#if defined(VBOX_WITH_HGCM) && defined(VBOX_WITH_CROGL)
300 static DECLCALLBACK(void) displayCrVRecScreenshotPerform(void *pvCtx, uint32_t uScreen,
301 uint32_t x, uint32_t y,
302 uint32_t uBitsPerPixel, uint32_t uBytesPerLine,
303 uint32_t uGuestWidth, uint32_t uGuestHeight,
304 uint8_t *pu8BufferAddress, uint64_t u64TimeStamp);
305 static DECLCALLBACK(bool) displayCrVRecScreenshotBegin(void *pvCtx, uint32_t uScreen, uint64_t u64TimeStamp);
306 static DECLCALLBACK(void) displayCrVRecScreenshotEnd(void *pvCtx, uint32_t uScreen, uint64_t u64TimeStamp);
307
308 static DECLCALLBACK(void) displayVRecCompletion(int32_t result, uint32_t u32Function, PVBOXHGCMSVCPARM pParam, void *pvContext);
309#endif
310 static DECLCALLBACK(void) displayCrCmdFree(struct VBOXCRCMDCTL* pCmd, uint32_t cbCmd, int rc, void *pvCompletion);
311
312 static DECLCALLBACK(void) displaySSMSaveScreenshot(PSSMHANDLE pSSM, void *pvUser);
313 static DECLCALLBACK(int) displaySSMLoadScreenshot(PSSMHANDLE pSSM, void *pvUser, uint32_t uVersion, uint32_t uPass);
314 static DECLCALLBACK(void) displaySSMSave(PSSMHANDLE pSSM, void *pvUser);
315 static DECLCALLBACK(int) displaySSMLoad(PSSMHANDLE pSSM, void *pvUser, uint32_t uVersion, uint32_t uPass);
316
317 Console * const mParent;
318 /** Pointer to the associated display driver. */
319 struct DRVMAINDISPLAY *mpDrv;
320 /** Pointer to the device instance for the VMM Device. */
321 PPDMDEVINS mpVMMDev;
322 /** Set after the first attempt to find the VMM Device. */
323 bool mfVMMDevInited;
324
325 unsigned mcMonitors;
326 DISPLAYFBINFO maFramebuffers[SchemaDefs::MaxGuestMonitors];
327
328 bool mfSourceBitmapEnabled;
329
330 /* arguments of the last handleDisplayResize() call */
331 void *mLastAddress;
332 uint32_t mLastBytesPerLine;
333 uint32_t mLastBitsPerPixel;
334 uint32_t mLastWidth;
335 uint32_t mLastHeight;
336 uint16_t mLastFlags;
337
338 VBVAMEMORY *mpVbvaMemory;
339 bool mfVideoAccelEnabled;
340 bool mfVideoAccelVRDP;
341 uint32_t mfu32SupportedOrders;
342
343 int32_t volatile mcVideoAccelVRDPRefs;
344
345 VBVAMEMORY *mpPendingVbvaMemory;
346 bool mfPendingVideoAccelEnable;
347 bool mfMachineRunning;
348#ifdef VBOX_WITH_CROGL
349 bool mfCrOglDataHidden;
350#endif
351
352 uint8_t *mpu8VbvaPartial;
353 uint32_t mcbVbvaPartial;
354
355#ifdef VBOX_WITH_CRHGSMI
356 /* for fast host hgcm calls */
357 HGCMCVSHANDLE mhCrOglSvc;
358 RTCRITSECTRW mCrOglLock;
359#endif
360#ifdef VBOX_WITH_CROGL
361 CR_MAIN_INTERFACE mCrOglCallbacks;
362 volatile uint32_t mfCrOglVideoRecState;
363 CRVBOXHGCMTAKESCREENSHOT mCrOglScreenshotData;
364 VBOXCRCMDCTL_HGCM mCrOglScreenshotCtl;
365#endif
366
367 bool vbvaFetchCmd(VBVACMDHDR **ppHdr, uint32_t *pcbCmd);
368 void vbvaReleaseCmd(VBVACMDHDR *pHdr, int32_t cbCmd);
369
370 void handleResizeCompletedEMT(unsigned uScreenId, BOOL fResizeContext);
371
372 RTCRITSECT mVBVALock;
373 volatile uint32_t mfu32PendingVideoAccelDisable;
374
375 int vbvaLock(void);
376 void vbvaUnlock(void);
377
378 RTCRITSECT mSaveSeamlessRectLock;
379 int SaveSeamlessRectLock(void);
380 void SaveSeamlessRectUnLock(void);
381
382public:
383 static int displayTakeScreenshotEMT(Display *pDisplay, ULONG aScreenId, uint8_t **ppu8Data, size_t *pcbData, uint32_t *pu32Width, uint32_t *pu32Height);
384
385#if defined(VBOX_WITH_HGCM) && defined(VBOX_WITH_CROGL)
386 static BOOL displayCheckTakeScreenshotCrOgl(Display *pDisplay, ULONG aScreenId, uint8_t *pu8Data, uint32_t u32Width, uint32_t u32Height);
387 int crCtlSubmit(struct VBOXCRCMDCTL* pCmd, uint32_t cbCmd, PFNCRCTLCOMPLETION pfnCompletion, void *pvCompletion);
388 int crCtlSubmitSync(struct VBOXCRCMDCTL* pCmd, uint32_t cbCmd);
389 /* copies the given command and submits it asynchronously,
390 * i.e. the pCmd data may be discarded right after the call returns */
391 int crCtlSubmitAsyncCmdCopy(struct VBOXCRCMDCTL* pCmd, uint32_t cbCmd);
392 /* performs synchronous request processing if 3D backend has something to display
393 * this is primarily to work-around 3d<->main thread deadlocks on OSX
394 * in case of async completion, the command is coppied to the allocated buffer,
395 * freeded on command completion
396 * can be used for "notification" commands, when client is not interested in command result,
397 * that must synchronize with 3D backend only when some 3D data is displayed.
398 * The routine does NOT provide any info on whether command is processed asynchronously or not */
399 int crCtlSubmitSyncIfHasDataForScreen(uint32_t u32ScreenID, struct VBOXCRCMDCTL* pCmd, uint32_t cbCmd);
400#endif
401
402private:
403 static void InvalidateAndUpdateEMT(Display *pDisplay, unsigned uId, bool fUpdateAll);
404 static int drawToScreenEMT(Display *pDisplay, ULONG aScreenId, BYTE *address, ULONG x, ULONG y, ULONG width, ULONG height);
405
406 int videoAccelRefreshProcess(void);
407
408 /* Functions run under VBVA lock. */
409 int videoAccelEnable(bool fEnable, VBVAMEMORY *pVbvaMemory);
410 void videoAccelFlush(void);
411
412#if defined(VBOX_WITH_HGCM) && defined(VBOX_WITH_CROGL)
413 int crOglWindowsShow(bool fShow);
414#endif
415
416#ifdef VBOX_WITH_HGSMI
417 volatile uint32_t mu32UpdateVBVAFlags;
418#endif
419
420#ifdef VBOX_WITH_VPX
421 VIDEORECCONTEXT *mpVideoRecCtx;
422 bool maVideoRecEnabled[SchemaDefs::MaxGuestMonitors];
423#endif
424};
425
426void gdImageCopyResampled(uint8_t *dst, uint8_t *src,
427 int dstX, int dstY, int srcX, int srcY,
428 int dstW, int dstH, int srcW, int srcH);
429
430void BitmapScale32(uint8_t *dst, int dstW, int dstH,
431 const uint8_t *src, int iDeltaLine, int srcW, int srcH);
432
433int DisplayMakePNG(uint8_t *pu8Data, uint32_t cx, uint32_t cy,
434 uint8_t **ppu8PNG, uint32_t *pcbPNG, uint32_t *pcxPNG, uint32_t *pcyPNG,
435 uint8_t fLimitSize);
436
437class ATL_NO_VTABLE DisplaySourceBitmap:
438 public DisplaySourceBitmapWrap
439{
440public:
441
442 DECLARE_EMPTY_CTOR_DTOR(DisplaySourceBitmap)
443
444 HRESULT FinalConstruct();
445 void FinalRelease();
446
447 /* Public initializer/uninitializer for internal purposes only. */
448 HRESULT init(ComObjPtr<Display> pDisplay, unsigned uScreenId, DISPLAYFBINFO *pFBInfo);
449 void uninit();
450
451 bool usesVRAM(void) { return m.pu8Allocated == NULL; }
452
453private:
454 // wrapped IDisplaySourceBitmap properties
455 virtual HRESULT getScreenId(ULONG *aScreenId);
456
457 // wrapped IDisplaySourceBitmap methods
458 virtual HRESULT queryBitmapInfo(BYTE **aAddress,
459 ULONG *aWidth,
460 ULONG *aHeight,
461 ULONG *aBitsPerPixel,
462 ULONG *aBytesPerLine,
463 ULONG *aPixelFormat);
464
465 int initSourceBitmap(unsigned aScreenId, DISPLAYFBINFO *pFBInfo);
466
467 struct Data
468 {
469 ComObjPtr<Display> pDisplay;
470 unsigned uScreenId;
471 DISPLAYFBINFO *pFBInfo;
472
473 uint8_t *pu8Allocated;
474
475 uint8_t *pu8Address;
476 ULONG ulWidth;
477 ULONG ulHeight;
478 ULONG ulBitsPerPixel;
479 ULONG ulBytesPerLine;
480 ULONG ulPixelFormat;
481 };
482
483 Data m;
484};
485
486#endif // ____H_DISPLAYIMPL
487/* vi: set tabstop=4 shiftwidth=4 expandtab: */
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette