VirtualBox

Changeset 47623 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Aug 8, 2013 9:19:43 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
87824
Message:

crOpenGL: output redirect fixes

Location:
trunk/src/VBox
Files:
8 edited

Legend:

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

    r47577 r47623  
    209209    VBOXVR_SCR_COMPOSITOR_ENTRY CEntry;
    210210    VBOXVR_SCR_COMPOSITOR_ENTRY RootVrCEntry;
     211    void *pvORInstance;
     212    GLuint idPBO;
    211213} CR_DISPLAY_ENTRY, *PCR_DISPLAY_ENTRY;
    212214/**/
     
    238240    GLuint aidColorTexs[2];
    239241
    240     void *pvOutputRedirectInstance;
     242    void *pvReserved;
    241243
    242244    CRCreateInfo_t CreateInfo;
     
    250252    GLuint idDepthStencilRB;
    251253    GLuint fboWidth, fboHeight;
    252     GLuint idPBO;
    253254
    254255    GLuint cDisabled;
     
    260261    GLboolean fRootVrOn;
    261262    GLboolean fForcePresentState;
     263    GLboolean fOrPresentOnReenable;
    262264
    263265    GLboolean fUseDefaultDEntry;
     
    364366{
    365367    CRHashTable * pTexIdToDemInfoMap;
     368    uint32_t cEntered;
     369    RTLISTNODE ReleasedList;
    366370} CR_DISPLAY_ENTRY_MAP, *PCR_DISPLAY_ENTRY_MAP;
    367371
     
    378382
    379383void CrHlpFreeTexImage(CRContext *pCurCtx, GLuint idPBO, void *pvData);
    380 void* CrHlpGetTexImage(CRContext *pCurCtx, PVBOXVR_TEXTURE pTexture, GLuint idPBO, GLenum enmFormat);
    381 void CrHlpPutTexImage(CRContext *pCurCtx, PVBOXVR_TEXTURE pTexture, GLenum enmFormat, void *pvData);
     384void* CrHlpGetTexImage(CRContext *pCurCtx, const VBOXVR_TEXTURE *pTexture, GLuint idPBO, GLenum enmFormat);
     385void CrHlpPutTexImage(CRContext *pCurCtx, const VBOXVR_TEXTURE *pTexture, GLenum enmFormat, void *pvData);
    382386
    383387/* */
  • trunk/src/VBox/GuestHost/OpenGL/include/cr_vreg.h

    r47566 r47623  
    384384    return VBoxVrCompositorEntryIsInList(&pEntry->Ce);
    385385}
    386 VBOXVREGDECL(int) CrVrScrCompositorEntryRegionsAdd(PVBOXVR_SCR_COMPOSITOR pCompositor, PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry, const RTPOINT *pPos, uint32_t cRegions, const RTRECT *paRegions, bool fPosRelated, uint32_t *pfChangeFlags);
     386VBOXVREGDECL(int) CrVrScrCompositorEntryRegionsAdd(PVBOXVR_SCR_COMPOSITOR pCompositor, PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry, const RTPOINT *pPos, uint32_t cRegions, const RTRECT *paRegions, bool fPosRelated, VBOXVR_SCR_COMPOSITOR_ENTRY **ppReplacedScrEntry, uint32_t *pfChangeFlags);
    387387VBOXVREGDECL(int) CrVrScrCompositorEntryRegionsSet(PVBOXVR_SCR_COMPOSITOR pCompositor, PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry, const RTPOINT *pPos, uint32_t cRegions, const RTRECT *paRegions, bool fPosRelated, bool *pfChanged);
    388388VBOXVREGDECL(int) CrVrScrCompositorEntryListIntersect(PVBOXVR_SCR_COMPOSITOR pCompositor, PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry, const VBOXVR_LIST *pList2, bool *pfChanged);
  • trunk/src/VBox/GuestHost/OpenGL/util/vreg.cpp

    r47566 r47623  
    18621862
    18631863
    1864 static int crVrScrCompositorEntryRegionsAdd(PVBOXVR_SCR_COMPOSITOR pCompositor, PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry, uint32_t cRegions, const RTRECT *paRegions, uint32_t *pfChangedFlags)
     1864static int crVrScrCompositorEntryRegionsAdd(PVBOXVR_SCR_COMPOSITOR pCompositor, PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry, uint32_t cRegions, const RTRECT *paRegions, VBOXVR_SCR_COMPOSITOR_ENTRY **ppReplacedScrEntry, uint32_t *pfChangedFlags)
    18651865{
    18661866    uint32_t fChangedFlags = 0;
     
    19001900    if (pfChangedFlags)
    19011901        *pfChangedFlags = fChangedFlags;
     1902
     1903    if (ppReplacedScrEntry)
     1904        *ppReplacedScrEntry = pReplacedScrEntry;
     1905
    19021906    return VINF_SUCCESS;
    19031907}
     
    19871991}
    19881992
    1989 VBOXVREGDECL(int) CrVrScrCompositorEntryRegionsAdd(PVBOXVR_SCR_COMPOSITOR pCompositor, PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry, const RTPOINT *pPos, uint32_t cRegions, const RTRECT *paRegions, bool fPosRelated, uint32_t *pfChangeFlags)
     1993VBOXVREGDECL(int) CrVrScrCompositorEntryRegionsAdd(PVBOXVR_SCR_COMPOSITOR pCompositor, PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry, const RTPOINT *pPos, uint32_t cRegions, const RTRECT *paRegions, bool fPosRelated, VBOXVR_SCR_COMPOSITOR_ENTRY **ppReplacedScrEntry, uint32_t *pfChangeFlags)
    19901994{
    19911995    int rc;
     
    20282032    }
    20292033
    2030     rc = crVrScrCompositorEntryRegionsAdd(pCompositor, pEntry, cRegions, paRegions, &fChangeFlags);
     2034    rc = crVrScrCompositorEntryRegionsAdd(pCompositor, pEntry, cRegions, paRegions, ppReplacedScrEntry, &fChangeFlags);
    20312035    if (!RT_SUCCESS(rc))
    20322036    {
     
    20542058    if (fChangeFlags & VBOXVR_COMPOSITOR_CF_ENTRY_REPLACED)
    20552059        fPosChanged = false;
     2060    else if (ppReplacedScrEntry)
     2061        *ppReplacedScrEntry = NULL;
    20562062
    20572063    if (pfChangeFlags)
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server.h

    r47602 r47623  
    129129CRMuralInfo * crServerGetDummyMural(GLint visualBits);
    130130
    131 void crServerSetupOutputRedirect(CRMuralInfo *mural);
     131void crServerPresentOutputRedirect(CRMuralInfo *pMural);
     132void crServerOutputRedirectCheckEnableDisable(CRMuralInfo *pMural);
     133
    132134void crServerCheckMuralGeometry(CRMuralInfo *mural);
    133135GLboolean crServerSupportRedirMuralFBO(void);
     
    422424void CrDpEntryCleanup(PCR_DISPLAY pDisplay, PCR_DISPLAY_ENTRY pEntry);
    423425int CrDpEntryRegionsSet(PCR_DISPLAY pDisplay, PCR_DISPLAY_ENTRY pEntry, const RTPOINT *pPos, uint32_t cRegions, const RTRECT *paRegions);
    424 int CrDpEntryRegionsAdd(PCR_DISPLAY pDisplay, PCR_DISPLAY_ENTRY pEntry, const RTPOINT *pPos, uint32_t cRegions, const RTRECT *paRegions);
     426int CrDpEntryRegionsAdd(PCR_DISPLAY pDisplay, PCR_DISPLAY_ENTRY pEntry, const RTPOINT *pPos, uint32_t cRegions, const RTRECT *paRegions, CR_DISPLAY_ENTRY_MAP *pMap);
    425427void CrDpEntryRegionsClear(PCR_DISPLAY pDisplay);
    426428DECLINLINE(bool) CrDpEntryIsUsed(PCR_DISPLAY_ENTRY pEntry)
     
    436438int CrDemGlobalInit();
    437439void CrDemTeGlobalTerm();
     440void CrDemEnter(PCR_DISPLAY_ENTRY_MAP pMap);
     441void CrDemLeave(PCR_DISPLAY_ENTRY_MAP pMap, PCR_DISPLAY_ENTRY pNewEntry, PCR_DISPLAY_ENTRY pReplacedEntry);
    438442int CrDemInit(PCR_DISPLAY_ENTRY_MAP pMap);
    439443void CrDemTerm(PCR_DISPLAY_ENTRY_MAP pMap);
     
    445449int crServerDisplaySaveState(PSSMHANDLE pSSM);
    446450int crServerDisplayLoadState(PSSMHANDLE pSSM, uint32_t u32Version);
     451
     452
     453void crServerDEntryResized(CRMuralInfo *pMural, CR_DISPLAY_ENTRY *pDEntry);
     454void crServerDEntryMoved(CRMuralInfo *pMural, CR_DISPLAY_ENTRY *pDEntry);
     455void crServerDEntryVibleRegions(CRMuralInfo *pMural, CR_DISPLAY_ENTRY *pDEntry);
     456void crServerDEntryCheckFBO(CRMuralInfo *pMural, CR_DISPLAY_ENTRY *pDEntry, CRContext *ctx);
     457void crServerDEntryCleanup(CR_DISPLAY_ENTRY *pDEntry);
     458
     459void crServerDEntryAllResized(CRMuralInfo *pMural);
     460void crServerDEntryAllMoved(CRMuralInfo *pMural);
     461void crServerDEntryAllVibleRegions(CRMuralInfo *pMural);
    447462
    448463//#define VBOX_WITH_CRSERVER_DUMPER
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c

    r47605 r47623  
    29572957    CRMuralInfo *mural = (CRMuralInfo*) data1;
    29582958
    2959     crServerSetupOutputRedirect(mural);
     2959    if (!mural->CreateInfo.externalID)
     2960        return;
     2961
     2962    if (cr_server.bUseOutputRedirect)
     2963        crServerPresentOutputRedirect(mural);
     2964    else
     2965        crServerOutputRedirectCheckEnableDisable(mural);
    29602966}
    29612967
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_muralfbo.c

    r47599 r47623  
    4747}
    4848
     49void crServerDEntryResized(CRMuralInfo *pMural, CR_DISPLAY_ENTRY *pDEntry)
     50{
     51    /*PBO*/
     52    if (pDEntry->idPBO)
     53    {
     54        CRASSERT(cr_server.bUsePBOForReadback);
     55        cr_server.head_spu->dispatch_table.DeleteBuffersARB(1, &pDEntry->idPBO);
     56        pDEntry->idPBO = 0;
     57    }
     58
     59    if (pDEntry->pvORInstance)
     60    {
     61        cr_server.outputRedirect.CRORGeometry(pDEntry->pvORInstance,
     62                                                pMural->hX + CrVrScrCompositorEntryPosGet(&pDEntry->CEntry)->x,
     63                                                pMural->hY + CrVrScrCompositorEntryPosGet(&pDEntry->CEntry)->y,
     64                                                CrVrScrCompositorEntryTexGet(&pDEntry->CEntry)->width,
     65                                                CrVrScrCompositorEntryTexGet(&pDEntry->CEntry)->height);
     66
     67        crServerDEntryVibleRegions(pMural, pDEntry);
     68    }
     69}
     70
     71void crServerDEntryMoved(CRMuralInfo *pMural, CR_DISPLAY_ENTRY *pDEntry)
     72{
     73    if (pDEntry->pvORInstance)
     74    {
     75        cr_server.outputRedirect.CRORGeometry(pDEntry->pvORInstance,
     76                                                pMural->hX + CrVrScrCompositorEntryPosGet(&pDEntry->CEntry)->x,
     77                                                pMural->hY + CrVrScrCompositorEntryPosGet(&pDEntry->CEntry)->y,
     78                                                CrVrScrCompositorEntryTexGet(&pDEntry->CEntry)->width,
     79                                                CrVrScrCompositorEntryTexGet(&pDEntry->CEntry)->height);
     80
     81        crServerDEntryVibleRegions(pMural, pDEntry);
     82    }
     83
     84}
     85
     86void crServerDEntryCleanup(CR_DISPLAY_ENTRY *pDEntry)
     87{
     88    if (pDEntry->pvORInstance)
     89    {
     90        cr_server.outputRedirect.CROREnd(pDEntry->pvORInstance);
     91        pDEntry->pvORInstance = NULL;
     92    }
     93}
     94
     95void crServerDEntryVibleRegions(CRMuralInfo *pMural, CR_DISPLAY_ENTRY *pDEntry)
     96{
     97    if (pDEntry->pvORInstance)
     98    {
     99        uint32_t cRects;
     100        const RTRECT *pRects;
     101
     102        int rc = CrVrScrCompositorEntryRegionsGet(&pMural->Compositor, &pDEntry->CEntry, &cRects, NULL, &pRects, NULL);
     103        if (!RT_SUCCESS(rc))
     104        {
     105            crWarning("CrVrScrCompositorEntryRegionsGet failed, rc %d", rc);
     106            return;
     107        }
     108
     109        cr_server.outputRedirect.CRORVisibleRegion(pDEntry->pvORInstance, cRects, pRects);
     110    }
     111}
     112
     113/***/
     114void crServerDEntryAllResized(CRMuralInfo *pMural)
     115{
     116    VBOXVR_SCR_COMPOSITOR_ITERATOR Iter;
     117    PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry;
     118
     119    CrVrScrCompositorIterInit(&pMural->Compositor, &Iter);
     120    while ((pEntry = CrVrScrCompositorIterNext(&Iter)) != NULL)
     121    {
     122        CR_DISPLAY_ENTRY *pDEntry = CR_DENTRY_FROM_CENTRY(pEntry);
     123        crServerDEntryResized(pMural, pDEntry);
     124    }
     125}
     126
     127void crServerDEntryAllMoved(CRMuralInfo *pMural)
     128{
     129    VBOXVR_SCR_COMPOSITOR_ITERATOR Iter;
     130    PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry;
     131
     132    CrVrScrCompositorIterInit(&pMural->Compositor, &Iter);
     133
     134    while ((pEntry = CrVrScrCompositorIterNext(&Iter)) != NULL)
     135    {
     136        CR_DISPLAY_ENTRY *pDEntry = CR_DENTRY_FROM_CENTRY(pEntry);
     137        crServerDEntryMoved(pMural, pDEntry);
     138    }
     139}
     140
     141void crServerDEntryAllVibleRegions(CRMuralInfo *pMural)
     142{
     143    VBOXVR_SCR_COMPOSITOR_ITERATOR Iter;
     144    PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry;
     145
     146    CrVrScrCompositorIterInit(&pMural->Compositor, &Iter);
     147
     148    while ((pEntry = CrVrScrCompositorIterNext(&Iter)) != NULL)
     149    {
     150        CR_DISPLAY_ENTRY *pDEntry = CR_DENTRY_FROM_CENTRY(pEntry);
     151        crServerDEntryVibleRegions(pMural, pDEntry);
     152    }
     153}
     154/**/
     155
     156void crServerDEntryCheckFBO(CRMuralInfo *pMural, CR_DISPLAY_ENTRY *pDEntry, CRContext *ctx)
     157{
     158    if (!cr_server.bUsePBOForReadback == !pDEntry->idPBO)
     159        return;
     160
     161    if (cr_server.bUsePBOForReadback)
     162    {
     163        Assert(!pDEntry->idPBO);
     164        cr_server.head_spu->dispatch_table.GenBuffersARB(1, &pDEntry->idPBO);
     165        cr_server.head_spu->dispatch_table.BindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, pDEntry->idPBO);
     166        cr_server.head_spu->dispatch_table.BufferDataARB(GL_PIXEL_PACK_BUFFER_ARB,
     167                CrVrScrCompositorEntryTexGet(&pDEntry->CEntry)->width*CrVrScrCompositorEntryTexGet(&pDEntry->CEntry)->height*4,
     168                0, GL_STREAM_READ_ARB);
     169        cr_server.head_spu->dispatch_table.BindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, ctx->bufferobject.packBuffer->hwid);
     170
     171        if (!pDEntry->idPBO)
     172        {
     173            crWarning("PBO create failed");
     174        }
     175    }
     176}
     177
    49178/* Called when a new CRMuralInfo is created
    50179 * or when OutputRedirect status is changed.
    51180 */
    52 void crServerSetupOutputRedirect(CRMuralInfo *mural)
     181void crServerSetupOutputRedirectEntry(CRMuralInfo *mural, CR_DISPLAY_ENTRY *pDEntry)
    53182{
    54183    /* Unset the previous redirect. */
    55     if (mural->pvOutputRedirectInstance)
    56     {
    57         cr_server.outputRedirect.CROREnd(mural->pvOutputRedirectInstance);
    58         mural->pvOutputRedirectInstance = NULL;
     184    if (pDEntry->pvORInstance)
     185    {
     186        cr_server.outputRedirect.CROREnd(pDEntry->pvORInstance);
     187        pDEntry->pvORInstance = NULL;
    59188    }
    60189
     
    76205                {
    77206                    cr_server.outputRedirect.CRORBegin(cr_server.outputRedirect.pvContext,
    78                                                        &mural->pvOutputRedirectInstance,
     207                                                       &pDEntry->pvORInstance,
    79208                                                       "H3DOR_FMT_RGBA_TOPDOWN"); // @todo from a header
    80209                }
     
    85214
    86215        /* If this is not NULL then there was a supported format. */
    87         if (mural->pvOutputRedirectInstance)
     216        if (pDEntry->pvORInstance)
    88217        {
    89218            uint32_t cRects;
    90219            const RTRECT *pRects;
    91220
    92             int rc = CrVrScrCompositorRegionsGet(&mural->Compositor, &cRects, NULL, &pRects, NULL);
     221            int rc = CrVrScrCompositorEntryRegionsGet(&mural->Compositor, &pDEntry->CEntry, &cRects, NULL, &pRects, NULL);
    93222            if (!RT_SUCCESS(rc))
    94223            {
     
    97226            }
    98227
    99             cr_server.outputRedirect.CRORGeometry(mural->pvOutputRedirectInstance,
    100                                                   mural->hX, mural->hY,
    101                                                   mural->width, mural->height);
    102             // @todo the code assumes that RTRECT == four of GLInts
    103             cr_server.outputRedirect.CRORVisibleRegion(mural->pvOutputRedirectInstance,
    104                                                        mural->cVisibleRects, (RTRECT *)mural->pVisibleRects);
    105 
    106             crServerPresentFBO(mural);
     228            cr_server.outputRedirect.CRORGeometry(pDEntry->pvORInstance,
     229                                                  mural->hX + CrVrScrCompositorEntryPosGet(&pDEntry->CEntry)->x,
     230                                                  mural->hY + CrVrScrCompositorEntryPosGet(&pDEntry->CEntry)->y,
     231                                                  CrVrScrCompositorEntryTexGet(&pDEntry->CEntry)->width,
     232                                                  CrVrScrCompositorEntryTexGet(&pDEntry->CEntry)->height);
     233
     234            cr_server.outputRedirect.CRORVisibleRegion(pDEntry->pvORInstance, cRects, pRects);
     235//!!
     236//            crServerPresentFBO(mural);
    107237        }
    108238    }
     
    264394    }
    265395
    266     if (mural->pvOutputRedirectInstance)
    267     {
    268         cr_server.outputRedirect.CRORGeometry(mural->pvOutputRedirectInstance,
    269                                               mural->hX, mural->hY,
    270                                               mural->width, mural->height);
    271     }
    272 
    273396    crServerVBoxCompositionDisableLeave(mural, GL_FALSE);
    274397}
     
    290413}
    291414
    292 static void crServerPresentMuralVRAM(CRMuralInfo *mural, char *pixels);
     415static void crServerDentryPresentVRAM(CRMuralInfo *mural, CR_DISPLAY_ENTRY *pDEntry, char *pixels);
    293416
    294417#define CR_SERVER_MURAL_FROM_RPW_ENTRY(_pEntry) ((CRMuralInfo*)(((uint8_t*)(_pEntry)) - RT_OFFSETOF(CRMuralInfo, RpwEntry)))
     
    299422
    300423    Assert(&pMural->RpwEntry == pEntry);
    301 
    302     crServerPresentMuralVRAM(pMural, pvEntryTexData);
     424    crError("port me!");
     425    //    crServerPresentMuralVRAM(pMural, pvEntryTexData);
    303426}
    304427
     
    420543        }
    421544
    422         if (mural->aidFBOs[0]==0)
     545        if (mural->fUseDefaultDEntry && mural->aidFBOs[0]==0)
    423546        {
    424547            crServerCreateMuralFBO(mural);
     
    543666    }
    544667
     668    mural->iCurDrawBuffer = crServerMuralFBOIdxFromBufferName(mural, ctx->buffer.drawBuffer);
     669    mural->iCurReadBuffer = crServerMuralFBOIdxFromBufferName(mural, ctx->buffer.readBuffer);
     670
    545671    mural->fboWidth = mural->width;
    546672    mural->fboHeight = mural->height;
     
    548674    mural->iCurDrawBuffer = crServerMuralFBOIdxFromBufferName(mural, ctx->buffer.drawBuffer);
    549675    mural->iCurReadBuffer = crServerMuralFBOIdxFromBufferName(mural, ctx->buffer.readBuffer);
    550 
    551     /*PBO*/
    552     if (cr_server.bUsePBOForReadback)
    553     {
    554         gl->GenBuffersARB(1, &mural->idPBO);
    555         gl->BindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, mural->idPBO);
    556         gl->BufferDataARB(GL_PIXEL_PACK_BUFFER_ARB, mural->width*mural->height*4, 0, GL_STREAM_READ_ARB);
    557         gl->BindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, ctx->bufferobject.packBuffer->hwid);
    558 
    559         if (!mural->idPBO)
    560         {
    561             crWarning("PBO create failed");
    562         }
    563     }
    564676
    565677    /*Restore gl state*/
     
    619731            mural->aidFBOs[i] = 0;
    620732        }
    621     }
    622 
    623     if (mural->idPBO!=0)
    624     {
    625         CRASSERT(cr_server.bUsePBOForReadback);
    626         cr_server.head_spu->dispatch_table.DeleteBuffersARB(1, &mural->idPBO);
    627         mural->idPBO = 0;
    628733    }
    629734
     
    649754}
    650755
    651 static GLboolean crServerIntersectScreen(CRMuralInfo *mural, int sId, CRrecti *rect)
    652 {
    653     rect->x1 = MAX(mural->gX, cr_server.screen[sId].x);
    654     rect->x2 = MIN(mural->gX+(int)mural->fboWidth, cr_server.screen[sId].x+(int)cr_server.screen[sId].w);
    655     rect->y1 = MAX(mural->gY, cr_server.screen[sId].y);
    656     rect->y2 = MIN(mural->gY+(int)mural->fboHeight, cr_server.screen[sId].y+(int)cr_server.screen[sId].h);
     756static GLboolean crServerIntersectScreen(CRMuralInfo *mural, CR_DISPLAY_ENTRY *pDEntry, int sId, CRrecti *rect)
     757{
     758    rect->x1 = MAX(mural->gX + CrVrScrCompositorEntryPosGet(&pDEntry->CEntry)->x, cr_server.screen[sId].x);
     759    rect->x2 = MIN(mural->gX + CrVrScrCompositorEntryPosGet(&pDEntry->CEntry)->x
     760            + (int)CrVrScrCompositorEntryTexGet(&pDEntry->CEntry)->width,
     761            cr_server.screen[sId].x+(int)cr_server.screen[sId].w);
     762    rect->y1 = MAX(mural->gY + CrVrScrCompositorEntryPosGet(&pDEntry->CEntry)->y, cr_server.screen[sId].y);
     763    rect->y2 = MIN(mural->gY + CrVrScrCompositorEntryPosGet(&pDEntry->CEntry)->y
     764            + (int)CrVrScrCompositorEntryTexGet(&pDEntry->CEntry)->height,
     765            cr_server.screen[sId].y+(int)cr_server.screen[sId].h);
    657766
    658767    return (rect->x2>rect->x1) && (rect->y2>rect->y1);
     
    727836}
    728837
    729 static void crServerVBoxCompositionReenable(CRMuralInfo *mural, GLboolean fForcePresent)
    730 {
    731     if (!(mural->fPresentMode & CR_SERVER_REDIR_F_DISPLAY)
    732             || (mural->fUseDefaultDEntry && !(mural->fPresentMode & CR_SERVER_REDIR_F_FBO))
     838static void crServerVBoxCompositionReenable(CRMuralInfo *mural)
     839{
     840    GLboolean fForcePresent = mural->fForcePresentState;
     841    GLboolean fOrPresentOnReenable = mural->fOrPresentOnReenable;
     842
     843    mural->fForcePresentState = GL_FALSE;
     844    mural->fOrPresentOnReenable = GL_FALSE;
     845
     846    if ((mural->fUseDefaultDEntry && !(mural->fPresentMode & CR_SERVER_REDIR_F_FBO))
    733847            || !mural->fDataPresented
    734848            || (!fForcePresent
     
    736850        return;
    737851
    738     crServerVBoxCompositionPresentPerform(mural);
     852    if (mural->fPresentMode & CR_SERVER_REDIR_F_DISPLAY)
     853        crServerVBoxCompositionPresentPerform(mural);
     854
     855    if (fOrPresentOnReenable
     856            && cr_server.bUseOutputRedirect
     857            && crServerVBoxCompositionPresentNeeded(mural))
     858        crServerPresentOutputRedirect(mural);
    739859}
    740860
     
    767887    if (!mural->cDisabled)
    768888    {
    769         crServerVBoxCompositionReenable(mural, mural->fForcePresentState);
    770         mural->fForcePresentState = GL_FALSE;
     889        crServerVBoxCompositionReenable(mural);
    771890    }
    772891
     
    807926}
    808927
    809 static void crServerPresentMuralVRAM(CRMuralInfo *mural, char *pixels)
     928static void crServerDentryPresentVRAM(CRMuralInfo *mural, CR_DISPLAY_ENTRY *pDEntry, char *pixels)
    810929{
    811930    char *tmppixels;
    812931    CRrecti rect, rectwr, sectr;
    813     int i, j;
     932    int i, rc;
     933    uint32_t j;
    814934
    815935    if (mural->fPresentMode & CR_SERVER_REDIR_F_FBO_RAM_VMFB)
     
    817937        for (i=0; i<cr_server.screenCount; ++i)
    818938        {
    819             if (crServerIntersectScreen(mural, i, &rect))
    820             {
     939            if (crServerIntersectScreen(mural, pDEntry, i, &rect))
     940            {
     941                uint32_t cRects;
     942                const RTRECT *pRects;
     943
    821944                /* rect in window relative coords */
    822945                crServerTransformRect(&rectwr, &rect, -mural->gX, -mural->gY);
    823946
    824                 if (!mural->pVisibleRects)
     947                rc = CrVrScrCompositorEntryRegionsGet(&mural->Compositor, &pDEntry->CEntry, &cRects, NULL, &pRects, NULL);
     948                if (RT_SUCCESS(rc))
    825949                {
    826950                    /*we don't get any rects info for guest compiz windows, so we treat windows as visible unless explicitly received 0 visible rects*/
    827                     if (!mural->bReceivedRects)
     951                    for (j=0; j<cRects; ++j)
    828952                    {
    829                         tmppixels = crAlloc(4*(rect.x2-rect.x1)*(rect.y2-rect.y1));
    830                         if (!tmppixels)
    831                         {
    832                             crWarning("Out of memory in crServerPresentFBO");
    833                             crFree(pixels);
    834                             return;
    835                         }
    836 
    837                         crServerCopySubImage(tmppixels, pixels, &rectwr, mural->fboWidth, mural->fboHeight);
    838                         /*Note: pfnPresentFBO would free tmppixels*/
    839                         cr_server.pfnPresentFBO(tmppixels, i, rect.x1-cr_server.screen[i].x, rect.y1-cr_server.screen[i].y, rect.x2-rect.x1, rect.y2-rect.y1);
    840                     }
    841                 }
    842                 else
    843                 {
    844                     for (j=0; j<mural->cVisibleRects; ++j)
    845                     {
    846                         if (crServerIntersectRect(&rectwr, (CRrecti*) &mural->pVisibleRects[4*j], &sectr))
     953                        if (crServerIntersectRect(&rectwr, (CRrecti*)&pRects[j], &sectr))
    847954                        {
    848955                            tmppixels = crAlloc(4*(sectr.x2-sectr.x1)*(sectr.y2-sectr.y1));
     
    854961                            }
    855962
    856                             crServerCopySubImage(tmppixels, pixels, &sectr, mural->fboWidth, mural->fboHeight);
     963                            crServerCopySubImage(tmppixels, pixels, &sectr, CrVrScrCompositorEntryTexGet(&pDEntry->CEntry)->width, CrVrScrCompositorEntryTexGet(&pDEntry->CEntry)->height);
    857964                            /*Note: pfnPresentFBO would free tmppixels*/
    858965                            cr_server.pfnPresentFBO(tmppixels, i,
    859                                                     sectr.x1+mural->gX-cr_server.screen[i].x,
    860                                                     sectr.y1+mural->gY-cr_server.screen[i].y,
     966                                                    sectr.x1+mural->gX+CrVrScrCompositorEntryPosGet(&pDEntry->CEntry)->x-cr_server.screen[i].x,
     967                                                    sectr.y1+mural->gY+CrVrScrCompositorEntryPosGet(&pDEntry->CEntry)->y-cr_server.screen[i].y,
    861968                                                    sectr.x2-sectr.x1, sectr.y2-sectr.y1);
    862969                        }
    863970                    }
    864971                }
    865             }
    866         }
    867     }
    868 
    869     if (mural->pvOutputRedirectInstance)
     972                else
     973                {
     974                    crWarning("CrVrScrCompositorEntryRegionsGet failed, rc %d", rc);
     975                }
     976            }
     977        }
     978    }
     979
     980    if (pDEntry->pvORInstance)
    870981    {
    871982        /* @todo find out why presentfbo is not called but crorframe is called. */
    872         cr_server.outputRedirect.CRORFrame(mural->pvOutputRedirectInstance,
     983        cr_server.outputRedirect.CRORFrame(pDEntry->pvORInstance,
    873984                                           pixels,
    874                                            4 * mural->fboWidth * mural->fboHeight);
    875     }
    876 }
    877 
    878 void crServerPresentFBO(CRMuralInfo *mural)
     985                                           4 * CrVrScrCompositorEntryTexGet(&pDEntry->CEntry)->width * CrVrScrCompositorEntryTexGet(&pDEntry->CEntry)->height);
     986    }
     987}
     988
     989void crServerPresentOutputRedirectEntry(CRMuralInfo *pMural, CR_DISPLAY_ENTRY *pDEntry)
    879990{
    880991    char *pixels=NULL;
    881992    GLuint idPBO;
    882993    CRContext *ctx = crStateGetCurrent();
    883     VBOXVR_TEXTURE Tex;
    884 
    885     CRASSERT(mural->fPresentMode & CR_SERVER_REDIR_F_FBO);
    886     CRASSERT(cr_server.pfnPresentFBO || (mural->fPresentMode & CR_SERVER_REDIR_F_DISPLAY));
    887 
    888     if (!crServerVBoxCompositionPresentNeeded(mural))
    889         return;
    890 
    891     if (mural->fPresentMode & CR_SERVER_REDIR_F_DISPLAY)
    892     {
    893         crServerVBoxCompositionPresentPerform(mural);
    894     }
    895 
    896     mural->fDataPresented = GL_TRUE;
    897 
    898     if (!(mural->fPresentMode & CR_SERVER_REDIR_FGROUP_REQUIRE_FBO_RAM))
    899         return;
    900 
    901     Tex.width = mural->width;
    902     Tex.height = mural->height;
    903     Tex.target = GL_TEXTURE_2D;
    904     Tex.hwid = mural->aidColorTexs[CR_SERVER_FBO_FB_IDX(mural)];
    905     CRASSERT(Tex.hwid);
    906 
    907     if (mural->fPresentMode & CR_SERVER_REDIR_F_FBO_RPW)
    908     {
     994
     995    if (!pDEntry->pvORInstance)
     996    {
     997        crServerSetupOutputRedirectEntry(pMural, pDEntry);
     998        if (!pDEntry->pvORInstance)
     999        {
     1000            crWarning("crServerSetupOutputRedirectEntry failed!");
     1001            return;
     1002        }
     1003    }
     1004
     1005    crServerDEntryCheckFBO(pMural, pDEntry, ctx);
     1006
     1007    if (pMural->fPresentMode & CR_SERVER_REDIR_F_FBO_RPW)
     1008    {
     1009        crError("port me!");
     1010#if 0
    9091011        /* 1. blit to RPW entry draw texture */
    9101012        CRMuralInfo *pCurrentMural = cr_server.currentMural;
     
    9721074        }
    9731075#endif
     1076#endif
    9741077        return;
    9751078    }
    9761079
    977     if (cr_server.bUsePBOForReadback && !mural->idPBO)
     1080    if (cr_server.bUsePBOForReadback && !pDEntry->idPBO)
    9781081    {
    9791082        crWarning("Mural doesn't have PBO even though bUsePBOForReadback is set!");
    9801083    }
    9811084
    982     idPBO = cr_server.bUsePBOForReadback ? mural->idPBO : 0;
    983     if (idPBO)
    984     {
    985         CRASSERT(mural->fboWidth == mural->width);
    986         CRASSERT(mural->fboHeight == mural->height);
    987     }
    988 
    989     pixels = CrHlpGetTexImage(ctx, &Tex, idPBO, GL_BGRA);
     1085    idPBO = cr_server.bUsePBOForReadback ? pDEntry->idPBO : 0;
     1086
     1087    pixels = CrHlpGetTexImage(ctx, CrVrScrCompositorEntryTexGet(&pDEntry->CEntry), idPBO, GL_BGRA);
    9901088    if (!pixels)
    9911089    {
     
    9941092    }
    9951093
    996     crServerPresentMuralVRAM(mural, pixels);
     1094    crServerDentryPresentVRAM(pMural, pDEntry, pixels);
    9971095
    9981096    CrHlpFreeTexImage(ctx, idPBO, pixels);
     1097}
     1098
     1099void crServerPresentOutputRedirect(CRMuralInfo *pMural)
     1100{
     1101    VBOXVR_SCR_COMPOSITOR_ITERATOR Iter;
     1102    PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry;
     1103
     1104    CrVrScrCompositorIterInit(&pMural->Compositor, &Iter);
     1105
     1106    while ((pEntry = CrVrScrCompositorIterNext(&Iter)) != NULL)
     1107    {
     1108        CR_DISPLAY_ENTRY *pDEntry = CR_DENTRY_FROM_CENTRY(pEntry);
     1109        crServerPresentOutputRedirectEntry(pMural, pDEntry);
     1110    }
     1111}
     1112
     1113void crServerOutputRedirectCheckEnableDisable(CRMuralInfo *pMural)
     1114{
     1115    VBOXVR_SCR_COMPOSITOR_ITERATOR Iter;
     1116    PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry;
     1117
     1118    CrVrScrCompositorIterInit(&pMural->Compositor, &Iter);
     1119
     1120    while ((pEntry = CrVrScrCompositorIterNext(&Iter)) != NULL)
     1121    {
     1122        CR_DISPLAY_ENTRY *pDEntry = CR_DENTRY_FROM_CENTRY(pEntry);
     1123        crServerSetupOutputRedirectEntry(pMural, pDEntry);
     1124    }
     1125}
     1126
     1127void crServerPresentFBO(CRMuralInfo *mural)
     1128{
     1129    CRASSERT(mural->fPresentMode & CR_SERVER_REDIR_F_FBO);
     1130    CRASSERT(cr_server.pfnPresentFBO || (mural->fPresentMode & CR_SERVER_REDIR_F_DISPLAY));
     1131
     1132    if (!crServerVBoxCompositionPresentNeeded(mural))
     1133        return;
     1134
     1135    mural->fDataPresented = GL_TRUE;
     1136
     1137    if (mural->fPresentMode & CR_SERVER_REDIR_F_DISPLAY)
     1138        crServerVBoxCompositionPresentPerform(mural);
     1139
     1140    if (mural->fPresentMode & CR_SERVER_REDIR_FGROUP_REQUIRE_FBO_RAM)
     1141        crServerPresentOutputRedirect(mural);
    9991142}
    10001143
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_presenter.cpp

    r47602 r47623  
    3838/* DISPLAY */
    3939
    40 //static DECLCALLBACK(int) crDpCbRegionsChanged(struct CR_PRESENTER *pPresenter)
    41 //{
    42 //    uint32_t cRegions;
    43 //    const RTRECT *paRegions;
    44 //    int rc = CrPtGetRegions(pPresenter, &cRegions, &paRegions);
    45 //    if (!RT_SUCCESS(rc))
    46 //    {
    47 //        crWarning("CrPtGetRegions failed, rc %d", rc);
    48 //        return rc;
    49 //    }
    50 //
    51 //    PCR_DISPLAY pDisplay = CR_DISPLAY_FROM_PRESENTER(pPresenter);
    52 //
    53 //    cr_server.head_spu->dispatch_table.WindowVisibleRegion(pDisplay->Mural.spuWindow, cRegions, (GLint*)paRegions);
    54 //
    55 //    if (pDisplay->Mural.pvOutputRedirectInstance)
    56 //    {
    57 //        /* @todo the code assumes that RTRECT == four GLInts. */
    58 //        cr_server.outputRedirect.CRORVisibleRegion(pDisplay->Mural.pvOutputRedirectInstance,
    59 //                                                        cRegions, paRegions);
    60 //    }
    61 //
    62 //    return VINF_SUCCESS;
    63 //}
    64 
    6540int CrDpInit(PCR_DISPLAY pDisplay)
    6641{
     
    202177        }
    203178
    204         rc = CrDpEntryRegionsAdd(pDisplay, pDEntry, &Pos, (uint32_t)cRects, (const RTRECT*)pRects);
     179        rc = CrDpEntryRegionsAdd(pDisplay, pDEntry, &Pos, (uint32_t)cRects, (const RTRECT*)pRects, NULL);
    205180        AssertRCReturn(rc, rc);
    206181
     
    236211}
    237212
    238 int CrDpEntryRegionsAdd(PCR_DISPLAY pDisplay, PCR_DISPLAY_ENTRY pEntry, const RTPOINT *pPos, uint32_t cRegions, const RTRECT *paRegions)
     213int CrDpEntryRegionsAdd(PCR_DISPLAY pDisplay, PCR_DISPLAY_ENTRY pEntry, const RTPOINT *pPos, uint32_t cRegions, const RTRECT *paRegions, CR_DISPLAY_ENTRY_MAP *pMap)
    239214{
    240215    uint32_t fChangeFlags = 0;
    241     int rc = CrVrScrCompositorEntryRegionsAdd(&pDisplay->Mural.Compositor, pEntry ? &pEntry->CEntry : NULL, pPos, cRegions, paRegions, false, &fChangeFlags);
     216    VBOXVR_SCR_COMPOSITOR_ENTRY *pReplacedScrEntry = NULL;
     217
     218    if (pMap)
     219        CrDemEnter(pMap);
     220
     221    int rc = CrVrScrCompositorEntryRegionsAdd(&pDisplay->Mural.Compositor, pEntry ? &pEntry->CEntry : NULL, pPos, cRegions, paRegions, false, &pReplacedScrEntry, &fChangeFlags);
    242222    if (RT_SUCCESS(rc))
    243223    {
     
    251231            else
    252232                crWarning("CrVrScrCompositorRegionsGet failed, rc %d", rc);
     233
     234            Assert(!pReplacedScrEntry);
     235        }
     236        else if (fChangeFlags & VBOXVR_COMPOSITOR_CF_ENTRY_REPLACED)
     237        {
     238            Assert(pReplacedScrEntry);
     239        }
     240        else
     241        {
     242            Assert(!pReplacedScrEntry);
    253243        }
    254244    }
    255245    else
    256246        crWarning("CrVrScrCompositorEntryRegionsAdd failed, rc %d", rc);
     247
     248    if (pMap)
     249        CrDemLeave(pMap, CR_DENTRY_FROM_CENTRY(pEntry), CR_DENTRY_FROM_CENTRY(pReplacedScrEntry));
    257250
    258251    return rc;
     
    282275    CrVrScrCompositorEntryInit(&pEntry->RootVrCEntry, pTextureData, NULL);
    283276    CrVrScrCompositorEntryFlagsSet(&pEntry->RootVrCEntry, fFlags);
     277    pEntry->pvORInstance = NULL;
    284278}
    285279
     
    298292{
    299293    pDisplay->Mural.fDataPresented = GL_TRUE;
     294    pDisplay->Mural.fOrPresentOnReenable = GL_TRUE;
    300295    crServerVBoxCompositionDisableLeave(&pDisplay->Mural, pDisplay->fForcePresent);
    301296    pDisplay->fForcePresent = GL_FALSE;
     
    313308    CR_DEM_ENTRY_INFO *pInfo;
    314309    CR_DISPLAY_ENTRY_MAP *pMap;
     310    RTLISTNODE Node;
    315311} CR_DEM_ENTRY;
    316312
     
    370366static void crDemEntryFree(CR_DEM_ENTRY* pDemEntry)
    371367{
     368    crServerDEntryCleanup(&pDemEntry->Entry);
    372369    RTMemCacheFree(g_VBoxCrDemLookasideList, pDemEntry);
    373370}
     
    406403    }
    407404
    408     crDemEntryFree(pDemEntry);
    409 
    410405    crStateGlobalSharedRelease();
     406
     407    if (!pMap->cEntered)
     408        crDemEntryFree(pDemEntry);
     409    else
     410        RTListNodeInsertAfter(&pMap->ReleasedList, &pDemEntry->Node);
    411411}
    412412
     
    415415    pMap->pTexIdToDemInfoMap = crAllocHashtable();
    416416    if (pMap->pTexIdToDemInfoMap)
     417    {
     418        RTListInit(&pMap->ReleasedList);
    417419        return VINF_SUCCESS;
     420    }
    418421
    419422    crWarning("crAllocHashtable failed");
     
    423426void CrDemTerm(PCR_DISPLAY_ENTRY_MAP pMap)
    424427{
     428    CRASSERT(RTListIsEmpty(&pMap->ReleasedList));
     429    CRASSERT(!pMap->cEntered);
    425430    crFreeHashtable(pMap->pTexIdToDemInfoMap, NULL);
    426431    pMap->pTexIdToDemInfoMap = NULL;
     432}
     433
     434void CrDemEnter(PCR_DISPLAY_ENTRY_MAP pMap)
     435{
     436    ++pMap->cEntered;
     437    Assert(pMap->cEntered);
     438}
     439
     440void CrDemLeave(PCR_DISPLAY_ENTRY_MAP pMap, PCR_DISPLAY_ENTRY pNewEntry, PCR_DISPLAY_ENTRY pReplacedEntry)
     441{
     442    Assert(pMap->cEntered);
     443    --pMap->cEntered;
     444    Assert(!pReplacedEntry || pNewEntry);
     445    if (pNewEntry && pReplacedEntry)
     446    {
     447        CR_DEM_ENTRY *pNewDemEntry = PCR_DEM_ENTRY_FROM_ENTRY(pNewEntry);
     448        CR_DEM_ENTRY *pReplacedDemEntry = PCR_DEM_ENTRY_FROM_ENTRY(pReplacedEntry);
     449        Assert(!RTListIsEmpty(&pMap->ReleasedList));
     450        Assert(!RTListIsEmpty(&pReplacedDemEntry->Node));
     451        Assert(RTListIsEmpty(&pNewDemEntry->Node));
     452        Assert(!pNewDemEntry->Entry.pvORInstance);
     453        if (!pNewDemEntry->Entry.pvORInstance)
     454        {
     455            pNewDemEntry->Entry.pvORInstance = pReplacedDemEntry->Entry.pvORInstance;
     456            pReplacedDemEntry->Entry.pvORInstance = NULL;
     457        }
     458        RTListNodeRemove(&pReplacedDemEntry->Node);
     459        crDemEntryFree(pReplacedDemEntry);
     460    }
     461
     462    if (!pMap->cEntered)
     463    {
     464        CR_DEM_ENTRY *pCurEntry, *pNextEntry;
     465        RTListForEachSafe(&pMap->ReleasedList, pCurEntry, pNextEntry, CR_DEM_ENTRY, Node)
     466        {
     467            RTListNodeRemove(&pCurEntry->Node);
     468            crDemEntryFree(pCurEntry);
     469        }
     470    }
    427471}
    428472
     
    516560    pDemEntry->pInfo = pInfo;
    517561    pDemEntry->pMap = pMap;
     562    RTListInit(&pDemEntry->Node);
    518563
    519564    /* just use main context info's context to hold the texture reference */
     
    711756}
    712757
    713 void CrHlpPutTexImage(CRContext *pCurCtx, PVBOXVR_TEXTURE pTexture, GLenum enmFormat, void *pvData)
     758void CrHlpPutTexImage(CRContext *pCurCtx, const VBOXVR_TEXTURE *pTexture, GLenum enmFormat, void *pvData)
    714759{
    715760    CRASSERT(pTexture->hwid);
     
    743788}
    744789
    745 void* CrHlpGetTexImage(CRContext *pCurCtx, PVBOXVR_TEXTURE pTexture, GLuint idPBO, GLenum enmFormat)
     790void* CrHlpGetTexImage(CRContext *pCurCtx, const VBOXVR_TEXTURE *pTexture, GLuint idPBO, GLenum enmFormat)
    746791{
    747792    void *pvData = NULL;
     
    843888    {
    844889        RTPOINT Point = {xPos, yPos};
    845         int rc = CrDpEntryRegionsAdd(pDisplay, pEntry, &Point, (uint32_t)cRects, (const RTRECT*)pRects);
     890        int rc = CrDpEntryRegionsAdd(pDisplay, pEntry, &Point, (uint32_t)cRects, (const RTRECT*)pRects, &cr_server.PresentTexturepMap);
    846891        if (!RT_SUCCESS(rc))
    847892        {
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_window.c

    r47601 r47623  
    111111{
    112112    return crServerDispatchWindowCreateEx(dpyName, visBits, -1);
     113}
     114
     115static DECLCALLBACK(void) crServerMuralDefaultEntryReleasedCB(const struct VBOXVR_SCR_COMPOSITOR *pCompositor, struct VBOXVR_SCR_COMPOSITOR_ENTRY *pEntry, struct VBOXVR_SCR_COMPOSITOR_ENTRY *pReplacingEntry)
     116{
     117    CR_DISPLAY_ENTRY *pDEntry = CR_DENTRY_FROM_CENTRY(pEntry);
     118    crServerDEntryCleanup(pDEntry);
    113119}
    114120
     
    153159        Tex.target = GL_TEXTURE_2D;
    154160        Tex.hwid = 0;
    155         CrVrScrCompositorEntryInit(&mural->DefaultDEntry.CEntry, &Tex, NULL);
     161        CrVrScrCompositorEntryInit(&mural->DefaultDEntry.CEntry, &Tex, crServerMuralDefaultEntryReleasedCB);
    156162
    157163        if (cr_server.fRootVrOn)
     
    160166            mural->fRootVrOn = GL_TRUE;
    161167        }
     168
     169        mural->DefaultDEntry.pvORInstance = NULL;
    162170    }
    163171
     
    179187    mural->bReceivedRects = GL_FALSE;
    180188
    181     mural->pvOutputRedirectInstance = NULL;
    182 
    183189    /* generate ID for this new window/mural (special-case for file conns) */
    184190    if (cr_server.curClient && cr_server.curClient->conn->type == CR_FILE)
     
    207213        }
    208214    }
    209 
    210     crServerSetupOutputRedirect(mural);
    211215
    212216    if (mural->fRootVrOn)
     
    364368void crServerMuralTerm(CRMuralInfo *mural)
    365369{
    366     if (mural->pvOutputRedirectInstance)
    367     {
    368         cr_server.outputRedirect.CROREnd(mural->pvOutputRedirectInstance);
    369         mural->pvOutputRedirectInstance = NULL;
    370     }
    371 
    372370    crServerRedirMuralFBO(mural, CR_SERVER_REDIR_F_NONE);
    373371    crServerDeleteMuralFBO(mural);
     
    627625    crServerWindowVisibleRegion(mural);
    628626
    629     if (mural->pvOutputRedirectInstance)
    630     {
    631         uint32_t cRects;
    632         const RTRECT *pRects;
    633 
    634         /* always get non-stretched rects for output redirect */
    635 //        if (mural->fRootVrOn)
    636         {
    637             rc = CrVrScrCompositorRegionsGet(&mural->Compositor, &cRects, NULL, NULL, &pRects);
    638             if (!RT_SUCCESS(rc))
    639             {
    640                 crWarning("CrVrScrCompositorRegionsGet failed, rc %d", rc);
    641                 goto end;
    642             }
    643         }
    644         /* @todo the code assumes that RTRECT == four GLInts. */
    645         cr_server.outputRedirect.CRORVisibleRegion(mural->pvOutputRedirectInstance,
    646                 cRects, pRects);
    647     }
    648 
     627    crServerDEntryAllResized(mural);
    649628end:
    650629    /* 3. (so far not needed for resize, but in case it is in the future) re-set the compositor (see above comment) */
     
    731710            crServerCheckMuralGeometry(mural);
    732711
     712        crServerDEntryAllMoved(mural);
     713
    733714        /* 3. re-set the compositor (see above comment) */
    734715        crServerVBoxCompositionDisableLeave(mural, fForcePresent);
     
    817798        crServerWindowVisibleRegion(mural);
    818799
    819         if (mural->pvOutputRedirectInstance)
    820         {
    821             const RTRECT * pRealRects;
    822             uint32_t cRealRects;
    823 
    824             /* always get unstretched regions here */
    825             rc = CrVrScrCompositorRegionsGet(&mural->Compositor, &cRealRects, NULL, NULL, &pRealRects);
    826             if (!RT_SUCCESS(rc))
    827             {
    828                 crWarning("CrVrScrCompositorRegionsGet failed, rc %d", rc);
    829                 goto end;
    830             }
    831 
    832             /* @todo the code assumes that RTRECT == four GLInts. */
    833             cr_server.outputRedirect.CRORVisibleRegion(mural->pvOutputRedirectInstance, cRealRects, pRealRects);
    834         }
     800        crServerDEntryAllVibleRegions(mural);
    835801    }
    836802end:
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