VirtualBox

Changeset 45251 in vbox for trunk/src/VBox/GuestHost


Ignore:
Timestamp:
Mar 29, 2013 5:23:18 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
84635
Message:

crOpenGL: visible regions fixes

Location:
trunk/src/VBox/GuestHost/OpenGL
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/OpenGL/include/cr_vreg.h

    r45132 r45251  
    316316}
    317317
    318 DECLINLINE(void) CrVrScrCompositorEntryTexUpdate(PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry, const VBOXVR_TEXTURE *pTex)
    319 {
    320     pEntry->Tex = *pTex;
    321     CrVrScrCompositorEntrySetChanged(pEntry, true);
    322 }
    323 
    324318DECLINLINE(const VBOXVR_TEXTURE *) CrVrScrCompositorEntryTexGet(const VBOXVR_SCR_COMPOSITOR_ENTRY *pEntry)
    325319{
     
    337331}
    338332
     333VBOXVREGDECL(int) CrVrScrCompositorEntryTexUpdate(PVBOXVR_SCR_COMPOSITOR pCompositor, PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry, const VBOXVR_TEXTURE *pTex);
    339334VBOXVREGDECL(void) CrVrScrCompositorVisit(PVBOXVR_SCR_COMPOSITOR pCompositor, PFNVBOXVRSCRCOMPOSITOR_VISITOR pfnVisitor, void *pvVisitor);
    340335VBOXVREGDECL(void) CrVrScrCompositorEntrySetAllChanged(PVBOXVR_SCR_COMPOSITOR pCompositor, bool fChanged);
  • trunk/src/VBox/GuestHost/OpenGL/util/vreg.cpp

    r45133 r45251  
    13391339        else
    13401340        {
    1341             crWarning("VBoxVrCompositorEntryRegionsIntersect failed, rc %d", tmpRc);
     1341            WARN(("VBoxVrCompositorEntryRegionsIntersect failed, rc %d", tmpRc));
    13421342            rc = tmpRc;
    13431343        }
     
    13681368        else
    13691369        {
    1370             crWarning("VBoxVrCompositorEntryRegionsIntersect failed, rc %d", tmpRc);
     1370            WARN(("VBoxVrCompositorEntryRegionsIntersect failed, rc %d", tmpRc));
    13711371            rc = tmpRc;
    13721372        }
     
    14931493        else
    14941494        {
    1495             crWarning("RTMemAlloc failed!");
     1495            WARN(("RTMemAlloc failed!"));
    14961496            RTMemFree(pCompositor->paSrcRects);
    14971497            pCompositor->paSrcRects = NULL;
     
    15001500    else
    15011501    {
    1502         crWarning("RTMemAlloc failed!");
     1502        WARN(("RTMemAlloc failed!"));
    15031503        pCompositor->paDstRects = NULL;
    15041504    }
     
    16321632    if (!RT_SUCCESS(rc))
    16331633    {
    1634         crWarning("VBoxVrCompositorEntryRegionsAdd failed, rc %d", rc);
     1634        WARN(("VBoxVrCompositorEntryRegionsAdd failed, rc %d", rc));
    16351635        return rc;
    16361636    }
     
    16581658    if (!RT_SUCCESS(rc))
    16591659    {
    1660         crWarning("VBoxVrCompositorEntryRegionsSet failed, rc %d", rc);
     1660        WARN(("VBoxVrCompositorEntryRegionsSet failed, rc %d", rc));
    16611661        return rc;
    16621662    }
     
    16901690        if (!RT_SUCCESS(rc))
    16911691        {
    1692             crWarning("VBoxVrCompositorEntryRegionsTranslate failed rc %d", rc);
     1692            WARN(("VBoxVrCompositorEntryRegionsTranslate failed rc %d", rc));
    16931693            return rc;
    16941694        }
     
    17061706    }
    17071707    return VINF_SUCCESS;
     1708}
     1709
     1710static int crVrScrCompositorEntryEnsureRegionsInTex(PVBOXVR_SCR_COMPOSITOR pCompositor, PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry)
     1711{
     1712    RTRECT Rect;
     1713    Rect.xLeft = pEntry->Pos.x;
     1714    Rect.yTop = pEntry->Pos.y;
     1715    Rect.xRight = pEntry->Pos.x + pEntry->Tex.width;
     1716    Rect.yBottom = pEntry->Pos.y + pEntry->Tex.height;
     1717    int rc = CrVrScrCompositorEntryRegionsIntersect(pCompositor, pEntry, 1, &Rect, NULL);
     1718    if (!RT_SUCCESS(rc))
     1719        WARN(("CrVrScrCompositorEntryRegionsIntersect failed, rc %d", rc));
     1720    return rc;
    17081721}
    17091722
     
    17181731        if (!RT_SUCCESS(rc))
    17191732        {
    1720             crWarning("RegionsAdd: crVrScrCompositorEntryPositionSet failed rc %d", rc);
     1733            WARN(("RegionsAdd: crVrScrCompositorEntryPositionSet failed rc %d", rc));
    17211734            return rc;
    17221735        }
     
    17261739    if (!RT_SUCCESS(rc))
    17271740    {
    1728         crWarning("crVrScrCompositorEntryRegionsAdd failed, rc %d", rc);
     1741        WARN(("crVrScrCompositorEntryRegionsAdd failed, rc %d", rc));
    17291742        return rc;
     1743    }
     1744
     1745    if ((fPosChanged || (fChangeFlags & VBOXVR_COMPOSITOR_CF_ENTRY_REGIONS_CHANGED)) && pEntry)
     1746    {
     1747        rc = crVrScrCompositorEntryEnsureRegionsInTex(pCompositor, pEntry);
     1748        if (!RT_SUCCESS(rc))
     1749        {
     1750            WARN(("crVrScrCompositorEntryEnsureRegionsInTex failed, rc %d", rc));
     1751            return rc;
     1752        }
    17301753    }
    17311754
     
    17411764    }
    17421765
     1766    return VINF_SUCCESS;
     1767}
     1768
     1769VBOXVREGDECL(int) CrVrScrCompositorEntryTexUpdate(PVBOXVR_SCR_COMPOSITOR pCompositor, PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry, const VBOXVR_TEXTURE *pTex)
     1770{
     1771    bool fCompositorChanged = CrVrScrCompositorEntryIsUsed(pEntry) && (pEntry->Tex.width != pTex->width || pEntry->Tex.height != pTex->height);
     1772    pEntry->Tex = *pTex;
     1773    CrVrScrCompositorEntrySetChanged(pEntry, true);
     1774    if (fCompositorChanged)
     1775    {
     1776        int rc = crVrScrCompositorEntryEnsureRegionsInTex(pCompositor, pEntry);
     1777        if (!RT_SUCCESS(rc))
     1778        {
     1779            WARN(("crVrScrCompositorEntryEnsureRegionsInTex failed rc %d", rc));
     1780            return rc;
     1781        }
     1782    }
    17431783    return VINF_SUCCESS;
    17441784}
     
    17521792    if (!RT_SUCCESS(rc))
    17531793    {
    1754         crWarning("RegionsSet: CrVrScrCompositorEntryRemove failed rc %d", rc);
     1794        WARN(("RegionsSet: CrVrScrCompositorEntryRemove failed rc %d", rc));
    17551795        return rc;
    17561796    }
     
    17611801        if (!RT_SUCCESS(rc))
    17621802        {
    1763             crWarning("RegionsSet: crVrScrCompositorEntryPositionSet failed rc %d", rc);
     1803            WARN(("RegionsSet: crVrScrCompositorEntryPositionSet failed rc %d", rc));
    17641804            return rc;
    17651805        }
     
    17691809    if (!RT_SUCCESS(rc))
    17701810    {
    1771         crWarning("crVrScrCompositorEntryRegionsSet failed, rc %d", rc);
     1811        WARN(("crVrScrCompositorEntryRegionsSet failed, rc %d", rc));
    17721812        return rc;
     1813    }
     1814
     1815    if (fChanged && CrVrScrCompositorEntryIsUsed(pEntry))
     1816    {
     1817        rc = crVrScrCompositorEntryEnsureRegionsInTex(pCompositor, pEntry);
     1818        if (!RT_SUCCESS(rc))
     1819        {
     1820            WARN(("crVrScrCompositorEntryEnsureRegionsInTex failed, rc %d", rc));
     1821            return rc;
     1822        }
    17731823    }
    17741824
     
    17851835    if (!RT_SUCCESS(rc))
    17861836    {
    1787         crWarning("RegionsIntersect: VBoxVrCompositorEntryRegionsIntersect failed rc %d", rc);
     1837        WARN(("RegionsIntersect: VBoxVrCompositorEntryRegionsIntersect failed rc %d", rc));
    17881838        return rc;
    17891839    }
     
    18071857    if (!RT_SUCCESS(rc))
    18081858    {
    1809         crWarning("RegionsIntersect: VBoxVrCompositorEntryRegionsIntersect failed rc %d", rc);
     1859        WARN(("RegionsIntersect: VBoxVrCompositorEntryRegionsIntersect failed rc %d", rc));
    18101860        return rc;
    18111861    }
     
    18411891        else
    18421892        {
    1843             crWarning("CrVrScrCompositorEntryRegionsIntersect failed, rc %d", tmpRc);
     1893            WARN(("CrVrScrCompositorEntryRegionsIntersect failed, rc %d", tmpRc));
    18441894            rc = tmpRc;
    18451895        }
     
    18701920        else
    18711921        {
    1872             crWarning("CrVrScrCompositorEntryRegionsIntersect failed, rc %d", tmpRc);
     1922            WARN(("CrVrScrCompositorEntryRegionsIntersect failed, rc %d", tmpRc));
    18731923            rc = tmpRc;
    18741924        }
     
    18861936    if (!RT_SUCCESS(rc))
    18871937    {
    1888         crWarning("RegionsSet: crVrScrCompositorEntryPositionSet failed rc %d", rc);
     1938        WARN(("RegionsSet: crVrScrCompositorEntryPositionSet failed rc %d", rc));
    18891939        return rc;
    18901940    }
     
    18981948    if (!RT_SUCCESS(rc))
    18991949    {
    1900         crWarning("crVrScrCompositorRectsCheckInit failed, rc %d", rc);
     1950        WARN(("crVrScrCompositorRectsCheckInit failed, rc %d", rc));
    19011951        return rc;
    19021952    }
     
    19401990    else
    19411991    {
    1942         crWarning("RTCritSectInit failed rc %d", rc);
     1992        WARN(("RTCritSectInit failed rc %d", rc));
    19431993    }
    19441994    return rc;
     
    19832033    if (!RT_SUCCESS(rc))
    19842034    {
    1985         crWarning("crVrScrCompositorRectsCheckInit failed, rc %d", rc);
     2035        WARN(("crVrScrCompositorRectsCheckInit failed, rc %d", rc));
    19862036        return rc;
    19872037    }
Note: See TracChangeset for help on using the changeset viewer.

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