VirtualBox

source: vbox/trunk/src/VBox/GuestHost/OpenGL/include/cr_vreg.h@ 46086

Last change on this file since 46086 was 45251, checked in by vboxsync, 12 years ago

crOpenGL: visible regions fixes

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 15.5 KB
Line 
1/* $Id: cr_vreg.h 45251 2013-03-29 17:23:18Z vboxsync $ */
2
3/** @file
4 * Visible Regions processing API
5 */
6
7/*
8 * Copyright (C) 2012 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#ifndef ___cr_vreg_h_
19#define ___cr_vreg_h_
20
21#include <iprt/list.h>
22#include <iprt/types.h>
23#include <iprt/mem.h>
24#include <iprt/string.h>
25#include <iprt/assert.h>
26#include <iprt/critsect.h>
27
28#ifndef IN_RING0
29# define VBOXVREGDECL(_type) DECLEXPORT(_type)
30#else
31# define VBOXVREGDECL(_type) RTDECL(_type)
32#endif
33
34
35
36RT_C_DECLS_BEGIN
37
38typedef struct VBOXVR_LIST
39{
40 RTLISTNODE ListHead;
41 uint32_t cEntries;
42} VBOXVR_LIST, *PVBOXVR_LIST;
43
44DECLINLINE(int) VBoxRectCmp(const RTRECT * pRect1, const RTRECT * pRect2)
45{
46 return memcmp(pRect1, pRect2, sizeof (*pRect1));
47}
48
49DECLINLINE(void) VBoxRectIntersect(PRTRECT pRect1, const RTRECT * pRect2)
50{
51 Assert(pRect1);
52 Assert(pRect2);
53 pRect1->xLeft = RT_MAX(pRect1->xLeft, pRect2->xLeft);
54 pRect1->yTop = RT_MAX(pRect1->yTop, pRect2->yTop);
55 pRect1->xRight = RT_MIN(pRect1->xRight, pRect2->xRight);
56 pRect1->yBottom = RT_MIN(pRect1->yBottom, pRect2->yBottom);
57}
58
59DECLINLINE(void) VBoxRectIntersected(const RTRECT *pRect1, const RTRECT * pRect2, RTRECT *pResult)
60{
61 *pResult = *pRect1;
62 VBoxRectIntersect(pResult, pRect2);
63}
64
65
66DECLINLINE(void) VBoxRectTranslate(RTRECT * pRect, int32_t x, int32_t y)
67{
68 pRect->xLeft += x;
69 pRect->yTop += y;
70 pRect->xRight += x;
71 pRect->yBottom += y;
72}
73
74DECLINLINE(void) VBoxRectMove(RTRECT * pRect, int32_t x, int32_t y)
75{
76 int32_t w = pRect->xRight - pRect->xLeft;
77 int32_t h = pRect->yBottom - pRect->yTop;
78 pRect->xLeft = x;
79 pRect->yTop = y;
80 pRect->xRight = w + x;
81 pRect->yBottom = h + y;
82}
83
84DECLINLINE(bool) VBoxRectIsCoveres(const RTRECT *pRect, const RTRECT *pCovered)
85{
86 Assert(pRect);
87 Assert(pCovered);
88 if (pRect->xLeft > pCovered->xLeft)
89 return false;
90 if (pRect->yTop > pCovered->yTop)
91 return false;
92 if (pRect->xRight < pCovered->xRight)
93 return false;
94 if (pRect->yBottom < pCovered->yBottom)
95 return false;
96 return true;
97}
98
99DECLINLINE(bool) VBoxRectIsZero(const RTRECT *pRect)
100{
101 return pRect->xLeft == pRect->xRight || pRect->yTop == pRect->yBottom;
102}
103
104DECLINLINE(bool) VBoxRectIsIntersect(const RTRECT * pRect1, const RTRECT * pRect2)
105{
106 return !((pRect1->xLeft < pRect2->xLeft && pRect1->xRight <= pRect2->xLeft)
107 || (pRect2->xLeft < pRect1->xLeft && pRect2->xRight <= pRect1->xLeft)
108 || (pRect1->yTop < pRect2->yTop && pRect1->yBottom <= pRect2->yTop)
109 || (pRect2->yTop < pRect1->yTop && pRect2->yBottom <= pRect1->yTop));
110}
111
112DECLINLINE(uint32_t) VBoxVrListRectsCount(const VBOXVR_LIST *pList)
113{
114 return pList->cEntries;
115}
116
117DECLINLINE(bool) VBoxVrListIsEmpty(const VBOXVR_LIST *pList)
118{
119 return !VBoxVrListRectsCount(pList);
120}
121
122DECLINLINE(void) VBoxVrListInit(PVBOXVR_LIST pList)
123{
124 RTListInit(&pList->ListHead);
125 pList->cEntries = 0;
126}
127
128VBOXVREGDECL(void) VBoxVrListClear(PVBOXVR_LIST pList);
129
130VBOXVREGDECL(void) VBoxVrListTranslate(PVBOXVR_LIST pList, int32_t x, int32_t y);
131
132VBOXVREGDECL(int) VBoxVrListCmp(PVBOXVR_LIST pList1, PVBOXVR_LIST pList2);
133
134VBOXVREGDECL(int) VBoxVrListRectsSet(PVBOXVR_LIST pList, uint32_t cRects, const RTRECT * aRects, bool *pfChanged);
135VBOXVREGDECL(int) VBoxVrListRectsAdd(PVBOXVR_LIST pList, uint32_t cRects, const RTRECT * aRects, bool *pfChanged);
136VBOXVREGDECL(int) VBoxVrListRectsSubst(PVBOXVR_LIST pList, uint32_t cRects, const RTRECT * aRects, bool *pfChanged);
137VBOXVREGDECL(int) VBoxVrListRectsGet(PVBOXVR_LIST pList, uint32_t cRects, RTRECT * aRects);
138
139/* NOTE: with the current implementation the VBoxVrListIntersect is faster than VBoxVrListRectsIntersect,
140 * i.e. VBoxVrListRectsIntersect is actually a convenience function that create a temporary list and calls VBoxVrListIntersect internally */
141VBOXVREGDECL(int) VBoxVrListRectsIntersect(PVBOXVR_LIST pList, uint32_t cRects, const RTRECT * aRects, bool *pfChanged);
142VBOXVREGDECL(int) VBoxVrListIntersect(PVBOXVR_LIST pList, const VBOXVR_LIST *pList2, bool *pfChanged);
143
144VBOXVREGDECL(int) VBoxVrInit();
145VBOXVREGDECL(void) VBoxVrTerm();
146
147typedef struct VBOXVR_LIST_ITERATOR
148{
149 PVBOXVR_LIST pList;
150 PRTLISTNODE pNextEntry;
151} VBOXVR_LIST_ITERATOR, *PVBOXVR_LIST_ITERATOR;
152
153DECLINLINE(void) VBoxVrListIterInit(PVBOXVR_LIST pList, PVBOXVR_LIST_ITERATOR pIter)
154{
155 pIter->pList = pList;
156 pIter->pNextEntry = pList->ListHead.pNext;
157}
158
159typedef struct VBOXVR_REG
160{
161 RTLISTNODE ListEntry;
162 RTRECT Rect;
163} VBOXVR_REG, *PVBOXVR_REG;
164
165#define PVBOXVR_REG_FROM_ENTRY(_pEntry) ((PVBOXVR_REG)(((uint8_t*)(_pEntry)) - RT_OFFSETOF(VBOXVR_REG, ListEntry)))
166
167DECLINLINE(PCRTRECT) VBoxVrListIterNext(PVBOXVR_LIST_ITERATOR pIter)
168{
169 PRTLISTNODE pNextEntry = pIter->pNextEntry;
170 if (pNextEntry != &pIter->pList->ListHead)
171 {
172 PCRTRECT pRect = &(PVBOXVR_REG_FROM_ENTRY(pNextEntry)->Rect);
173 pIter->pNextEntry = pNextEntry->pNext;
174 return pRect;
175 }
176 return NULL;
177}
178
179typedef struct VBOXVR_COMPOSITOR_ENTRY
180{
181 RTLISTNODE Node;
182 VBOXVR_LIST Vr;
183} VBOXVR_COMPOSITOR_ENTRY, *PVBOXVR_COMPOSITOR_ENTRY;
184
185struct VBOXVR_COMPOSITOR;
186
187typedef DECLCALLBACK(void) FNVBOXVRCOMPOSITOR_ENTRY_REMOVED(const struct VBOXVR_COMPOSITOR *pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, PVBOXVR_COMPOSITOR_ENTRY pReplacingEntry);
188typedef FNVBOXVRCOMPOSITOR_ENTRY_REMOVED *PFNVBOXVRCOMPOSITOR_ENTRY_REMOVED;
189
190typedef struct VBOXVR_COMPOSITOR
191{
192 RTLISTNODE List;
193 PFNVBOXVRCOMPOSITOR_ENTRY_REMOVED pfnEntryRemoved;
194} VBOXVR_COMPOSITOR, *PVBOXVR_COMPOSITOR;
195
196typedef DECLCALLBACK(bool) FNVBOXVRCOMPOSITOR_VISITOR(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, void *pvVisitor);
197typedef FNVBOXVRCOMPOSITOR_VISITOR *PFNVBOXVRCOMPOSITOR_VISITOR;
198
199VBOXVREGDECL(void) VBoxVrCompositorInit(PVBOXVR_COMPOSITOR pCompositor, PFNVBOXVRCOMPOSITOR_ENTRY_REMOVED pfnEntryRemoved);
200VBOXVREGDECL(void) VBoxVrCompositorTerm(PVBOXVR_COMPOSITOR pCompositor);
201VBOXVREGDECL(void) VBoxVrCompositorEntryInit(PVBOXVR_COMPOSITOR_ENTRY pEntry);
202DECLINLINE(bool) VBoxVrCompositorEntryIsInList(const VBOXVR_COMPOSITOR_ENTRY *pEntry)
203{
204 return !VBoxVrListIsEmpty(&pEntry->Vr);
205}
206
207/* compositor regions changed
208 * always comes with VBOXVR_COMPOSITOR_CF_ENTRY_REGIONS_CHANGED */
209#define VBOXVR_COMPOSITOR_CF_REGIONS_CHANGED 0x00000001
210/* only current entry regions changed */
211#define VBOXVR_COMPOSITOR_CF_ENTRY_REGIONS_CHANGED 0x00000002
212/* the given entry has replaced some other entry, while overal regions did NOT change.
213 * always comes with VBOXVR_COMPOSITOR_CF_ENTRY_REGIONS_CHANGED */
214#define VBOXVR_COMPOSITOR_CF_ENTRY_REPLACED 0x00000004
215
216
217VBOXVREGDECL(bool) VBoxVrCompositorEntryRemove(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry);
218VBOXVREGDECL(int) VBoxVrCompositorEntryRegionsAdd(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, uint32_t cRegions, const RTRECT *paRegions, uint32_t *pfChangeFlags);
219VBOXVREGDECL(int) VBoxVrCompositorEntryRegionsSubst(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, uint32_t cRegions, const RTRECT *paRegions, bool *pfChanged);
220VBOXVREGDECL(int) VBoxVrCompositorEntryRegionsSet(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, uint32_t cRegions, const RTRECT *paRegions, bool *pfChanged);
221VBOXVREGDECL(int) VBoxVrCompositorEntryRegionsIntersect(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, uint32_t cRegions, const RTRECT *paRegions, bool *pfChanged);
222VBOXVREGDECL(int) VBoxVrCompositorEntryListIntersect(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, const VBOXVR_LIST *pList2, bool *pfChanged);
223VBOXVREGDECL(int) VBoxVrCompositorEntryRegionsIntersectAll(PVBOXVR_COMPOSITOR pCompositor, uint32_t cRegions, const RTRECT *paRegions, bool *pfChanged);
224VBOXVREGDECL(int) VBoxVrCompositorEntryListIntersectAll(PVBOXVR_COMPOSITOR pCompositor, const VBOXVR_LIST *pList2, bool *pfChanged);
225VBOXVREGDECL(int) VBoxVrCompositorEntryRegionsTranslate(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, int32_t x, int32_t y, bool *pfChanged);
226VBOXVREGDECL(void) VBoxVrCompositorVisit(PVBOXVR_COMPOSITOR pCompositor, PFNVBOXVRCOMPOSITOR_VISITOR pfnVisitor, void *pvVisitor);
227
228DECLINLINE(bool) VBoxVrCompositorIsEmpty(const VBOXVR_COMPOSITOR *pCompositor)
229{
230 return RTListIsEmpty(&pCompositor->List);
231}
232
233typedef struct VBOXVR_COMPOSITOR_ITERATOR
234{
235 PVBOXVR_COMPOSITOR pCompositor;
236 PRTLISTNODE pNextEntry;
237} VBOXVR_COMPOSITOR_ITERATOR ,*PVBOXVR_COMPOSITOR_ITERATOR;
238
239DECLINLINE(void) VBoxVrCompositorIterInit(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ITERATOR pIter)
240{
241 pIter->pCompositor = pCompositor;
242 pIter->pNextEntry = pCompositor->List.pNext;
243}
244
245#define VBOXVR_COMPOSITOR_ENTRY_FROM_NODE(_p) ((PVBOXVR_COMPOSITOR_ENTRY)(((uint8_t*)(_p)) - RT_OFFSETOF(VBOXVR_COMPOSITOR_ENTRY, Node)))
246
247DECLINLINE(PVBOXVR_COMPOSITOR_ENTRY) VBoxVrCompositorIterNext(PVBOXVR_COMPOSITOR_ITERATOR pIter)
248{
249 PRTLISTNODE pNextEntry = pIter->pNextEntry;
250 if (pNextEntry != &pIter->pCompositor->List)
251 {
252 PVBOXVR_COMPOSITOR_ENTRY pEntry = VBOXVR_COMPOSITOR_ENTRY_FROM_NODE(pNextEntry);
253 pIter->pNextEntry = pNextEntry->pNext;
254 return pEntry;
255 }
256 return NULL;
257}
258
259/* Compositor with Stretching & Cached Rectangles info */
260
261typedef struct VBOXVR_TEXTURE
262{
263 int32_t width;
264 int32_t height;
265 uint32_t target;
266 uint32_t hwid;
267} VBOXVR_TEXTURE, *PVBOXVR_TEXTURE;
268
269typedef struct VBOXVR_SCR_COMPOSITOR_ENTRY
270{
271 VBOXVR_COMPOSITOR_ENTRY Ce;
272 VBOXVR_TEXTURE Tex;
273 RTPOINT Pos;
274 uint32_t fChanged;
275 uint32_t cRects;
276 PRTRECT paSrcRects;
277 PRTRECT paDstRects;
278} VBOXVR_SCR_COMPOSITOR_ENTRY, *PVBOXVR_SCR_COMPOSITOR_ENTRY;
279
280typedef struct VBOXVR_SCR_COMPOSITOR
281{
282 VBOXVR_COMPOSITOR Compositor;
283 float StretchX;
284 float StretchY;
285 uint32_t cRects;
286 uint32_t cRectsBuffer;
287 PRTRECT paSrcRects;
288 PRTRECT paDstRects;
289 RTCRITSECT CritSect;
290} VBOXVR_SCR_COMPOSITOR, *PVBOXVR_SCR_COMPOSITOR;
291
292typedef DECLCALLBACK(bool) FNVBOXVRSCRCOMPOSITOR_VISITOR(PVBOXVR_SCR_COMPOSITOR pCompositor, PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry, void *pvVisitor);
293typedef FNVBOXVRSCRCOMPOSITOR_VISITOR *PFNVBOXVRSCRCOMPOSITOR_VISITOR;
294
295DECLINLINE(void) CrVrScrCompositorEntryInit(PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry, const VBOXVR_TEXTURE *pTex)
296{
297 VBoxVrCompositorEntryInit(&pEntry->Ce);
298 pEntry->Tex = *pTex;
299 memset(&pEntry->Pos, 0, sizeof (VBOXVR_SCR_COMPOSITOR_ENTRY) - RT_OFFSETOF(VBOXVR_SCR_COMPOSITOR_ENTRY, Pos));
300}
301
302DECLINLINE(bool) CrVrScrCompositorEntryIsUsed(const VBOXVR_SCR_COMPOSITOR_ENTRY *pEntry)
303{
304 return VBoxVrCompositorEntryIsInList(&pEntry->Ce);
305}
306
307DECLINLINE(void) CrVrScrCompositorEntrySetChanged(PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry, bool fChanged)
308{
309 pEntry->fChanged = !!fChanged;
310}
311
312DECLINLINE(void) CrVrScrCompositorEntryTexNameUpdate(PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry, uint32_t hwid)
313{
314 pEntry->Tex.hwid = hwid;
315 CrVrScrCompositorEntrySetChanged(pEntry, true);
316}
317
318DECLINLINE(const VBOXVR_TEXTURE *) CrVrScrCompositorEntryTexGet(const VBOXVR_SCR_COMPOSITOR_ENTRY *pEntry)
319{
320 return &pEntry->Tex;
321}
322
323DECLINLINE(bool) CrVrScrCompositorEntryIsChanged(const VBOXVR_SCR_COMPOSITOR_ENTRY *pEntry)
324{
325 return !!pEntry->fChanged;
326}
327
328DECLINLINE(bool) CrVrScrCompositorIsEmpty(const VBOXVR_SCR_COMPOSITOR *pCompositor)
329{
330 return VBoxVrCompositorIsEmpty(&pCompositor->Compositor);
331}
332
333VBOXVREGDECL(int) CrVrScrCompositorEntryTexUpdate(PVBOXVR_SCR_COMPOSITOR pCompositor, PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry, const VBOXVR_TEXTURE *pTex);
334VBOXVREGDECL(void) CrVrScrCompositorVisit(PVBOXVR_SCR_COMPOSITOR pCompositor, PFNVBOXVRSCRCOMPOSITOR_VISITOR pfnVisitor, void *pvVisitor);
335VBOXVREGDECL(void) CrVrScrCompositorEntrySetAllChanged(PVBOXVR_SCR_COMPOSITOR pCompositor, bool fChanged);
336DECLINLINE(bool) CrVrScrCompositorEntryIsInList(const VBOXVR_SCR_COMPOSITOR_ENTRY *pEntry)
337{
338 return VBoxVrCompositorEntryIsInList(&pEntry->Ce);
339}
340VBOXVREGDECL(int) CrVrScrCompositorEntryRegionsAdd(PVBOXVR_SCR_COMPOSITOR pCompositor, PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry, const RTPOINT *pPos, uint32_t cRegions, const RTRECT *paRegions, uint32_t *pfChangeFlags);
341VBOXVREGDECL(int) CrVrScrCompositorEntryRegionsSet(PVBOXVR_SCR_COMPOSITOR pCompositor, PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry, const RTPOINT *pPos, uint32_t cRegions, const RTRECT *paRegions, bool *pfChanged);
342VBOXVREGDECL(int) CrVrScrCompositorEntryListIntersect(PVBOXVR_SCR_COMPOSITOR pCompositor, PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry, const VBOXVR_LIST *pList2, bool *pfChanged);
343VBOXVREGDECL(int) CrVrScrCompositorEntryRegionsIntersect(PVBOXVR_SCR_COMPOSITOR pCompositor, PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry, uint32_t cRegions, const RTRECT *paRegions, bool *pfChanged);
344VBOXVREGDECL(int) CrVrScrCompositorEntryRegionsIntersectAll(PVBOXVR_SCR_COMPOSITOR pCompositor, uint32_t cRegions, const RTRECT *paRegions, bool *pfChanged);
345VBOXVREGDECL(int) CrVrScrCompositorEntryListIntersectAll(PVBOXVR_SCR_COMPOSITOR pCompositor, const VBOXVR_LIST *pList2, bool *pfChanged);
346VBOXVREGDECL(int) CrVrScrCompositorEntryPosSet(PVBOXVR_SCR_COMPOSITOR pCompositor, PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry, const RTPOINT *pPos);
347
348/* regions are valid until the next CrVrScrCompositor call */
349VBOXVREGDECL(int) CrVrScrCompositorEntryRegionsGet(PVBOXVR_SCR_COMPOSITOR pCompositor, PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry, uint32_t *pcRegions, const RTRECT **ppaSrcRegions, const RTRECT **ppaDstRegions);
350VBOXVREGDECL(int) CrVrScrCompositorEntryRemove(PVBOXVR_SCR_COMPOSITOR pCompositor, PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry);
351VBOXVREGDECL(int) CrVrScrCompositorInit(PVBOXVR_SCR_COMPOSITOR pCompositor);
352VBOXVREGDECL(void) CrVrScrCompositorTerm(PVBOXVR_SCR_COMPOSITOR pCompositor);
353VBOXVREGDECL(void) CrVrScrCompositorSetStretching(PVBOXVR_SCR_COMPOSITOR pCompositor, float StretchX, float StretchY);
354/* regions are valid until the next CrVrScrCompositor call */
355VBOXVREGDECL(int) CrVrScrCompositorRegionsGet(PVBOXVR_SCR_COMPOSITOR pCompositor, uint32_t *pcRegions, const RTRECT **ppaSrcRegions, const RTRECT **ppaDstRegions);
356
357#define VBOXVR_SCR_COMPOSITOR_ENTRY_FROM_ENTRY(_p) ((PVBOXVR_SCR_COMPOSITOR_ENTRY)(((uint8_t*)(_p)) - RT_OFFSETOF(VBOXVR_SCR_COMPOSITOR_ENTRY, Ce)))
358#define VBOXVR_SCR_COMPOSITOR_FROM_COMPOSITOR(_p) ((PVBOXVR_SCR_COMPOSITOR)(((uint8_t*)(_p)) - RT_OFFSETOF(VBOXVR_SCR_COMPOSITOR, Compositor)))
359
360typedef struct VBOXVR_SCR_COMPOSITOR_ITERATOR
361{
362 VBOXVR_COMPOSITOR_ITERATOR Base;
363} VBOXVR_SCR_COMPOSITOR_ITERATOR ,*PVBOXVR_SCR_COMPOSITOR_ITERATOR;
364
365DECLINLINE(void) CrVrScrCompositorIterInit(PVBOXVR_SCR_COMPOSITOR pCompositor, PVBOXVR_SCR_COMPOSITOR_ITERATOR pIter)
366{
367 VBoxVrCompositorIterInit(&pCompositor->Compositor, &pIter->Base);
368}
369
370DECLINLINE(PVBOXVR_SCR_COMPOSITOR_ENTRY) CrVrScrCompositorIterNext(PVBOXVR_SCR_COMPOSITOR_ITERATOR pIter)
371{
372 PVBOXVR_COMPOSITOR_ENTRY pCe = VBoxVrCompositorIterNext(&pIter->Base);
373 if (pCe)
374 {
375 return VBOXVR_SCR_COMPOSITOR_ENTRY_FROM_ENTRY(pCe);
376 }
377 return NULL;
378}
379
380DECLINLINE(int) CrVrScrCompositorLock(PVBOXVR_SCR_COMPOSITOR pCompositor)
381{
382 int rc = RTCritSectEnter(&pCompositor->CritSect);
383 AssertRC(rc);
384 return rc;
385}
386
387DECLINLINE(int) CrVrScrCompositorUnlock(PVBOXVR_SCR_COMPOSITOR pCompositor)
388{
389 int rc = RTCritSectLeave(&pCompositor->CritSect);
390 AssertRC(rc);
391 return rc;
392}
393
394RT_C_DECLS_END
395
396#endif /* #ifndef ___cr_vreg_h_ */
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