VirtualBox

Ignore:
Timestamp:
Sep 27, 2013 10:19:54 AM (11 years ago)
Author:
vboxsync
Message:

crOpenGL: seamless fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/OpenGL/util/vreg.cpp

    r47623 r48726  
    161161}
    162162
     163/* moves list data to pDstList and empties the pList */
     164VBOXVREGDECL(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
    163172#define VBOXVR_MEMTAG 'vDBV'
    164173
     
    12211230}
    12221231
     1232static 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
    12231248VBOXVREGDECL(void) VBoxVrCompositorEntryInit(PVBOXVR_COMPOSITOR_ENTRY pEntry)
    12241249{
     
    12291254VBOXVREGDECL(bool) VBoxVrCompositorEntryRemove(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry)
    12301255{
     1256    if (!VBoxVrCompositorEntryIsInList(pEntry))
     1257        return false;
     1258
    12311259    vboxVrCompositorEntryAcquire(pEntry);
    12321260
    1233     if (!VBoxVrCompositorEntryIsInList(pEntry))
    1234     {
    1235         vboxVrCompositorEntryRelease(pCompositor, pEntry, NULL);
    1236         return false;
    1237     }
    12381261    VBoxVrListClear(&pEntry->Vr);
    12391262    vboxVrCompositorEntryRemove(pCompositor, pEntry, NULL);
    12401263    vboxVrCompositorEntryRelease(pCompositor, pEntry, NULL);
     1264    return true;
     1265}
     1266
     1267VBOXVREGDECL(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
    12411274    return true;
    12421275}
     
    23182351}
    23192352
    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);
     2353static void crVrScrCompositorEntryDataCleanup(PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry)
     2354{
    23262355    pEntry->cRects = 0;
    23272356    pEntry->paSrcRects = NULL;
    23282357    pEntry->paDstRects = NULL;
    23292358    pEntry->paDstUnstretchedRects = NULL;
     2359}
     2360
     2361static 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
     2370VBOXVREGDECL(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);
    23302377
    23312378    crVrScrCompositorRectsInvalidate(pCompositor);
    23322379    return VINF_SUCCESS;
     2380}
     2381
     2382VBOXVREGDECL(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;
    23332394}
    23342395
Note: See TracChangeset for help on using the changeset viewer.

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