Changeset 48726 in vbox for trunk/src/VBox/GuestHost/OpenGL/util/vreg.cpp
- Timestamp:
- Sep 27, 2013 10:19:54 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/OpenGL/util/vreg.cpp
r47623 r48726 161 161 } 162 162 163 /* moves list data to pDstList and empties the pList */ 164 VBOXVREGDECL(void) VBoxVrListMoveTo(PVBOXVR_LIST pList, PVBOXVR_LIST pDstList) 165 { 166 *pDstList = *pList; 167 pDstList->ListHead.pNext->pPrev = &pDstList->ListHead; 168 pDstList->ListHead.pPrev->pNext = &pDstList->ListHead; 169 VBoxVrListInit(pList); 170 } 171 163 172 #define VBOXVR_MEMTAG 'vDBV' 164 173 … … 1221 1230 } 1222 1231 1232 static void vboxVrCompositorEntryReplace(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, PVBOXVR_COMPOSITOR_ENTRY pReplacingEntry) 1233 { 1234 VBoxVrListMoveTo(&pEntry->Vr, &pReplacingEntry->Vr); 1235 1236 pReplacingEntry->Node = pEntry->Node; 1237 pReplacingEntry->Node.pNext->pPrev = &pReplacingEntry->Node; 1238 pReplacingEntry->Node.pPrev->pNext = &pReplacingEntry->Node; 1239 pEntry->Node.pNext = NULL; 1240 pEntry->Node.pPrev = NULL; 1241 1242 vboxVrCompositorEntryAcquire(pReplacingEntry); 1243 vboxVrCompositorEntryRelease(pCompositor, pEntry, pReplacingEntry); 1244 } 1245 1246 1247 1223 1248 VBOXVREGDECL(void) VBoxVrCompositorEntryInit(PVBOXVR_COMPOSITOR_ENTRY pEntry) 1224 1249 { … … 1229 1254 VBOXVREGDECL(bool) VBoxVrCompositorEntryRemove(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry) 1230 1255 { 1256 if (!VBoxVrCompositorEntryIsInList(pEntry)) 1257 return false; 1258 1231 1259 vboxVrCompositorEntryAcquire(pEntry); 1232 1260 1233 if (!VBoxVrCompositorEntryIsInList(pEntry))1234 {1235 vboxVrCompositorEntryRelease(pCompositor, pEntry, NULL);1236 return false;1237 }1238 1261 VBoxVrListClear(&pEntry->Vr); 1239 1262 vboxVrCompositorEntryRemove(pCompositor, pEntry, NULL); 1240 1263 vboxVrCompositorEntryRelease(pCompositor, pEntry, NULL); 1264 return true; 1265 } 1266 1267 VBOXVREGDECL(bool) VBoxVrCompositorEntryReplace(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, PVBOXVR_COMPOSITOR_ENTRY pNewEntry) 1268 { 1269 if (!VBoxVrCompositorEntryIsInList(pEntry)) 1270 return false; 1271 1272 vboxVrCompositorEntryReplace(pCompositor, pEntry, pNewEntry); 1273 1241 1274 return true; 1242 1275 } … … 2318 2351 } 2319 2352 2320 VBOXVREGDECL(int) CrVrScrCompositorEntryRemove(PVBOXVR_SCR_COMPOSITOR pCompositor, PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry) 2321 { 2322 if (!VBoxVrCompositorEntryRemove(&pCompositor->Compositor, &pEntry->Ce)) 2323 return VINF_SUCCESS; 2324 2325 CrVrScrCompositorEntrySetChanged(pEntry, true); 2353 static void crVrScrCompositorEntryDataCleanup(PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry) 2354 { 2326 2355 pEntry->cRects = 0; 2327 2356 pEntry->paSrcRects = NULL; 2328 2357 pEntry->paDstRects = NULL; 2329 2358 pEntry->paDstUnstretchedRects = NULL; 2359 } 2360 2361 static void crVrScrCompositorEntryDataCopy(PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry, PVBOXVR_SCR_COMPOSITOR_ENTRY pToEntry) 2362 { 2363 pToEntry->cRects = pEntry->cRects; 2364 pToEntry->paSrcRects = pEntry->paSrcRects; 2365 pToEntry->paDstRects = pEntry->paDstRects; 2366 pToEntry->paDstUnstretchedRects = pEntry->paDstUnstretchedRects; 2367 crVrScrCompositorEntryDataCleanup(pEntry); 2368 } 2369 2370 VBOXVREGDECL(int) CrVrScrCompositorEntryRemove(PVBOXVR_SCR_COMPOSITOR pCompositor, PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry) 2371 { 2372 if (!VBoxVrCompositorEntryRemove(&pCompositor->Compositor, &pEntry->Ce)) 2373 return VINF_SUCCESS; 2374 2375 CrVrScrCompositorEntrySetChanged(pEntry, true); 2376 crVrScrCompositorEntryDataCleanup(pEntry); 2330 2377 2331 2378 crVrScrCompositorRectsInvalidate(pCompositor); 2332 2379 return VINF_SUCCESS; 2380 } 2381 2382 VBOXVREGDECL(bool) CrVrScrCompositorEntryReplace(PVBOXVR_SCR_COMPOSITOR pCompositor, PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry, PVBOXVR_SCR_COMPOSITOR_ENTRY pNewEntry) 2383 { 2384 Assert(!CrVrScrCompositorEntryIsUsed(pNewEntry)); 2385 2386 if (!VBoxVrCompositorEntryReplace(&pCompositor->Compositor, &pEntry->Ce, &pNewEntry->Ce)) 2387 return false; 2388 2389 CrVrScrCompositorEntrySetChanged(pEntry, true); 2390 crVrScrCompositorEntryDataCopy(pEntry, pNewEntry); 2391 CrVrScrCompositorEntrySetChanged(pNewEntry, true); 2392 2393 return true; 2333 2394 } 2334 2395
Note:
See TracChangeset
for help on using the changeset viewer.