VirtualBox

source: vbox/trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/presenter/server_presenter.h@ 78263

Last change on this file since 78263 was 78190, checked in by vboxsync, 6 years ago

Merge first stage of the Chromium cleanup from the branch:

  • r129818 (Remove VBOX_WITH_CR_DISPLAY_LISTS and accompanying code as it was disabled since r108676 and was never brought back (see ​bugref:3456 and ​bugref:8485))
  • r129819 (HostServices/SharedOpenGL: Remove unused main entry point from upstream server process based implementation)
  • r129820 (HostServices/SharedOpenGL: Started eliminating all backends other than HGCM. They are not used and probably wouldn't work anymore anyway)
  • r129821 (HostServices/SharedOpenGL,GuestHost/OpenGLAdditions/common/crOpenGL: Kill crTimer* API as it is not used anywhere)
  • r129822 (HostServices/SharedOpenGL,GuestHost/OpenGLAdditions/common/crOpenGL: Kill most from cr_process.h apart from two used methods)
  • r129823 (HostServices/SharedOpenGL,GuestHost/OpenGLAdditions/common/crOpenGL: Kill crList* API as it is unused)
  • r129824 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Kill crHullInteriorBox API as it is unused)
  • r129825 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Kill crWarpPoint API as it is unused)
  • r129826 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Kill CrSa* API as it is unused and not even compiled in)
  • r129827 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Kill cr_bbox.h as it is unused)
  • r129828 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Remove a few crParseUrl() two uses)
  • r129829 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Remove last crParseURL() use)
  • r129830 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Remove crParseURL())
  • r129831 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Remove VBOX_WITH_COCOA_QT and related code when not set as it is the default for years now and we don't support anything else anymore)
  • r129832 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Remove unused cr_logo.h)
  • r129833 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Remove unused crut_api.h and crut_clientapi.h)
  • r129834 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Remove unused cr_dmx.h)
  • r129835 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Remove unused cr_perf.h)
  • r129836 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Remove cr_rand.h and friends as it is not actively used anywhere)
  • r129837 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Get rid of all the swapped versions in the packer SPU, we never change endianess from guest to host and don't need it)
  • r129838 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Remove more swapper versions in the packer related code)
  • r129839 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Remove more swapper versions in the packer related code)
  • r129840 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Remove unused pack_pica.c)
  • r129841 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Remove more swapper versions in the packer related code)
  • r129842 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Get rid of cr_endianess.h and friends)
  • r129843 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Get rid of unused lowercase.py)
  • r129844 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Get rid of unused cr_calllists.h and friends)
  • r129845 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Get rid of completely unused idpool.c, not even compiled in)
  • r129846 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Get rid of unused cr_debugopcodes.h and friends)
  • r129847 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Make the cr_mem.h API inline and get rid of the implementation in the util library)
  • r129848 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Get rid of SPUOptions and related code as it is of no use for us)
  • r129849 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Get rid of cr_environment.h and friends and convert usage to RTEnv* APIs)
  • r129850 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Get rid of unused renderspu_agl.c)
  • r129851 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Remove unused code in cr_htable.h)
  • r129853 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Introduce a state paremeter for the unpacker workers instead of reyling on global variables, work in progress)
  • r129854 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Let the caller of crUnpack set up the initial state. This allows to get rid of the global return_ptr and writeback_ptr as they get supplied in the unpacker state by the server)
  • r129855 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Get rid of the cr_lastDispatch and cr_unpackDispatch as they are of no use now)
  • r129856 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Get rid of the global cr_unpackData and cr_unpackDataEnd symbols by indtroducing another hack to make it possible for certail server dispatch callbacks to access the data buffer)
  • r129857 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: build fix for release builds)
  • r129858 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Make the pointer to the unpacker state non const (is required for the access verification))
  • r129859 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: First iteration of the buffer size validation to prevent out of bound read access + added todos for places where additional checks are needed)
  • r129860 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Working on remaining verification todos)
  • r129861 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Working on remaining verification todos)
  • r129871 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Working on remaining verification todos)
  • r129872 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Stop as soon as the unpacker encountered an error)
  • r129876 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Working on remaining verification todos)
  • r129880 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Working on remaining verification todos)
  • r129882 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Fixed some offsets in unpack_texture.c, 3DMark03 renders correctly again)
  • r130013 (HostServices/SharedOpenGL: Convert files to C++ so we can use C99 featuers on Windows with cl.exe)
  • r130014 (HostServices/SharedOpenGL,GuestHost/OpenGL: WIndows build fixes)
  • r130015 (HostServices/SharedOpenGL,GuestHost/OpenGL: More Windows build fixes)
  • r130036 (Config.kmk: Fix linker error on Windows by temporarily disabling the use of VBoxGuestR3DllMinW2K)
  • r130094 (src/VBox/GuestHost/OpenGL: Revert inlining the allocation/free functions in R3 completely as it doesn't work on Windows if memory is allocated and freed across different DLLs which don't share a common CRT, causes crashes in RtlValidtaeHeap())
  • r130095 (src/VBox/GuestHost/OpenGL,src/VBox/Additions/common/crOpenGL/pack: Don't use floating point specifiers in packspu_GetString() to avoid R6002 errors (couldn't fully understand why they occur suddenly after the rework but this gets rid of it))
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 15.0 KB
Line 
1/* $Id: server_presenter.h 78190 2019-04-18 00:07:07Z vboxsync $ */
2
3/** @file
4 * Presenter API definitions.
5 */
6
7/*
8 * Copyright (C) 2014-2019 Oracle Corporation
9 *
10 * This file is part of VirtualBox Open Source Edition (OSE), as
11 * available from http://www.virtualbox.org. This file is free software;
12 * you can redistribute it and/or modify it under the terms of the GNU
13 * General Public License (GPL) as published by the Free Software
14 * Foundation, in version 2 as it comes in the "COPYING" file of the
15 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17 */
18
19#ifndef __SERVER_PRESENTER_H__
20#define __SERVER_PRESENTER_H__
21
22#include "cr_spu.h"
23#include "chromium.h"
24#include "cr_error.h"
25#include "cr_net.h"
26#include "server_dispatch.h"
27#include "server.h"
28#include "cr_mem.h"
29#include "cr_string.h"
30#include <cr_vreg.h>
31#include <cr_htable.h>
32#include <cr_bmpscale.h>
33
34#include "render/renderspu.h"
35
36#include <iprt/cdefs.h>
37#include <iprt/types.h>
38#include <iprt/asm.h>
39#include <iprt/mem.h>
40#include <iprt/list.h>
41
42
43class ICrFbDisplay
44{
45 public:
46 virtual int UpdateBegin(struct CR_FRAMEBUFFER *pFb) = 0;
47 virtual void UpdateEnd(struct CR_FRAMEBUFFER *pFb) = 0;
48
49 virtual int EntryCreated(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hEntry) = 0;
50 virtual int EntryAdded(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hEntry) = 0;
51 virtual int EntryReplaced(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hNewEntry, HCR_FRAMEBUFFER_ENTRY hReplacedEntry) = 0;
52 virtual int EntryTexChanged(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hEntry) = 0;
53 virtual int EntryRemoved(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hEntry) = 0;
54 virtual int EntryDestroyed(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hEntry) = 0;
55 virtual int EntryPosChanged(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hEntry) = 0;
56
57 virtual int RegionsChanged(struct CR_FRAMEBUFFER *pFb) = 0;
58
59 virtual int FramebufferChanged(struct CR_FRAMEBUFFER *pFb) = 0;
60
61 virtual ~ICrFbDisplay() {}
62};
63
64
65typedef struct CR_FRAMEBUFFER
66{
67 VBOXVR_SCR_COMPOSITOR Compositor;
68 struct VBVAINFOSCREEN ScreenInfo;
69 void *pvVram;
70 ICrFbDisplay *pDisplay;
71 RTLISTNODE EntriesList;
72 uint32_t cEntries; /* <- just for debugging */
73 uint32_t cUpdating;
74 CRHTABLE SlotTable;
75} CR_FRAMEBUFFER;
76
77
78typedef union CR_FBENTRY_FLAGS
79{
80 struct {
81 uint32_t fCreateNotified : 1;
82 uint32_t fInList : 1;
83 uint32_t Reserved : 30;
84 };
85 uint32_t Value;
86} CR_FBENTRY_FLAGS;
87
88
89typedef struct CR_FRAMEBUFFER_ENTRY
90{
91 VBOXVR_SCR_COMPOSITOR_ENTRY Entry;
92 RTLISTNODE Node;
93 uint32_t cRefs;
94 CR_FBENTRY_FLAGS Flags;
95 CRHTABLE HTable;
96} CR_FRAMEBUFFER_ENTRY;
97
98
99typedef struct CR_FBTEX
100{
101 CR_TEXDATA Tex;
102 CRTextureObj *pTobj;
103} CR_FBTEX;
104
105
106class CrFbDisplayBase : public ICrFbDisplay
107{
108 public:
109
110 CrFbDisplayBase();
111
112 virtual bool isComposite();
113 class CrFbDisplayComposite* getContainer();
114 bool isInList();
115 bool isUpdating();
116 int setRegionsChanged();
117 int setFramebuffer(struct CR_FRAMEBUFFER *pFb);
118 struct CR_FRAMEBUFFER* getFramebuffer();
119 virtual int UpdateBegin(struct CR_FRAMEBUFFER *pFb);
120 virtual void UpdateEnd(struct CR_FRAMEBUFFER *pFb);
121 virtual int EntryCreated(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hEntry);
122 virtual int EntryAdded(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hEntry);
123 virtual int EntryReplaced(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hNewEntry, HCR_FRAMEBUFFER_ENTRY hReplacedEntry);
124 virtual int EntryTexChanged(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hEntry);
125 virtual int EntryRemoved(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hEntry);
126 virtual int EntryDestroyed(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hEntry);
127 virtual int EntryPosChanged(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hEntry);
128 virtual int RegionsChanged(struct CR_FRAMEBUFFER *pFb);
129 virtual int FramebufferChanged(struct CR_FRAMEBUFFER *pFb);
130 virtual ~CrFbDisplayBase();
131
132 /*@todo: move to protected and switch from RTLISTNODE*/
133 RTLISTNODE mNode;
134 class CrFbDisplayComposite* mpContainer;
135
136 protected:
137
138 virtual void onUpdateEnd();
139 virtual void ueRegions();
140 static DECLCALLBACK(bool) entriesCreateCb(HCR_FRAMEBUFFER hFb, HCR_FRAMEBUFFER_ENTRY hEntry, void *pvContext);
141 static DECLCALLBACK(bool) entriesDestroyCb(HCR_FRAMEBUFFER hFb, HCR_FRAMEBUFFER_ENTRY hEntry, void *pvContext);
142 int fbSynchAddAllEntries();
143 int fbCleanupRemoveAllEntries();
144 virtual int setFramebufferBegin(struct CR_FRAMEBUFFER *pFb);
145 virtual void setFramebufferEnd(struct CR_FRAMEBUFFER *pFb);
146 static DECLCALLBACK(void) slotEntryReleaseCB(HCR_FRAMEBUFFER hFb, HCR_FRAMEBUFFER_ENTRY hEntry, void *pvContext);
147 virtual void slotRelease();
148 virtual int fbCleanup();
149 virtual int fbSync();
150 CRHTABLE_HANDLE slotGet();
151
152 private:
153
154 typedef union CR_FBDISPBASE_FLAGS
155 {
156 struct {
157 uint32_t fRegionsShanged : 1;
158 uint32_t Reserved : 31;
159 };
160 uint32_t u32Value;
161 } CR_FBDISPBASE_FLAGS;
162
163 struct CR_FRAMEBUFFER *mpFb;
164 uint32_t mcUpdates;
165 CRHTABLE_HANDLE mhSlot;
166 CR_FBDISPBASE_FLAGS mFlags;
167};
168
169
170class CrFbDisplayComposite : public CrFbDisplayBase
171{
172 public:
173
174 CrFbDisplayComposite();
175 virtual bool isComposite();
176 uint32_t getDisplayCount();
177 bool add(CrFbDisplayBase *pDisplay);
178 bool remove(CrFbDisplayBase *pDisplay, bool fCleanupDisplay = true);
179 CrFbDisplayBase* first();
180 CrFbDisplayBase* next(CrFbDisplayBase* pDisplay);
181 virtual int setFramebuffer(struct CR_FRAMEBUFFER *pFb);
182 virtual int UpdateBegin(struct CR_FRAMEBUFFER *pFb);
183 virtual void UpdateEnd(struct CR_FRAMEBUFFER *pFb);
184 virtual int EntryAdded(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hEntry);
185 virtual int EntryCreated(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hEntry);
186 virtual int EntryReplaced(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hNewEntry, HCR_FRAMEBUFFER_ENTRY hReplacedEntry);
187 virtual int EntryTexChanged(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hEntry);
188 virtual int EntryRemoved(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hEntry);
189 virtual int EntryDestroyed(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hEntry);
190 virtual int RegionsChanged(struct CR_FRAMEBUFFER *pFb);
191 virtual int FramebufferChanged(struct CR_FRAMEBUFFER *pFb);
192 virtual ~CrFbDisplayComposite();
193 void cleanup(bool fCleanupDisplays = true);
194
195 private:
196
197 RTLISTNODE mDisplays;
198 uint32_t mcDisplays;
199};
200
201
202class CrFbWindow
203{
204 public:
205
206 CrFbWindow(uint64_t parentId);
207 bool IsCreated() const;
208 bool IsVisivle() const;
209 void Destroy();
210 int Reparent(uint64_t parentId);
211 int SetVisible(bool fVisible);
212 int SetSize(uint32_t width, uint32_t height, bool fForced=false);
213 int SetPosition(int32_t x, int32_t y, bool fForced=false);
214 int SetVisibleRegionsChanged();
215 int SetCompositor(const struct VBOXVR_SCR_COMPOSITOR * pCompositor);
216 bool SetScaleFactor(GLdouble scaleFactorW, GLdouble scaleFactorH);
217 bool GetScaleFactor(GLdouble *scaleFactorW, GLdouble *scaleFactorH);
218 int UpdateBegin();
219 void UpdateEnd();
220 uint64_t GetParentId();
221 int Create();
222 ~CrFbWindow();
223
224 protected:
225
226 void checkRegions();
227 bool isPresentNeeded();
228 bool checkInitedUpdating();
229
230 private:
231
232 typedef union CR_FBWIN_FLAGS
233 {
234 struct {
235 uint32_t fVisible : 1;
236 uint32_t fDataPresented : 1;
237 uint32_t fForcePresentOnReenable : 1;
238 uint32_t fCompositoEntriesModified : 1;
239 uint32_t Reserved : 28;
240 };
241 uint32_t Value;
242 } CR_FBWIN_FLAGS;
243
244 GLint mSpuWindow;
245 const struct VBOXVR_SCR_COMPOSITOR * mpCompositor;
246 uint32_t mcUpdates;
247 int32_t mxPos;
248 int32_t myPos;
249 uint32_t mWidth;
250 uint32_t mHeight;
251 CR_FBWIN_FLAGS mFlags;
252 uint64_t mParentId;
253
254 RTSEMRW scaleFactorLock;
255 GLdouble mScaleFactorWStorage;
256 GLdouble mScaleFactorHStorage;
257};
258
259
260class CrFbDisplayWindow : public CrFbDisplayBase
261{
262 public:
263
264 CrFbDisplayWindow(const RTRECT *pViewportRect, uint64_t parentId);
265 virtual ~CrFbDisplayWindow();
266 virtual int UpdateBegin(struct CR_FRAMEBUFFER *pFb);
267 virtual void UpdateEnd(struct CR_FRAMEBUFFER *pFb);
268 virtual int RegionsChanged(struct CR_FRAMEBUFFER *pFb);
269 virtual int EntryCreated(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hEntry);
270 virtual int EntryReplaced(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hNewEntry, HCR_FRAMEBUFFER_ENTRY hReplacedEntry);
271 virtual int EntryTexChanged(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hEntry);
272 virtual int FramebufferChanged(struct CR_FRAMEBUFFER *pFb);
273 const RTRECT* getViewportRect();
274 virtual int setViewportRect(const RTRECT *pViewportRect);
275 virtual CrFbWindow * windowDetach(bool fCleanup = true);
276 virtual CrFbWindow * windowAttach(CrFbWindow * pNewWindow);
277 virtual int reparent(uint64_t parentId);
278 virtual bool isVisible();
279 int winVisibilityChanged();
280 CrFbWindow* getWindow();
281
282 protected:
283
284 virtual void onUpdateEnd();
285 virtual void ueRegions();
286 virtual int screenChanged();
287 virtual int windowSetCompositor(bool fSet);
288 virtual int windowCleanup();
289 virtual int fbCleanup();
290 bool isActive();
291 int windowDimensionsSync(bool fForceCleanup = false);
292 virtual int windowSync();
293 virtual int fbSync();
294 virtual const struct RTRECT* getRect();
295
296 private:
297
298 typedef union CR_FBDISPWINDOW_FLAGS
299 {
300 struct {
301 uint32_t fNeVisible : 1;
302 uint32_t fNeForce : 1;
303 uint32_t Reserved : 30;
304 };
305 uint32_t u32Value;
306 } CR_FBDISPWINDOW_FLAGS;
307
308 CrFbWindow *mpWindow;
309 RTRECT mViewportRect;
310 CR_FBDISPWINDOW_FLAGS mFlags;
311 uint32_t mu32Screen;
312 uint64_t mParentId;
313};
314
315
316class CrFbDisplayWindowRootVr : public CrFbDisplayWindow
317{
318 public:
319
320 CrFbDisplayWindowRootVr(const RTRECT *pViewportRect, uint64_t parentId);
321 virtual int EntryCreated(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hEntry);
322 virtual int EntryAdded(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hEntry);
323 virtual int EntryReplaced(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hNewEntry, HCR_FRAMEBUFFER_ENTRY hReplacedEntry);
324 virtual int EntryTexChanged(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hEntry);
325 virtual int EntryRemoved(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hEntry);
326 virtual int EntryDestroyed(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hEntry);
327 virtual int setViewportRect(const RTRECT *pViewportRect);
328
329 protected:
330
331 virtual int windowSetCompositor(bool fSet);
332 virtual void ueRegions();
333 int compositorMarkUpdated();
334 virtual int screenChanged();
335 virtual const struct RTRECT* getRect();
336 virtual int fbCleanup();
337 virtual int fbSync();
338 VBOXVR_SCR_COMPOSITOR_ENTRY* entryAlloc();
339 void entryFree(VBOXVR_SCR_COMPOSITOR_ENTRY* pEntry);
340 int synchCompositorRegions();
341 virtual int synchCompositor();
342 virtual int clearCompositor();
343 void rootVrTranslateForPos();
344 static DECLCALLBACK(VBOXVR_SCR_COMPOSITOR_ENTRY*) rootVrGetCEntry(const VBOXVR_SCR_COMPOSITOR_ENTRY*pEntry, void *pvContext);
345
346 private:
347
348 VBOXVR_SCR_COMPOSITOR mCompositor;
349};
350
351
352class CrFbDisplayVrdp : public CrFbDisplayBase
353{
354 public:
355
356 CrFbDisplayVrdp();
357 virtual int EntryCreated(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hEntry);
358 virtual int EntryReplaced(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hNewEntry, HCR_FRAMEBUFFER_ENTRY hReplacedEntry);
359 virtual int EntryTexChanged(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hEntry);
360 virtual int EntryRemoved(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hEntry);
361 virtual int EntryDestroyed(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hEntry);
362 virtual int EntryPosChanged(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hEntry);
363 virtual int RegionsChanged(struct CR_FRAMEBUFFER *pFb);
364 virtual int FramebufferChanged(struct CR_FRAMEBUFFER *pFb);
365
366 protected:
367
368 void syncPos();
369 virtual int fbCleanup();
370 virtual int fbSync();
371 void vrdpDestroy(HCR_FRAMEBUFFER_ENTRY hEntry);
372 void vrdpGeometry(HCR_FRAMEBUFFER_ENTRY hEntry);
373 int vrdpRegions(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hEntry);
374 int vrdpFrame(HCR_FRAMEBUFFER_ENTRY hEntry);
375 int vrdpRegionsAll(struct CR_FRAMEBUFFER *pFb);
376 int vrdpSynchEntry(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hEntry);
377 int vrdpSyncEntryAll(struct CR_FRAMEBUFFER *pFb);
378 int vrdpCreate(HCR_FRAMEBUFFER hFb, HCR_FRAMEBUFFER_ENTRY hEntry);
379
380 private:
381
382 RTPOINT mPos;
383};
384
385
386typedef struct CR_FB_INFO
387{
388 CrFbDisplayComposite *pDpComposite;
389 uint32_t u32Id;
390 VBOXCMDVBVA_SCREENMAP_DECL(uint32_t, aTargetMap);
391} CR_FB_INFO;
392
393typedef struct CR_FBDISPLAY_INFO
394{
395 CrFbDisplayWindow *pDpWin;
396 CrFbDisplayWindowRootVr *pDpWinRootVr;
397 CrFbDisplayVrdp *pDpVrdp;
398 CrFbWindow *pWindow;
399 uint32_t u32DisplayMode;
400 uint32_t u32Id;
401 int32_t iFb;
402
403 /* Cache scaling factor here before display output
404 * initialized (i.e., guest not yet initiated first 3D call).
405 * No synchronization stuff needed here because all the reads
406 * and writes are done in context of 3D HGCM thread. */
407 double dInitialScaleFactorW;
408 double dInitialScaleFactorH;
409} CR_FBDISPLAY_INFO;
410
411typedef struct CR_PRESENTER_GLOBALS
412{
413#ifndef VBOXVDBG_MEMCACHE_DISABLE
414 RTMEMCACHE FbEntryLookasideList;
415 RTMEMCACHE FbTexLookasideList;
416 RTMEMCACHE CEntryLookasideList;
417#endif
418 uint32_t u32DisplayMode;
419 uint32_t u32DisabledDisplayMode;
420 bool fEnabled;
421 CRHashTable *pFbTexMap;
422 CR_FBDISPLAY_INFO aDisplayInfos[CR_MAX_GUEST_MONITORS];
423 CR_FBMAP FramebufferInitMap;
424 CR_FRAMEBUFFER aFramebuffers[CR_MAX_GUEST_MONITORS];
425 CR_FB_INFO aFbInfos[CR_MAX_GUEST_MONITORS];
426 bool fWindowsForceHidden;
427 uint32_t cbTmpBuf;
428 void *pvTmpBuf;
429 uint32_t cbTmpBuf2;
430 void *pvTmpBuf2;
431} CR_PRESENTER_GLOBALS;
432
433extern CR_PRESENTER_GLOBALS g_CrPresenter;
434
435
436HCR_FRAMEBUFFER_ENTRY CrFbEntryFromCompositorEntry(const struct VBOXVR_SCR_COMPOSITOR_ENTRY* pCEntry);
437
438#endif /* __SERVER_PRESENTER_H__ */
439
Note: See TracBrowser for help on using the repository browser.

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