Changeset 53586 in vbox for trunk/src/VBox
- Timestamp:
- Dec 21, 2014 4:06:53 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/OpenGL/include/cr_vreg.h
r50944 r53586 1 1 /* $Id$ */ 2 3 2 /** @file 4 3 * Visible Regions processing API … … 6 5 7 6 /* 8 * Copyright (C) 2012 Oracle Corporation7 * Copyright (C) 2012-2014 Oracle Corporation 9 8 * 10 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 16 15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. 17 16 */ 17 18 18 #ifndef ___cr_vreg_h_ 19 19 #define ___cr_vreg_h_ … … 39 39 typedef struct VBOXVR_LIST 40 40 { 41 RTLIST NODEListHead;41 RTLISTANCHOR ListHead; 42 42 uint32_t cEntries; 43 } VBOXVR_LIST, *PVBOXVR_LIST; 44 45 DECLINLINE(int) VBoxRectCmp(const RTRECT * pRect1, const RTRECT * pRect2) 46 { 47 return memcmp(pRect1, pRect2, sizeof (*pRect1)); 43 } VBOXVR_LIST; 44 typedef VBOXVR_LIST *PVBOXVR_LIST; 45 typedef VBOXVR_LIST const *PCVBOXVR_LIST; 46 47 DECLINLINE(int) VBoxRectCmp(PCRTRECT pRect1, PCRTRECT pRect2) 48 { 49 return memcmp(pRect1, pRect2, sizeof(*pRect1)); 48 50 } 49 51 50 52 #ifndef IN_RING0 51 # define CR_FLOAT_RCAST(_t, _v) ((_t)((float)(_v) + 0.5))53 # define CR_FLOAT_RCAST(_t, _v) ((_t)((float)(_v) + 0.5)) 52 54 53 55 DECLINLINE(void) VBoxRectScale(PRTRECT pRect, float xScale, float yScale) 54 56 { 55 pRect->xLeft = CR_FLOAT_RCAST(int32_t, pRect->xLeft* xScale);56 pRect->yTop = CR_FLOAT_RCAST(int32_t, pRect->yTop* yScale);57 pRect->xRight = CR_FLOAT_RCAST(int32_t, pRect->xRight* xScale);57 pRect->xLeft = CR_FLOAT_RCAST(int32_t, pRect->xLeft * xScale); 58 pRect->yTop = CR_FLOAT_RCAST(int32_t, pRect->yTop * yScale); 59 pRect->xRight = CR_FLOAT_RCAST(int32_t, pRect->xRight * xScale); 58 60 pRect->yBottom = CR_FLOAT_RCAST(int32_t, pRect->yBottom * yScale); 59 61 } 60 62 61 DECLINLINE(void) VBoxRectScaled( const RTRECT *pRect, float xScale, float yScale, PRTRECT pResult)63 DECLINLINE(void) VBoxRectScaled(PCRTRECT pRect, float xScale, float yScale, PRTRECT pResult) 62 64 { 63 65 *pResult = *pRect; … … 67 69 DECLINLINE(void) VBoxRectUnscale(PRTRECT pRect, float xScale, float yScale) 68 70 { 69 pRect->xLeft = CR_FLOAT_RCAST(int32_t, pRect->xLeft/ xScale);70 pRect->yTop = CR_FLOAT_RCAST(int32_t, pRect->yTop/ yScale);71 pRect->xRight = CR_FLOAT_RCAST(int32_t, pRect->xRight/ xScale);71 pRect->xLeft = CR_FLOAT_RCAST(int32_t, pRect->xLeft / xScale); 72 pRect->yTop = CR_FLOAT_RCAST(int32_t, pRect->yTop / yScale); 73 pRect->xRight = CR_FLOAT_RCAST(int32_t, pRect->xRight / xScale); 72 74 pRect->yBottom = CR_FLOAT_RCAST(int32_t, pRect->yBottom / yScale); 73 75 } 74 76 75 DECLINLINE(void) VBoxRectUnscaled( const RTRECT *pRect, float xScale, float yScale, PRTRECT pResult)77 DECLINLINE(void) VBoxRectUnscaled(PCRTRECT pRect, float xScale, float yScale, PRTRECT pResult) 76 78 { 77 79 *pResult = *pRect; 78 80 VBoxRectUnscale(pResult, xScale, yScale); 79 81 } 80 #endif 81 82 DECLINLINE(void) VBoxRectIntersect(PRTRECT pRect1, const RTRECT * pRect2) 82 83 #endif /* IN_RING0 */ 84 85 DECLINLINE(void) VBoxRectIntersect(PRTRECT pRect1, PCRTRECT pRect2) 83 86 { 84 87 Assert(pRect1); 85 88 Assert(pRect2); 86 pRect1->xLeft = RT_MAX(pRect1->xLeft,pRect2->xLeft);87 pRect1->yTop = RT_MAX(pRect1->yTop,pRect2->yTop);88 pRect1->xRight = RT_MIN(pRect1->xRight,pRect2->xRight);89 pRect1->xLeft = RT_MAX(pRect1->xLeft, pRect2->xLeft); 90 pRect1->yTop = RT_MAX(pRect1->yTop, pRect2->yTop); 91 pRect1->xRight = RT_MIN(pRect1->xRight, pRect2->xRight); 89 92 pRect1->yBottom = RT_MIN(pRect1->yBottom, pRect2->yBottom); 90 93 /* ensure the rect is valid */ 91 pRect1->xRight = RT_MAX(pRect1->xRight,pRect1->xLeft);94 pRect1->xRight = RT_MAX(pRect1->xRight, pRect1->xLeft); 92 95 pRect1->yBottom = RT_MAX(pRect1->yBottom, pRect1->yTop); 93 96 } 94 97 95 DECLINLINE(void) VBoxRectIntersected( const RTRECT *pRect1, const RTRECT * pRect2, RTRECT *pResult)98 DECLINLINE(void) VBoxRectIntersected(PCRTRECT pRect1, PCRTRECT pRect2, PRTRECT pResult) 96 99 { 97 100 *pResult = *pRect1; … … 100 103 101 104 102 DECLINLINE(void) VBoxRectTranslate( RTRECT *pRect, int32_t x, int32_t y)105 DECLINLINE(void) VBoxRectTranslate(PRTRECT pRect, int32_t x, int32_t y) 103 106 { 104 107 pRect->xLeft += x; … … 108 111 } 109 112 110 DECLINLINE(void) VBoxRectTranslated( const RTRECT * pRect, int32_t x, int32_t y, RTRECT *pResult)113 DECLINLINE(void) VBoxRectTranslated(PCRTRECT pRect, int32_t x, int32_t y, PRTRECT pResult) 111 114 { 112 115 *pResult = *pRect; … … 114 117 } 115 118 116 DECLINLINE(void) VBoxRectInvertY( RTRECT *pRect)119 DECLINLINE(void) VBoxRectInvertY(PRTRECT pRect) 117 120 { 118 121 int32_t y = pRect->yTop; … … 121 124 } 122 125 123 DECLINLINE(void) VBoxRectInvertedY( const RTRECT * pRect, RTRECT *pResult)126 DECLINLINE(void) VBoxRectInvertedY(PCRTRECT pRect, PRTRECT pResult) 124 127 { 125 128 *pResult = *pRect; … … 127 130 } 128 131 129 DECLINLINE(void) VBoxRectMove( RTRECT *pRect, int32_t x, int32_t y)130 { 131 int32_t w = pRect->xRight- pRect->xLeft;132 int32_t h= pRect->yBottom - pRect->yTop;132 DECLINLINE(void) VBoxRectMove(PRTRECT pRect, int32_t x, int32_t y) 133 { 134 int32_t cx = pRect->xRight - pRect->xLeft; 135 int32_t cy = pRect->yBottom - pRect->yTop; 133 136 pRect->xLeft = x; 134 137 pRect->yTop = y; 135 pRect->xRight = w+ x;136 pRect->yBottom = h+ y;137 } 138 139 DECLINLINE(void) VBoxRectMoved( const RTRECT * pRect, int32_t x, int32_t y, RTRECT *pResult)138 pRect->xRight = cx + x; 139 pRect->yBottom = cy + y; 140 } 141 142 DECLINLINE(void) VBoxRectMoved(PCRTRECT pRect, int32_t x, int32_t y, PRTRECT pResult) 140 143 { 141 144 *pResult = *pRect; … … 143 146 } 144 147 145 DECLINLINE(bool) VBoxRectCovers( const RTRECT *pRect, const RTRECT *pCovered)146 { 147 Assert (pRect);148 Assert (pCovered);148 DECLINLINE(bool) VBoxRectCovers(PCRTRECT pRect, PCRTRECT pCovered) 149 { 150 AssertPtr(pRect); 151 AssertPtr(pCovered); 149 152 if (pRect->xLeft > pCovered->xLeft) 150 153 return false; … … 158 161 } 159 162 160 DECLINLINE(bool) VBoxRectIsZero( const RTRECT *pRect)163 DECLINLINE(bool) VBoxRectIsZero(PCRTRECT pRect) 161 164 { 162 165 return pRect->xLeft == pRect->xRight || pRect->yTop == pRect->yBottom; 163 166 } 164 167 165 DECLINLINE(bool) VBoxRectIsIntersect( const RTRECT * pRect1, const RTRECT *pRect2)166 { 167 return !( (pRect1->xLeft < pRect2->xLeft && pRect1->xRight<= pRect2->xLeft)168 || (pRect2->xLeft < pRect1->xLeft && pRect2->xRight<= pRect1->xLeft)169 || (pRect1->yTop < pRect2->yTop&& pRect1->yBottom <= pRect2->yTop)170 || (pRect2->yTop < pRect1->yTop && pRect2->yBottom <= pRect1->yTop));171 } 172 173 DECLINLINE(uint32_t) VBoxVrListRectsCount( const VBOXVR_LIST *pList)168 DECLINLINE(bool) VBoxRectIsIntersect(PCRTRECT pRect1, PCRTRECT pRect2) 169 { 170 return !( (pRect1->xLeft < pRect2->xLeft && pRect1->xRight <= pRect2->xLeft) 171 || (pRect2->xLeft < pRect1->xLeft && pRect2->xRight <= pRect1->xLeft) 172 || (pRect1->yTop < pRect2->yTop && pRect1->yBottom <= pRect2->yTop) 173 || (pRect2->yTop < pRect1->yTop && pRect2->yBottom <= pRect1->yTop) ); 174 } 175 176 DECLINLINE(uint32_t) VBoxVrListRectsCount(PCVBOXVR_LIST pList) 174 177 { 175 178 return pList->cEntries; 176 179 } 177 180 178 DECLINLINE(bool) VBoxVrListIsEmpty( const VBOXVR_LIST *pList)181 DECLINLINE(bool) VBoxVrListIsEmpty(PCVBOXVR_LIST pList) 179 182 { 180 183 return !VBoxVrListRectsCount(pList); … … 194 197 VBOXVREGDECL(void) VBoxVrListTranslate(PVBOXVR_LIST pList, int32_t x, int32_t y); 195 198 196 VBOXVREGDECL(int) VBoxVrListCmp( const VBOXVR_LIST *pList1, const VBOXVR_LIST *pList2);197 198 VBOXVREGDECL(int) VBoxVrListRectsSet(PVBOXVR_LIST pList, uint32_t cRects, const RTRECT *aRects, bool *pfChanged);199 VBOXVREGDECL(int) VBoxVrListRectsAdd(PVBOXVR_LIST pList, uint32_t cRects, const RTRECT *aRects, bool *pfChanged);200 VBOXVREGDECL(int) VBoxVrListRectsSubst(PVBOXVR_LIST pList, uint32_t cRects, const RTRECT *aRects, bool *pfChanged);201 VBOXVREGDECL(int) VBoxVrListRectsGet(PVBOXVR_LIST pList, uint32_t cRects, RTRECT *aRects);202 203 VBOXVREGDECL(int) VBoxVrListClone( const VBOXVR_LIST *pList, VBOXVR_LIST *pDstList);199 VBOXVREGDECL(int) VBoxVrListCmp(PCVBOXVR_LIST pList1, PCVBOXVR_LIST pList2); 200 201 VBOXVREGDECL(int) VBoxVrListRectsSet(PVBOXVR_LIST pList, uint32_t cRects, PCRTRECT paRects, bool *pfChanged); 202 VBOXVREGDECL(int) VBoxVrListRectsAdd(PVBOXVR_LIST pList, uint32_t cRects, PCRTRECT paRects, bool *pfChanged); 203 VBOXVREGDECL(int) VBoxVrListRectsSubst(PVBOXVR_LIST pList, uint32_t cRects, PCRTRECT paRects, bool *pfChanged); 204 VBOXVREGDECL(int) VBoxVrListRectsGet(PVBOXVR_LIST pList, uint32_t cRects, PRTRECT paRects); 205 206 VBOXVREGDECL(int) VBoxVrListClone(PCVBOXVR_LIST pList, VBOXVR_LIST *pDstList); 204 207 205 208 /* NOTE: with the current implementation the VBoxVrListIntersect is faster than VBoxVrListRectsIntersect, 206 * i.e. VBoxVrListRectsIntersect is actually a convenience function that create a temporary list and calls VBoxVrListIntersect internally */ 207 VBOXVREGDECL(int) VBoxVrListRectsIntersect(PVBOXVR_LIST pList, uint32_t cRects, const RTRECT * aRects, bool *pfChanged); 208 VBOXVREGDECL(int) VBoxVrListIntersect(PVBOXVR_LIST pList, const VBOXVR_LIST *pList2, bool *pfChanged); 209 * i.e. VBoxVrListRectsIntersect is actually a convenience function that create a temporary list and calls 210 * VBoxVrListIntersect internally. */ 211 VBOXVREGDECL(int) VBoxVrListRectsIntersect(PVBOXVR_LIST pList, uint32_t cRects, PCRTRECT paRects, bool *pfChanged); 212 VBOXVREGDECL(int) VBoxVrListIntersect(PVBOXVR_LIST pList, PCVBOXVR_LIST pList2, bool *pfChanged); 209 213 210 214 VBOXVREGDECL(int) VBoxVrInit(void); … … 215 219 PVBOXVR_LIST pList; 216 220 PRTLISTNODE pNextEntry; 217 } VBOXVR_LIST_ITERATOR, *PVBOXVR_LIST_ITERATOR; 221 } VBOXVR_LIST_ITERATOR; 222 typedef VBOXVR_LIST_ITERATOR *PVBOXVR_LIST_ITERATOR; 223 typedef VBOXVR_LIST_ITERATOR const *PCVBOXVR_LIST_ITERATOR; 218 224 219 225 DECLINLINE(void) VBoxVrListIterInit(PVBOXVR_LIST pList, PVBOXVR_LIST_ITERATOR pIter) … … 227 233 RTLISTNODE ListEntry; 228 234 RTRECT Rect; 229 } VBOXVR_REG, *PVBOXVR_REG; 230 231 #define PVBOXVR_REG_FROM_ENTRY(_pEntry) ((PVBOXVR_REG)(((uint8_t*)(_pEntry)) - RT_OFFSETOF(VBOXVR_REG, ListEntry))) 235 } VBOXVR_REG; 236 typedef VBOXVR_REG *PVBOXVR_REG; 237 typedef VBOXVR_REG const *PCVBOXVR_REG; 238 239 #define PVBOXVR_REG_FROM_ENTRY(_pEntry) RT_FROM_MEMBER(_pEntry, VBOXVR_REG, ListEntry) 232 240 233 241 DECLINLINE(PCRTRECT) VBoxVrListIterNext(PVBOXVR_LIST_ITERATOR pIter) … … 236 244 if (pNextEntry != &pIter->pList->ListHead) 237 245 { 238 PCRTRECT pRect = & (PVBOXVR_REG_FROM_ENTRY(pNextEntry)->Rect);246 PCRTRECT pRect = &PVBOXVR_REG_FROM_ENTRY(pNextEntry)->Rect; 239 247 pIter->pNextEntry = pNextEntry->pNext; 240 248 return pRect; … … 248 256 VBOXVR_LIST Vr; 249 257 uint32_t cRefs; 250 } VBOXVR_COMPOSITOR_ENTRY, *PVBOXVR_COMPOSITOR_ENTRY; 258 } VBOXVR_COMPOSITOR_ENTRY; 259 typedef VBOXVR_COMPOSITOR_ENTRY *PVBOXVR_COMPOSITOR_ENTRY; 260 typedef VBOXVR_COMPOSITOR_ENTRY const *PCVBOXVR_COMPOSITOR_ENTRY; 251 261 252 262 struct VBOXVR_COMPOSITOR; 253 263 254 typedef DECLCALLBACK(void) FNVBOXVRCOMPOSITOR_ENTRY_RELEASED(const struct VBOXVR_COMPOSITOR *pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, PVBOXVR_COMPOSITOR_ENTRY pReplacingEntry); 264 typedef DECLCALLBACK(void) FNVBOXVRCOMPOSITOR_ENTRY_RELEASED(const struct VBOXVR_COMPOSITOR *pCompositor, 265 PVBOXVR_COMPOSITOR_ENTRY pEntry, 266 PVBOXVR_COMPOSITOR_ENTRY pReplacingEntry); 255 267 typedef FNVBOXVRCOMPOSITOR_ENTRY_RELEASED *PFNVBOXVRCOMPOSITOR_ENTRY_RELEASED; 256 268 257 269 typedef struct VBOXVR_COMPOSITOR 258 270 { 259 RTLIST NODEList;271 RTLISTANCHOR List; 260 272 PFNVBOXVRCOMPOSITOR_ENTRY_RELEASED pfnEntryReleased; 261 } VBOXVR_COMPOSITOR, *PVBOXVR_COMPOSITOR; 262 263 typedef DECLCALLBACK(bool) FNVBOXVRCOMPOSITOR_VISITOR(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, void *pvVisitor); 273 } VBOXVR_COMPOSITOR; 274 typedef VBOXVR_COMPOSITOR *PVBOXVR_COMPOSITOR; 275 typedef VBOXVR_COMPOSITOR const *PCVBOXVR_COMPOSITOR; 276 277 typedef DECLCALLBACK(bool) FNVBOXVRCOMPOSITOR_VISITOR(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, 278 void *pvVisitor); 264 279 typedef FNVBOXVRCOMPOSITOR_VISITOR *PFNVBOXVRCOMPOSITOR_VISITOR; 265 280 … … 268 283 VBOXVREGDECL(void) VBoxVrCompositorRegionsClear(PVBOXVR_COMPOSITOR pCompositor, bool *pfChanged); 269 284 VBOXVREGDECL(void) VBoxVrCompositorEntryInit(PVBOXVR_COMPOSITOR_ENTRY pEntry); 270 DECLINLINE(bool) VBoxVrCompositorEntryIsInList(const VBOXVR_COMPOSITOR_ENTRY *pEntry) 285 286 DECLINLINE(bool) VBoxVrCompositorEntryIsInList(PCVBOXVR_COMPOSITOR_ENTRY pEntry) 271 287 { 272 288 return !VBoxVrListIsEmpty(&pEntry->Vr); … … 284 300 #define CRBLT_FOP_COMBINE(_f1, _f2) ((((_f1) ^ (_f2)) & CRBLT_FTYPE_XOR) | (((_f1) | (_f2)) & CRBLT_FTYPE_OR)) 285 301 286 #define CRBLT_FLAGS_FROM_FILTER(_f) ( ((_f) & GL_LINEAR) ? CRBLT_F_LINEAR : 0)287 #define CRBLT_FILTER_FROM_FLAGS(_f) (((_f) & CRBLT_F_LINEAR) ? GL_LINEAR : GL_NEAREST)302 #define CRBLT_FLAGS_FROM_FILTER(_f) ( ((_f) & GL_LINEAR) ? CRBLT_F_LINEAR : 0) 303 #define CRBLT_FILTER_FROM_FLAGS(_f) (((_f) & CRBLT_F_LINEAR) ? GL_LINEAR : GL_NEAREST) 288 304 289 305 /* compositor regions changed */ … … 301 317 302 318 VBOXVREGDECL(bool) VBoxVrCompositorEntryRemove(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry); 303 VBOXVREGDECL(bool) VBoxVrCompositorEntryReplace(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, PVBOXVR_COMPOSITOR_ENTRY pNewEntry); 304 VBOXVREGDECL(int) VBoxVrCompositorEntryRegionsAdd(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, uint32_t cRegions, const RTRECT *paRegions, PVBOXVR_COMPOSITOR_ENTRY *ppReplacedEntry, uint32_t *pfChangeFlags); 305 VBOXVREGDECL(int) VBoxVrCompositorEntryRegionsSubst(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, uint32_t cRegions, const RTRECT *paRegions, bool *pfChanged); 306 VBOXVREGDECL(int) VBoxVrCompositorEntryRegionsSet(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, uint32_t cRegions, const RTRECT *paRegions, bool *pfChanged); 307 VBOXVREGDECL(int) VBoxVrCompositorEntryRegionsIntersect(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, uint32_t cRegions, const RTRECT *paRegions, bool *pfChanged); 308 VBOXVREGDECL(int) VBoxVrCompositorEntryListIntersect(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, const VBOXVR_LIST *pList2, bool *pfChanged); 309 VBOXVREGDECL(int) VBoxVrCompositorEntryRegionsIntersectAll(PVBOXVR_COMPOSITOR pCompositor, uint32_t cRegions, const RTRECT *paRegions, bool *pfChanged); 310 VBOXVREGDECL(int) VBoxVrCompositorEntryListIntersectAll(PVBOXVR_COMPOSITOR pCompositor, const VBOXVR_LIST *pList2, bool *pfChanged); 311 VBOXVREGDECL(int) VBoxVrCompositorEntryRegionsTranslate(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, int32_t x, int32_t y, bool *pfChanged); 319 VBOXVREGDECL(bool) VBoxVrCompositorEntryReplace(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, 320 PVBOXVR_COMPOSITOR_ENTRY pNewEntry); 321 VBOXVREGDECL(int) VBoxVrCompositorEntryRegionsAdd(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, 322 uint32_t cRegions, PCRTRECT paRegions, 323 PVBOXVR_COMPOSITOR_ENTRY *ppReplacedEntry, uint32_t *pfChangeFlags); 324 VBOXVREGDECL(int) VBoxVrCompositorEntryRegionsSubst(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, 325 uint32_t cRegions, PCRTRECT paRegions, bool *pfChanged); 326 VBOXVREGDECL(int) VBoxVrCompositorEntryRegionsSet(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, 327 uint32_t cRegions, PCRTRECT paRegions, bool *pfChanged); 328 VBOXVREGDECL(int) VBoxVrCompositorEntryRegionsIntersect(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, 329 uint32_t cRegions, PCRTRECT paRegions, bool *pfChanged); 330 VBOXVREGDECL(int) VBoxVrCompositorEntryListIntersect(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, 331 PCVBOXVR_LIST pList2, bool *pfChanged); 332 VBOXVREGDECL(int) VBoxVrCompositorEntryRegionsIntersectAll(PVBOXVR_COMPOSITOR pCompositor, uint32_t cRegions, PCRTRECT paRegions, 333 bool *pfChanged); 334 VBOXVREGDECL(int) VBoxVrCompositorEntryListIntersectAll(PVBOXVR_COMPOSITOR pCompositor, PCVBOXVR_LIST pList2, bool *pfChanged); 335 VBOXVREGDECL(int) VBoxVrCompositorEntryRegionsTranslate(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, 336 int32_t x, int32_t y, bool *pfChanged); 312 337 VBOXVREGDECL(void) VBoxVrCompositorVisit(PVBOXVR_COMPOSITOR pCompositor, PFNVBOXVRCOMPOSITOR_VISITOR pfnVisitor, void *pvVisitor); 313 338 314 DECLINLINE(bool) VBoxVrCompositorIsEmpty( const VBOXVR_COMPOSITOR *pCompositor)339 DECLINLINE(bool) VBoxVrCompositorIsEmpty(PCVBOXVR_COMPOSITOR pCompositor) 315 340 { 316 341 return RTListIsEmpty(&pCompositor->List); … … 321 346 PVBOXVR_COMPOSITOR pCompositor; 322 347 PRTLISTNODE pNextEntry; 323 } VBOXVR_COMPOSITOR_ITERATOR ,*PVBOXVR_COMPOSITOR_ITERATOR; 348 } VBOXVR_COMPOSITOR_ITERATOR; 349 typedef VBOXVR_COMPOSITOR_ITERATOR *PVBOXVR_COMPOSITOR_ITERATOR; 324 350 325 351 typedef struct VBOXVR_COMPOSITOR_CONST_ITERATOR 326 352 { 327 const VBOXVR_COMPOSITOR *pCompositor; 328 const RTLISTNODE *pNextEntry; 329 } VBOXVR_COMPOSITOR_CONST_ITERATOR ,*PVBOXVR_COMPOSITOR_CONST_ITERATOR; 353 PCVBOXVR_COMPOSITOR pCompositor; 354 PCRTLISTNODE pNextEntry; 355 } VBOXVR_COMPOSITOR_CONST_ITERATOR; 356 typedef VBOXVR_COMPOSITOR_CONST_ITERATOR *PVBOXVR_COMPOSITOR_CONST_ITERATOR; 330 357 331 358 DECLINLINE(void) VBoxVrCompositorIterInit(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ITERATOR pIter) … … 335 362 } 336 363 337 DECLINLINE(void) VBoxVrCompositorConstIterInit( const VBOXVR_COMPOSITOR *pCompositor, PVBOXVR_COMPOSITOR_CONST_ITERATOR pIter)364 DECLINLINE(void) VBoxVrCompositorConstIterInit(PCVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_CONST_ITERATOR pIter) 338 365 { 339 366 pIter->pCompositor = pCompositor; … … 341 368 } 342 369 343 #define VBOXVR_COMPOSITOR_ENTRY_FROM_NODE(_p) ((PVBOXVR_COMPOSITOR_ENTRY)(((uint8_t*)(_p)) - RT_OFFSETOF(VBOXVR_COMPOSITOR_ENTRY, Node)))344 #define VBOXVR_COMPOSITOR_CONST_ENTRY_FROM_NODE(_p) ((const VBOXVR_COMPOSITOR_ENTRY*)(((uint8_t*)(_p)) - RT_OFFSETOF(VBOXVR_COMPOSITOR_ENTRY, Node)))370 #define VBOXVR_COMPOSITOR_ENTRY_FROM_NODE(_p) RT_FROM_MEMBER(_p, VBOXVR_COMPOSITOR_ENTRY, Node) 371 #define VBOXVR_COMPOSITOR_CONST_ENTRY_FROM_NODE(_p) RT_FROM_MEMBER(_p, const VBOXVR_COMPOSITOR_ENTRY, Node) 345 372 346 373 DECLINLINE(PVBOXVR_COMPOSITOR_ENTRY) VBoxVrCompositorIterNext(PVBOXVR_COMPOSITOR_ITERATOR pIter) … … 356 383 } 357 384 358 DECLINLINE( const VBOXVR_COMPOSITOR_ENTRY*) VBoxVrCompositorConstIterNext(PVBOXVR_COMPOSITOR_CONST_ITERATOR pIter)359 { 360 const RTLISTNODE *pNextEntry = pIter->pNextEntry;385 DECLINLINE(PCVBOXVR_COMPOSITOR_ENTRY) VBoxVrCompositorConstIterNext(PVBOXVR_COMPOSITOR_CONST_ITERATOR pIter) 386 { 387 PCRTLISTNODE pNextEntry = pIter->pNextEntry; 361 388 if (pNextEntry != &pIter->pCompositor->List) 362 389 { 363 const VBOXVR_COMPOSITOR_ENTRY *pEntry = VBOXVR_COMPOSITOR_CONST_ENTRY_FROM_NODE(pNextEntry);390 PCVBOXVR_COMPOSITOR_ENTRY pEntry = VBOXVR_COMPOSITOR_CONST_ENTRY_FROM_NODE(pNextEntry); 364 391 pIter->pNextEntry = pNextEntry->pNext; 365 392 return pEntry; … … 370 397 typedef struct VBOXVR_TEXTURE 371 398 { 372 int32_t width;373 int32_t height;399 int32_t width; 400 int32_t height; 374 401 uint32_t target; 375 402 uint32_t hwid; 376 } VBOXVR_TEXTURE, *PVBOXVR_TEXTURE; 403 } VBOXVR_TEXTURE; 404 typedef VBOXVR_TEXTURE *PVBOXVR_TEXTURE; 405 typedef VBOXVR_TEXTURE const *PCVBOXVR_TEXTURE; 377 406 378 407 RT_C_DECLS_END 379 408 380 #endif /* #ifndef ___cr_vreg_h_ */ 409 #endif 410
Note:
See TracChangeset
for help on using the changeset viewer.