VirtualBox

Ignore:
Timestamp:
Aug 20, 2014 11:58:38 AM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
95613
Message:

crOpenGL: 1. osx: do everything we can do in the main thread 2. bugfixes

Location:
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c

    r52260 r52429  
    282282
    283283    VBoxVrTerm();
     284
     285    RTSemEventDestroy(cr_server.hCalloutCompletionEvent);
    284286}
    285287
     
    513515
    514516    cr_server.pCleanupClient = NULL;
     517
     518    rc = RTSemEventCreate(&cr_server.hCalloutCompletionEvent);
     519    if (!RT_SUCCESS(rc))
     520    {
     521        WARN(("RTSemEventCreate failed %d", rc));
     522        return GL_FALSE;
     523    }
    515524
    516525    /*
     
    42324241            g_pLed = pSetup->pLed;
    42334242
     4243            cr_server.ClientInfo = pSetup->CrClientInfo;
     4244
    42344245            pSetup->CrCmdServerInfo.hSvr = NULL;
    42354246            pSetup->CrCmdServerInfo.pfnEnable = crVBoxCrCmdEnable;
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_presenter.cpp

    r52384 r52429  
    4646#include "render/renderspu.h"
    4747
     48//#define CR_SERVER_WITH_CLIENT_CALLOUTS
     49
    4850class ICrFbDisplay
    4951{
     
    7274class CrFbDisplayWindowRootVr;
    7375class CrFbDisplayVrdp;
     76class CrFbWindow;
    7477
    7578typedef struct CR_FRAMEBUFFER
     
    126129    CrFbDisplayWindowRootVr *pDpWinRootVr;
    127130    CrFbDisplayVrdp *pDpVrdp;
     131    CrFbWindow *pWindow;
     132    uint32_t u32DisplayMode;
    128133    uint32_t u32Id;
    129134    int32_t iFb;
     
    152157} CR_PRESENTER_GLOBALS;
    153158
     159static int crPMgrFbConnectTargetDisplays(HCR_FRAMEBUFFER hFb, CR_FBDISPLAY_INFO *pDpInfo, uint32_t u32ModeAdd);
     160
    154161static CR_PRESENTER_GLOBALS g_CrPresenter;
    155162
     
    26562663    virtual int UpdateBegin(struct CR_FRAMEBUFFER *pFb)
    26572664    {
    2658         int rc = mpWindow->UpdateBegin();
     2665        int rc = mpWindow ? mpWindow->UpdateBegin() : VINF_SUCCESS;
    26592666        if (RT_SUCCESS(rc))
    26602667        {
     
    26632670                return VINF_SUCCESS;
    26642671            else
     2672            {
    26652673                WARN(("err"));
     2674                if (mpWindow)
     2675                    mpWindow->UpdateEnd();
     2676            }
    26662677        }
    26672678        else
     
    26752686        CrFbDisplayBase::UpdateEnd(pFb);
    26762687
    2677         mpWindow->UpdateEnd();
     2688        if (mpWindow)
     2689            mpWindow->UpdateEnd();
    26782690    }
    26792691
     
    26872699        }
    26882700
    2689         if (mpWindow->GetParentId())
     2701        if (mpWindow && mpWindow->GetParentId())
    26902702        {
    26912703            rc = mpWindow->Create();
     
    27092721        }
    27102722
    2711         if (mpWindow->GetParentId())
     2723        if (mpWindow && mpWindow->GetParentId())
    27122724        {
    27132725            rc = mpWindow->Create();
     
    27312743        }
    27322744
    2733         if (mpWindow->GetParentId())
     2745        if (mpWindow && mpWindow->GetParentId())
    27342746        {
    27352747            rc = mpWindow->Create();
     
    27532765        }
    27542766
    2755         if (mpWindow->GetParentId())
     2767        if (mpWindow && mpWindow->GetParentId())
    27562768        {
    27572769            rc = mpWindow->Create();
     
    27932805// always call SetPosition to ensure window is adjustep properly
    27942806//        if (pViewportRect->xLeft != mViewportRect.xLeft || pViewportRect->yTop != mViewportRect.yTop)
     2807        if (mpWindow)
    27952808        {
    27962809            const RTRECT* pRect = getRect();
     
    28082821    }
    28092822
    2810     virtual CrFbWindow * windowDetach()
     2823    virtual CrFbWindow * windowDetach(bool fCleanup = true)
    28112824    {
    28122825        if (isUpdating())
     
    28192832        if (mpWindow)
    28202833        {
    2821             windowCleanup();
     2834            if (fCleanup)
     2835                windowCleanup();
    28222836            mpWindow = NULL;
    28232837        }
     
    28482862        mDefaultParentId = parentId;
    28492863
    2850         if (!isActive())
     2864        if (!isActive() && mpWindow)
    28512865        {
    28522866            int rc = mpWindow->Reparent(parentId);
     
    28722886        int rc = VINF_SUCCESS;
    28732887
    2874         if (isActive())
     2888        if (isActive() && mpWindow)
    28752889        {
    28762890            rc = mpWindow->Reparent(parentId);
     
    28982912        if (!hFb || !CrFbIsEnabled(hFb))
    28992913        {
    2900             Assert(!mpWindow->IsVisivle());
     2914            Assert(!mpWindow || !mpWindow->IsVisivle());
    29012915            return VINF_SUCCESS;
    29022916        }
    29032917
    2904         int rc = mpWindow->UpdateBegin();
    2905         if (RT_SUCCESS(rc))
    2906         {
    2907             rc = mpWindow->SetVisible(!g_CrPresenter.fWindowsForceHidden);
    2908             if (!RT_SUCCESS(rc))
    2909                 WARN(("SetVisible failed, rc %d", rc));
    2910 
    2911             mpWindow->UpdateEnd();
    2912         }
    2913         else
    2914             WARN(("UpdateBegin failed, rc %d", rc));
     2918        int rc = VINF_SUCCESS;
     2919
     2920        if (mpWindow)
     2921        {
     2922            rc = mpWindow->UpdateBegin();
     2923            if (RT_SUCCESS(rc))
     2924            {
     2925                rc = mpWindow->SetVisible(!g_CrPresenter.fWindowsForceHidden);
     2926                if (!RT_SUCCESS(rc))
     2927                    WARN(("SetVisible failed, rc %d", rc));
     2928
     2929                mpWindow->UpdateEnd();
     2930            }
     2931            else
     2932                WARN(("UpdateBegin failed, rc %d", rc));
     2933        }
    29152934
    29162935        return rc;
    29172936    }
    29182937
     2938    CrFbWindow* getWindow() {return mpWindow;}
    29192939protected:
    29202940    virtual void onUpdateEnd()
     
    29322952    virtual void ueRegions()
    29332953    {
    2934         mpWindow->SetVisibleRegionsChanged();
     2954        if (mpWindow)
     2955            mpWindow->SetVisibleRegionsChanged();
    29352956    }
    29362957
     
    29552976    virtual int windowSetCompositor(bool fSet)
    29562977    {
     2978        if (!mpWindow)
     2979            return VINF_SUCCESS;
     2980
    29572981        if (fSet)
    29582982        {
     
    29652989    virtual int windowCleanup()
    29662990    {
     2991        if (!mpWindow)
     2992            return VINF_SUCCESS;
     2993
    29672994        int rc = mpWindow->UpdateBegin();
    29682995        if (!RT_SUCCESS(rc))
     
    30133040    {
    30143041        int rc = VINF_SUCCESS;
     3042
     3043        if (!mpWindow)
     3044            return VINF_SUCCESS;
    30153045
    30163046//        HCR_FRAMEBUFFER hFb = getFramebuffer();
     
    30613091            }
    30623092
     3093#if 0
    30633094            rc = mpWindow->Reparent(mDefaultParentId);
    30643095            if (!RT_SUCCESS(rc))
     
    30673098                return rc;
    30683099            }
     3100#endif
    30693101        }
    30703102
     
    30743106    virtual int windowSync()
    30753107    {
     3108        if (!mpWindow)
     3109            return VINF_SUCCESS;
     3110
    30763111        int rc = mpWindow->UpdateBegin();
    30773112        if (!RT_SUCCESS(rc))
     
    31243159        if (CrFbHas3DData(hFb))
    31253160        {
    3126             if (mpWindow->GetParentId())
     3161            if (mpWindow && mpWindow->GetParentId())
    31273162            {
    31283163                rc = mpWindow->Create();
     
    31443179    }
    31453180
    3146     CrFbWindow* getWindow() {return mpWindow;}
    31473181private:
    31483182    CrFbWindow *mpWindow;
     
    41664200}
    41674201
     4202static int crPMgrCheckInitWindowDisplays(uint32_t idScreen)
     4203{
     4204#ifdef CR_SERVER_WITH_CLIENT_CALLOUTS
     4205    CR_FBDISPLAY_INFO *pDpInfo = &g_CrPresenter.aDisplayInfos[idScreen];
     4206    if (pDpInfo->iFb >= 0)
     4207    {
     4208        uint32_t u32ModeAdd = g_CrPresenter.u32DisplayMode & (CR_PMGR_MODE_WINDOW | CR_PMGR_MODE_ROOTVR);
     4209        int rc = crPMgrFbConnectTargetDisplays(&g_CrPresenter.aFramebuffers[pDpInfo->iFb], pDpInfo, u32ModeAdd);
     4210        if (RT_FAILURE(rc))
     4211        {
     4212            WARN(("crPMgrFbConnectTargetDisplays failed %d", rc));
     4213            return rc;
     4214        }
     4215    }
     4216#endif
     4217    return VINF_SUCCESS;
     4218}
     4219
    41684220int CrPMgrScreenChanged(uint32_t idScreen)
    41694221{
     
    41764228    int rc = VINF_SUCCESS;
    41774229    CR_FBDISPLAY_INFO *pDpInfo;
     4230#if 0
    41784231    bool fDefaultParentChange = (idScreen == 0);
    41794232    if (fDefaultParentChange)
     
    42174270        }
    42184271    }
     4272#endif
    42194273
    42204274    pDpInfo = &g_CrPresenter.aDisplayInfos[idScreen];
     4275
     4276    HCR_FRAMEBUFFER hFb = pDpInfo->iFb >= 0 ? CrPMgrFbGet(pDpInfo->iFb) : NULL;
     4277    if (hFb && CrFbIsUpdating(hFb))
     4278    {
     4279        WARN(("trying to update viewport while framebuffer is being updated"));
     4280        rc = VERR_INVALID_STATE;
     4281        goto end;
     4282    }
     4283
    42214284    if (pDpInfo->pDpWin)
    42224285    {
    4223         HCR_FRAMEBUFFER hFb = pDpInfo->iFb >= 0 ? CrPMgrFbGet(pDpInfo->iFb) : NULL;
    4224         if (hFb && CrFbIsUpdating(hFb))
    4225         {
    4226             WARN(("trying to update viewport while framebuffer is being updated"));
    4227             rc = VERR_INVALID_STATE;
    4228             goto end;
    4229         }
     4286        CRASSERT(pDpInfo->pDpWin->getWindow());
    42304287
    42314288        rc = pDpInfo->pDpWin->UpdateBegin(hFb);
     
    42394296            WARN(("UpdateBegin failed %d", rc));
    42404297    }
    4241 
     4298    else
     4299    {
     4300        if (pDpInfo->pWindow)
     4301        {
     4302            rc = pDpInfo->pWindow->UpdateBegin();
     4303            if (RT_FAILURE(rc))
     4304            {
     4305                WARN(("UpdateBegin failed %d", rc));
     4306                goto end;
     4307            }
     4308
     4309            rc = pDpInfo->pWindow->SetVisible(false);
     4310            if (RT_FAILURE(rc))
     4311            {
     4312                WARN(("SetVisible failed %d", rc));
     4313                pDpInfo->pWindow->UpdateEnd();
     4314                goto end;
     4315            }
     4316
     4317            rc = pDpInfo->pWindow->Reparent(cr_server.screen[idScreen].winID);
     4318            if (RT_FAILURE(rc))
     4319            {
     4320                WARN(("Reparent failed %d", rc));
     4321                pDpInfo->pWindow->UpdateEnd();
     4322                goto end;
     4323            }
     4324
     4325            pDpInfo->pWindow->UpdateEnd();
     4326        }
     4327
     4328        rc = crPMgrCheckInitWindowDisplays(idScreen);
     4329        if (RT_FAILURE(rc))
     4330        {
     4331            WARN(("crPMgrFbConnectTargetDisplays failed %d", rc));
     4332            goto end;
     4333        }
     4334    }
    42424335end:
    4243 
     4336#if 0
    42444337    if (fDefaultParentChange)
    42454338    {
     
    42544347        }
    42554348    }
    4256 
     4349#endif
    42574350    return rc;
    42584351}
     
    42764369        }
    42774370
    4278         int rc = pDpInfo->pDpWin->UpdateBegin(hFb);
    4279         if (RT_SUCCESS(rc))
    4280         {
    4281             pDpInfo->pDpWin->setViewportRect(&cr_server.screenVieport[idScreen].Rect);
    4282             pDpInfo->pDpWin->UpdateEnd(hFb);
    4283         }
    4284         else
    4285             WARN(("UpdateBegin failed %d", rc));
     4371        if (pDpInfo->pDpWin)
     4372        {
     4373            CRASSERT(pDpInfo->pDpWin->getWindow());
     4374            int rc = pDpInfo->pDpWin->UpdateBegin(hFb);
     4375            if (RT_SUCCESS(rc))
     4376            {
     4377                pDpInfo->pDpWin->setViewportRect(&cr_server.screenVieport[idScreen].Rect);
     4378                pDpInfo->pDpWin->UpdateEnd(hFb);
     4379            }
     4380            else
     4381                WARN(("UpdateBegin failed %d", rc));
     4382        }
    42864383    }
    42874384
     
    43994496    if (pDpInfo->pDpWinRootVr)
    44004497    {
     4498#ifdef CR_SERVER_WITH_CLIENT_CALLOUTS
     4499        CrFbWindow *pWindow = pDpInfo->pDpWinRootVr->windowDetach(false);
     4500        Assert(pWindow == pDpInfo->pWindow);
     4501#endif
    44014502        rc = crPMgrFbDisconnectDisplay(hFb, pDpInfo->pDpWinRootVr);
    44024503        if (RT_FAILURE(rc))
     
    44064507        }
    44074508    }
    4408 
    4409     if (pDpInfo->pDpWin)
    4410     {
     4509    else if (pDpInfo->pDpWin)
     4510    {
     4511#ifdef CR_SERVER_WITH_CLIENT_CALLOUTS
     4512        CrFbWindow *pWindow = pDpInfo->pDpWin->windowDetach(false);
     4513        Assert(pWindow == pDpInfo->pWindow);
     4514#endif
    44114515        rc = crPMgrFbDisconnectDisplay(hFb, pDpInfo->pDpWin);
    44124516        if (RT_FAILURE(rc))
     
    44274531    if (!pDpInfo->pDpWinRootVr)
    44284532    {
    4429         CrFbWindow *pWin = NULL;
    44304533        if (pDpInfo->pDpWin)
    44314534        {
    4432             pWin = pDpInfo->pDpWin->windowDetach();
     4535            CrFbWindow *pWin = pDpInfo->pDpWin->windowDetach();
    44334536            CRASSERT(pWin);
     4537            Assert(pWin == pDpInfo->pWindow);
    44344538            delete pDpInfo->pDpWin;
    44354539            pDpInfo->pDpWin = NULL;
    44364540        }
    4437         else
    4438             pWin = new CrFbWindow(0);
    4439 
    4440         pDpInfo->pDpWinRootVr = new CrFbDisplayWindowRootVr(&cr_server.screenVieport[pDpInfo->u32Id].Rect, cr_server.screen[pDpInfo->u32Id].winID, cr_server.screen[0].winID);
     4541        else if (!pDpInfo->pWindow)
     4542        {
     4543            pDpInfo->pWindow = new CrFbWindow(0);
     4544        }
     4545
     4546        pDpInfo->pDpWinRootVr = new CrFbDisplayWindowRootVr(&cr_server.screenVieport[pDpInfo->u32Id].Rect, cr_server.screen[pDpInfo->u32Id].winID, /*cr_server.screen[0].winID*/ 0);
    44414547        pDpInfo->pDpWin = pDpInfo->pDpWinRootVr;
    4442         pDpInfo->pDpWinRootVr->windowAttach(pWin);
     4548        pDpInfo->pDpWinRootVr->windowAttach(pDpInfo->pWindow);
    44434549    }
    44444550}
     
    44464552static void crPMgrDpWinCreate(CR_FBDISPLAY_INFO *pDpInfo)
    44474553{
    4448     CrFbWindow *pWin = NULL;
    44494554    if (pDpInfo->pDpWinRootVr)
    44504555    {
    44514556        CRASSERT(pDpInfo->pDpWinRootVr == pDpInfo->pDpWin);
    4452         pWin = pDpInfo->pDpWin->windowDetach();
     4557        CrFbWindow *pWin = pDpInfo->pDpWin->windowDetach();
    44534558        CRASSERT(pWin);
     4559        Assert(pWin == pDpInfo->pWindow);
    44544560        delete pDpInfo->pDpWinRootVr;
    44554561        pDpInfo->pDpWinRootVr = NULL;
     
    44594565    if (!pDpInfo->pDpWin)
    44604566    {
    4461         if (!pWin)
    4462             pWin = new CrFbWindow(0);
    4463 
    4464         pDpInfo->pDpWin = new CrFbDisplayWindow(&cr_server.screenVieport[pDpInfo->u32Id].Rect, cr_server.screen[pDpInfo->u32Id].winID, cr_server.screen[0].winID);
    4465         pDpInfo->pDpWin->windowAttach(pWin);
     4567        if (!pDpInfo->pWindow)
     4568            pDpInfo->pWindow = new CrFbWindow(0);
     4569
     4570        pDpInfo->pDpWin = new CrFbDisplayWindow(&cr_server.screenVieport[pDpInfo->u32Id].Rect, cr_server.screen[pDpInfo->u32Id].winID, /*cr_server.screen[0].winID*/ 0);
     4571        pDpInfo->pDpWin->windowAttach(pDpInfo->pWindow);
    44664572    }
    44674573}
     
    44724578    if (u32ModeRemove & CR_PMGR_MODE_ROOTVR)
    44734579    {
    4474         CRASSERT(pDpInfo->pDpWinRootVr);
    4475         CRASSERT(pDpInfo->pDpWin == pDpInfo->pDpWinRootVr);
    4476         rc = crPMgrFbDisconnectDisplay(hFb, pDpInfo->pDpWinRootVr);
    4477         if (RT_FAILURE(rc))
    4478         {
    4479             WARN(("crPMgrFbDisconnectDisplay pDpWinRootVr failed %d", rc));
    4480             return rc;
     4580        if (pDpInfo->pDpWinRootVr)
     4581        {
     4582#ifdef CR_SERVER_WITH_CLIENT_CALLOUTS
     4583            CrFbWindow *pWindow = pDpInfo->pDpWinRootVr->windowDetach(false);
     4584            Assert(pWindow == pDpInfo->pWindow);
     4585#endif
     4586            CRASSERT(pDpInfo->pDpWin == pDpInfo->pDpWinRootVr);
     4587            rc = crPMgrFbDisconnectDisplay(hFb, pDpInfo->pDpWinRootVr);
     4588            if (RT_FAILURE(rc))
     4589            {
     4590                WARN(("crPMgrFbDisconnectDisplay pDpWinRootVr failed %d", rc));
     4591                return rc;
     4592            }
    44814593        }
    44824594    }
     
    44844596    {
    44854597        CRASSERT(!pDpInfo->pDpWinRootVr);
    4486         CRASSERT(pDpInfo->pDpWin);
    4487         rc = crPMgrFbDisconnectDisplay(hFb, pDpInfo->pDpWin);
    4488         if (RT_FAILURE(rc))
    4489         {
    4490             WARN(("crPMgrFbDisconnectDisplay pDpWin failed %d", rc));
    4491             return rc;
     4598        if (pDpInfo->pDpWin)
     4599        {
     4600#ifdef CR_SERVER_WITH_CLIENT_CALLOUTS
     4601            CrFbWindow *pWindow = pDpInfo->pDpWin->windowDetach(false);
     4602            Assert(pWindow == pDpInfo->pWindow);
     4603#endif
     4604            rc = crPMgrFbDisconnectDisplay(hFb, pDpInfo->pDpWin);
     4605            if (RT_FAILURE(rc))
     4606            {
     4607                WARN(("crPMgrFbDisconnectDisplay pDpWin failed %d", rc));
     4608                return rc;
     4609            }
    44924610        }
    44934611    }
     
    44954613    if (u32ModeRemove & CR_PMGR_MODE_VRDP)
    44964614    {
    4497         CRASSERT(pDpInfo->pDpVrdp);
    4498         rc = crPMgrFbDisconnectDisplay(hFb, pDpInfo->pDpVrdp);
    4499         if (RT_FAILURE(rc))
    4500         {
    4501             WARN(("crPMgrFbDisconnectDisplay pDpVrdp failed %d", rc));
    4502             return rc;
    4503         }
    4504     }
     4615        if (pDpInfo->pDpVrdp)
     4616        {
     4617            rc = crPMgrFbDisconnectDisplay(hFb, pDpInfo->pDpVrdp);
     4618            if (RT_FAILURE(rc))
     4619            {
     4620                WARN(("crPMgrFbDisconnectDisplay pDpVrdp failed %d", rc));
     4621                return rc;
     4622            }
     4623        }
     4624    }
     4625
     4626    pDpInfo->u32DisplayMode &= ~u32ModeRemove;
    45054627
    45064628    return VINF_SUCCESS;
     
    45464668        }
    45474669    }
     4670
     4671    pDpInfo->u32DisplayMode |= u32ModeAdd;
    45484672
    45494673    return VINF_SUCCESS;
     
    45794703    }
    45804704
    4581     rc = crPMgrFbConnectTargetDisplays(hFb, pDpInfo, g_CrPresenter.u32DisplayMode);
     4705    rc = crPMgrFbConnectTargetDisplays(hFb, pDpInfo, g_CrPresenter.u32DisplayMode
     4706#ifdef CR_SERVER_WITH_CLIENT_CALLOUTS
     4707            & ~(CR_PMGR_MODE_WINDOW | CR_PMGR_MODE_ROOTVR)
     4708#endif
     4709            );
    45824710    if (RT_FAILURE(rc))
    45834711    {
     
    46784806            if (!pDpInfo->pDpWinRootVr->getFramebuffer())
    46794807            {
     4808                pDpInfo->pDpWinRootVr->windowDetach(false);
    46804809                delete pDpInfo->pDpWinRootVr;
    46814810                pDpInfo->pDpWinRootVr = NULL;
    46824811                pDpInfo->pDpWin = NULL;
     4812                if (pDpInfo->pWindow)
     4813                {
     4814                    delete pDpInfo->pWindow;
     4815                    pDpInfo->pWindow = NULL;
     4816                }
    46834817            }
    46844818            else
     
    46894823            if (!pDpInfo->pDpWin->getFramebuffer())
    46904824            {
     4825                pDpInfo->pDpWin->windowDetach(false);
    46914826                delete pDpInfo->pDpWin;
    46924827                pDpInfo->pDpWin = NULL;
     4828                if (pDpInfo->pWindow)
     4829                {
     4830                    delete pDpInfo->pWindow;
     4831                    pDpInfo->pWindow = NULL;
     4832                }
    46934833            }
    46944834            else
     
    49815121    if (fFbInfoChanged)
    49825122    {
     5123#ifdef CR_SERVER_WITH_CLIENT_CALLOUTS
     5124        rc = crPMgrModeModify(hFb, 0, CR_PMGR_MODE_WINDOW | CR_PMGR_MODE_ROOTVR);
     5125        if (!RT_SUCCESS(rc))
     5126        {
     5127            WARN(("crPMgrModeModifyTarget failed %d", rc));
     5128            return rc;
     5129        }
     5130#endif
    49835131        rc = CrFbUpdateBegin(hFb);
    49845132        if (!RT_SUCCESS(rc))
     
    62066354    return 0;
    62076355}
     6356
     6357typedef struct CRSERVER_CLIENT_CALLOUT
     6358{
     6359    VBOXCRCMDCTL_CALLOUT_LISTENTRY Entry;
     6360    PFNVCRSERVER_CLIENT_CALLOUT_CB pfnCb;
     6361    void*pvCb;
     6362} CRSERVER_CLIENT_CALLOUT;
     6363
     6364static DECLCALLBACK(void) crServerClientCalloutCb(struct VBOXCRCMDCTL_CALLOUT_LISTENTRY *pEntry)
     6365{
     6366    CRSERVER_CLIENT_CALLOUT *pCallout = RT_FROM_MEMBER(pEntry, CRSERVER_CLIENT_CALLOUT, Entry);
     6367    pCallout->pfnCb(pCallout->pvCb);
     6368    int rc = RTSemEventSignal(cr_server.hCalloutCompletionEvent);
     6369    if (RT_FAILURE(rc))
     6370        WARN(("RTSemEventSignal failed rc %d", rc));
     6371}
     6372
     6373static DECLCALLBACK(void) crServerClientCallout(PFNVCRSERVER_CLIENT_CALLOUT_CB pfnCb, void*pvCb)
     6374{
     6375    Assert(cr_server.pCurrentCalloutCtl);
     6376    CRSERVER_CLIENT_CALLOUT Callout;
     6377    Callout.pfnCb = pfnCb;
     6378    Callout.pvCb = pvCb;
     6379    cr_server.ClientInfo.pfnCallout(cr_server.ClientInfo.hClient, cr_server.pCurrentCalloutCtl, &Callout.Entry, crServerClientCalloutCb);
     6380
     6381    int rc = RTSemEventWait(cr_server.hCalloutCompletionEvent, RT_INDEFINITE_WAIT);
     6382    if (RT_FAILURE(rc))
     6383        WARN(("RTSemEventWait failed %d", rc));
     6384}
     6385
     6386
     6387DECLEXPORT(void) crVBoxServerCalloutEnable(VBOXCRCMDCTL *pCtl)
     6388{
     6389#ifdef CR_SERVER_WITH_CLIENT_CALLOUTS
     6390    Assert(!cr_server.pCurrentCalloutCtl);
     6391    cr_server.pCurrentCalloutCtl = pCtl;
     6392
     6393    cr_server.head_spu->dispatch_table.ChromiumParametervCR(GL_HH_SET_CLIENT_CALLOUT, 0, 0, (void*)crServerClientCallout);
     6394#endif
     6395}
     6396
     6397extern DECLEXPORT(void) crVBoxServerCalloutDisable()
     6398{
     6399#ifdef CR_SERVER_WITH_CLIENT_CALLOUTS
     6400    Assert(cr_server.pCurrentCalloutCtl);
     6401
     6402    cr_server.head_spu->dispatch_table.ChromiumParametervCR(GL_HH_SET_CLIENT_CALLOUT, 0, 0, NULL);
     6403
     6404    cr_server.pCurrentCalloutCtl = NULL;
     6405#endif
     6406}
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_window.c

    r51064 r52429  
    3636    if (fGuestWindow)
    3737    {
    38         CRMuralInfo *dummy = crServerGetDummyMural(visBits);
     38        CRMuralInfo *dummy = crServerGetDummyMural(realVisBits);
    3939        if (!dummy)
    4040        {
     
    4444        spuWindow = dummy->spuWindow;
    4545        mural->fIsDummyRefference = GL_TRUE;
     46
     47        dims[0] = dummy->width;
     48        dims[1] = dummy->height;
    4649    }
    4750    else
     
    5659        }
    5760        mural->fIsDummyRefference = GL_FALSE;
    58     }
    59 
    60     /* get initial window size */
    61     cr_server.head_spu->dispatch_table.GetChromiumParametervCR(GL_WINDOW_SIZE_CR, spuWindow, GL_INT, 2, dims);
     61
     62        /* get initial window size */
     63        cr_server.head_spu->dispatch_table.GetChromiumParametervCR(GL_WINDOW_SIZE_CR, spuWindow, GL_INT, 2, dims);
     64    }
    6265
    6366    defaultMural = (CRMuralInfo *) crHashtableSearch(cr_server.muralTable, 0);
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