Changeset 51320 in vbox for trunk/src/VBox/HostServices/SharedOpenGL
- Timestamp:
- May 21, 2014 12:56:33 PM (11 years ago)
- Location:
- trunk/src/VBox/HostServices/SharedOpenGL/crserverlib
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server.h
r51260 r51320 410 410 HCR_FRAMEBUFFER CrPMgrFbGetFirstEnabled(); 411 411 HCR_FRAMEBUFFER CrPMgrFbGetNextEnabled(HCR_FRAMEBUFFER hFb); 412 HCR_FRAMEBUFFER CrPMgrFbGetEnabled(uint32_t idScreen); 412 HCR_FRAMEBUFFER CrPMgrFbGetEnabled(uint32_t idFb); 413 HCR_FRAMEBUFFER CrPMgrFbGetEnabledForScreen(uint32_t idScreen); 413 414 int CrPMgrModeVrdp(bool fEnable); 414 415 int CrPMgrModeRootVr(bool fEnable); -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c
r51260 r51320 4180 4180 static DECLCALLBACK(bool) crVBoxServerHasDataForScreen(uint32_t u32ScreenID) 4181 4181 { 4182 HCR_FRAMEBUFFER hFb = CrPMgrFbGetEnabled (u32ScreenID);4182 HCR_FRAMEBUFFER hFb = CrPMgrFbGetEnabledForScreen(u32ScreenID); 4183 4183 if (hFb) 4184 4184 return CrFbHas3DData(hFb); -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_muralfbo.cpp
r51260 r51320 651 651 DECLEXPORT(int) crServerVBoxScreenshotGet(uint32_t u32Screen, uint32_t width, uint32_t height, uint32_t pitch, void *pvBuffer, CR_SCREENSHOT *pScreenshot) 652 652 { 653 HCR_FRAMEBUFFER hFb = CrPMgrFbGetEnabled (u32Screen);653 HCR_FRAMEBUFFER hFb = CrPMgrFbGetEnabledForScreen(u32Screen); 654 654 if (!hFb) 655 655 return VERR_INVALID_STATE; -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_presenter.cpp
r51269 r51320 156 156 /* FRAMEBUFFER */ 157 157 158 void CrFbInit(CR_FRAMEBUFFER *pFb, uint32_t id Screen)158 void CrFbInit(CR_FRAMEBUFFER *pFb, uint32_t idFb) 159 159 { 160 160 RTRECT Rect; … … 165 165 memset(pFb, 0, sizeof (*pFb)); 166 166 pFb->ScreenInfo.u16Flags = VBVA_SCREEN_F_DISABLED; 167 pFb->ScreenInfo.u32ViewIndex = id Screen;167 pFb->ScreenInfo.u32ViewIndex = idFb; 168 168 CrVrScrCompositorInit(&pFb->Compositor, &Rect); 169 169 RTListInit(&pFb->EntriesList); … … 957 957 return; 958 958 } 959 uint32_t id Screen= pFb->ScreenInfo.u32ViewIndex;959 uint32_t idFb = pFb->ScreenInfo.u32ViewIndex; 960 960 961 961 CrVrScrCompositorClear(&pFb->Compositor); … … 968 968 969 969 pFb->ScreenInfo.u16Flags = VBVA_SCREEN_F_DISABLED; 970 pFb->ScreenInfo.u32ViewIndex = id Screen;970 pFb->ScreenInfo.u32ViewIndex = idFb; 971 971 } 972 972 … … 3937 3937 } 3938 3938 3939 HCR_FRAMEBUFFER CrPMgrFbGet(uint32_t id Screen)3940 { 3941 if (id Screen>= CR_MAX_GUEST_MONITORS)3942 { 3943 WARN(("invalid id Screen %d", idScreen));3939 HCR_FRAMEBUFFER CrPMgrFbGet(uint32_t idFb) 3940 { 3941 if (idFb >= CR_MAX_GUEST_MONITORS) 3942 { 3943 WARN(("invalid idFb %d", idFb)); 3944 3944 return NULL; 3945 3945 } 3946 3946 3947 if (!CrFBmIsSet(&g_CrPresenter.FramebufferInitMap, id Screen))3948 { 3949 CrFbInit(&g_CrPresenter.aFramebuffers[id Screen], idScreen);3950 CrFBmSetAtomic(&g_CrPresenter.FramebufferInitMap, id Screen);3947 if (!CrFBmIsSet(&g_CrPresenter.FramebufferInitMap, idFb)) 3948 { 3949 CrFbInit(&g_CrPresenter.aFramebuffers[idFb], idFb); 3950 CrFBmSetAtomic(&g_CrPresenter.FramebufferInitMap, idFb); 3951 3951 } 3952 3952 else 3953 Assert(g_CrPresenter.aFramebuffers[id Screen].ScreenInfo.u32ViewIndex == idScreen);3954 3955 return &g_CrPresenter.aFramebuffers[id Screen];3956 } 3957 3958 HCR_FRAMEBUFFER CrPMgrFbGetInitialized(uint32_t id Screen)3959 { 3960 if (id Screen>= CR_MAX_GUEST_MONITORS)3961 { 3962 WARN(("invalid id Screen %d", idScreen));3953 Assert(g_CrPresenter.aFramebuffers[idFb].ScreenInfo.u32ViewIndex == idFb); 3954 3955 return &g_CrPresenter.aFramebuffers[idFb]; 3956 } 3957 3958 HCR_FRAMEBUFFER CrPMgrFbGetInitialized(uint32_t idFb) 3959 { 3960 if (idFb >= CR_MAX_GUEST_MONITORS) 3961 { 3962 WARN(("invalid idFb %d", idFb)); 3963 3963 return NULL; 3964 3964 } 3965 3965 3966 if (!CrFBmIsSet(&g_CrPresenter.FramebufferInitMap, id Screen))3966 if (!CrFBmIsSet(&g_CrPresenter.FramebufferInitMap, idFb)) 3967 3967 { 3968 3968 return NULL; 3969 3969 } 3970 3970 else 3971 Assert(g_CrPresenter.aFramebuffers[id Screen].ScreenInfo.u32ViewIndex == idScreen);3972 3973 return &g_CrPresenter.aFramebuffers[id Screen];3974 } 3975 3976 HCR_FRAMEBUFFER CrPMgrFbGetEnabled(uint32_t id Screen)3977 { 3978 HCR_FRAMEBUFFER hFb = CrPMgrFbGetInitialized(id Screen);3971 Assert(g_CrPresenter.aFramebuffers[idFb].ScreenInfo.u32ViewIndex == idFb); 3972 3973 return &g_CrPresenter.aFramebuffers[idFb]; 3974 } 3975 3976 HCR_FRAMEBUFFER CrPMgrFbGetEnabled(uint32_t idFb) 3977 { 3978 HCR_FRAMEBUFFER hFb = CrPMgrFbGetInitialized(idFb); 3979 3979 3980 3980 if(hFb && CrFbIsEnabled(hFb)) … … 3982 3982 3983 3983 return NULL; 3984 } 3985 3986 HCR_FRAMEBUFFER CrPMgrFbGetEnabledForScreen(uint32_t idScreen) 3987 { 3988 if (idScreen >= cr_server.screenCount) 3989 { 3990 WARN(("invalid target id")); 3991 return NULL; 3992 } 3993 3994 const CR_FBDISPLAY_INFO *pDpInfo = &g_CrPresenter.aDisplayInfos[idScreen]; 3995 if (pDpInfo->iFb < 0) 3996 return NULL; 3997 3998 return CrPMgrFbGetEnabled(pDpInfo->iFb); 3984 3999 } 3985 4000 … … 5173 5188 crServerDispatchVBoxTexPresent(GLuint texture, GLuint cfg, GLint xPos, GLint yPos, GLint cRects, const GLint *pRects) 5174 5189 { 5175 uint32_t id Screen= CR_PRESENT_GET_SCREEN(cfg);5176 if (id Screen>= CR_MAX_GUEST_MONITORS)5190 uint32_t idFb = CR_PRESENT_GET_SCREEN(cfg); 5191 if (idFb >= CR_MAX_GUEST_MONITORS) 5177 5192 { 5178 5193 WARN(("Invalid guest screen")); … … 5180 5195 } 5181 5196 5182 HCR_FRAMEBUFFER hFb = CrPMgrFbGetEnabled(id Screen);5197 HCR_FRAMEBUFFER hFb = CrPMgrFbGetEnabled(idFb); 5183 5198 if (!hFb) 5184 5199 { … … 5519 5534 { 5520 5535 const VBVAINFOSCREEN *pScreen = CrFbGetScreenInfo(hFb); 5521 Assert( pScreen->u32Width == width);5522 Assert( pScreen->u32Height == height);5536 Assert(!width || pScreen->u32Width == width); 5537 Assert(!height || pScreen->u32Height == height); 5523 5538 5524 5539 crServerDispatchVBoxTexPresent(hostId, pScreen->u32ViewIndex, pPos->x, pPos->y, cRects, (const GLint*)pRects); … … 5991 6006 } 5992 6007 5993 uint32_t id Screen= pFlip->Hdr.u.u8PrimaryID;5994 HCR_FRAMEBUFFER hFb = CrPMgrFbGetEnabled(id Screen);6008 uint32_t idFb = pFlip->Hdr.u.u8PrimaryID; 6009 HCR_FRAMEBUFFER hFb = CrPMgrFbGetEnabled(idFb); 5995 6010 if (!hFb) 5996 6011 { … … 6000 6015 6001 6016 const RTRECT *pRect = CrVrScrCompositorRectGet(&hFb->Compositor); 6002 crServerDispatchVBoxTexPresent(hostId, id Screen, 0, 0, 1, (const GLint*)pRect);6017 crServerDispatchVBoxTexPresent(hostId, idFb, 0, 0, 1, (const GLint*)pRect); 6003 6018 return 0; 6004 6019 }
Note:
See TracChangeset
for help on using the changeset viewer.