third_party/virtualbox/src/VBox/Main/src-client/DisplayImpl.cpp
// public methods only for internal purposes
/////////////////////////////////////////////////////////////////////////////
public methods only for internal purposes
public methods only for internal purposes
int Display::i_notifyCroglResize(PCVBVAINFOVIEW pView, PCVBVAINFOSCREEN pScreen, void *pvVRAM)
{
    RT_NOREF(pView);
#if defined(VBOX_WITH_HGCM) && defined(VBOX_WITH_CROGL)
    if (maFramebuffers[pScreen->u32ViewIndex].fRenderThreadMode)
        return VINF_SUCCESS; 
    if (mfIsCr3DEnabled)
    {
        int rc = VERR_INVALID_STATE;
        if (mhCrOglSvc)
        {
            VMMDev *pVMMDev = mParent->i_getVMMDev();
            if (pVMMDev)
            {
                VBOXCRCMDCTL_HGCM *pCtl;
                pCtl = (VBOXCRCMDCTL_HGCM*)RTMemAlloc(sizeof(CRVBOXHGCMDEVRESIZE) + sizeof(VBOXCRCMDCTL_HGCM));
                if (pCtl)
                {
                    CRVBOXHGCMDEVRESIZE *pData = (CRVBOXHGCMDEVRESIZE*)(pCtl+1);
                    pData->Screen = *pScreen;
                    pData->pvVRAM = pvVRAM;
                    pCtl->Hdr.enmType = VBOXCRCMDCTL_TYPE_HGCM;
                    pCtl->Hdr.u32Function = SHCRGL_HOST_FN_DEV_RESIZE;
                    pCtl->aParms[0].type = VBOX_HGCM_SVC_PARM_PTR;
                    pCtl->aParms[0].u.pointer.addr = pData;
                    pCtl->aParms[0].u.pointer.size = sizeof(*pData);
                    rc = i_crCtlSubmit(&pCtl->Hdr, sizeof(*pCtl), i_displayCrCmdFree, pCtl);
                    if (RT_FAILURE(rc))
                    {
                        AssertMsgFailed(("crCtlSubmit failed (rc=%Rrc)\n", rc));
                        RTMemFree(pCtl);
                    }
                }
                else
                    rc = VERR_NO_MEMORY;
            }
        }
        return rc;
    }
#else 
    RT_NOREF(pScreen, pvVRAM);
#endif
    return VINF_SUCCESS;
}
int Display :: i_notifyCroglResize ( PCVBVAINFOVIEW pView , PCVBVAINFOSCREEN pScreen , void * pvVRAM ) { RT_NOREF ( pView ) ; #if defined ( VBOX_WITH_HGCM ) && defined ( VBOX_WITH_CROGL ) if ( maFramebuffers [ pScreen -> u32ViewIndex ] . fRenderThreadMode ) return VINF_SUCCESS ; if ( mfIsCr3DEnabled ) { int rc = VERR_INVALID_STATE ; if ( mhCrOglSvc ) { VMMDev * pVMMDev = mParent -> i_getVMMDev ( ) ; if ( pVMMDev ) { VBOXCRCMDCTL_HGCM * pCtl ; pCtl = ( VBOXCRCMDCTL_HGCM * ) RTMemAlloc ( sizeof ( CRVBOXHGCMDEVRESIZE ) + sizeof ( VBOXCRCMDCTL_HGCM ) ) ; if ( pCtl ) { CRVBOXHGCMDEVRESIZE * pData = ( CRVBOXHGCMDEVRESIZE * ) ( pCtl + 1 ) ; pData -> Screen = * pScreen ; pData -> pvVRAM = pvVRAM ; pCtl -> Hdr . enmType = VBOXCRCMDCTL_TYPE_HGCM ; pCtl -> Hdr . u32Function = SHCRGL_HOST_FN_DEV_RESIZE ; pCtl -> aParms [ 0 ] . type = VBOX_HGCM_SVC_PARM_PTR ; pCtl -> aParms [ 0 ] . u . pointer . addr = pData ; pCtl -> aParms [ 0 ] . u . pointer . size = sizeof ( * pData ) ; rc = i_crCtlSubmit ( & pCtl -> Hdr , sizeof ( * pCtl ) , i_displayCrCmdFree , pCtl ) ; if ( RT_FAILURE ( rc ) ) { AssertMsgFailed ( ( " \n " , rc ) ) ; RTMemFree ( pCtl ) ; } } else rc = VERR_NO_MEMORY ; } } return rc ; } #else RT_NOREF ( pScreen , pvVRAM ) ; #endif return VINF_SUCCESS ; }
public methods only for internal purposes
public methods only for internal purposes
/* nop it */ /* !VBOX_WITH_HGCM || !VBOX_WITH_CROGL */