Changeset 52429 in vbox for trunk/src/VBox/HostServices/SharedOpenGL
- Timestamp:
- Aug 20, 2014 11:58:38 AM (10 years ago)
- Location:
- trunk/src/VBox/HostServices/SharedOpenGL
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedOpenGL/crserver/crservice.cpp
r52064 r52429 1101 1101 CHECK_ERROR_BREAK(pConsole, COMGETTER(Display)(pDisplay.asOutParam())); 1102 1102 1103 crServerVBoxCompositionSetEnableStateGlobal(GL_FALSE);1104 1105 1103 g_pConsole = pConsole; 1106 1104 g_u32ScreenCount = monitorCount; … … 1108 1106 rc = crVBoxServerSetScreenCount(monitorCount); 1109 1107 AssertRCReturn(rc, rc); 1108 1109 #if 1 1110 crServerVBoxCompositionSetEnableStateGlobal(GL_FALSE); 1110 1111 1111 1112 for (i=0; i<monitorCount; ++i) … … 1132 1133 1133 1134 crServerVBoxCompositionSetEnableStateGlobal(GL_TRUE); 1135 #endif 1134 1136 1135 1137 rc = VINF_SUCCESS; … … 1536 1538 } 1537 1539 uint32_t cParams = (cbCtl - sizeof (VBOXCRCMDCTL)) / sizeof (VBOXHGCMSVCPARM); 1538 return svcHostCallPerform(pCtl->u32Function, cParams, (VBOXHGCMSVCPARM*)(pCtl + 1)); 1540 bool fHasCallout = VBOXCRCMDCTL_IS_CALLOUT_AVAILABLE(pCtl); 1541 if (fHasCallout) 1542 crVBoxServerCalloutEnable(pCtl); 1543 1544 int rc = svcHostCallPerform(pCtl->u32Function, cParams, (VBOXHGCMSVCPARM*)(pCtl + 1)); 1545 1546 if (fHasCallout) 1547 crVBoxServerCalloutDisable(); 1548 1549 return rc; 1539 1550 } 1540 1551 -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c
r52260 r52429 282 282 283 283 VBoxVrTerm(); 284 285 RTSemEventDestroy(cr_server.hCalloutCompletionEvent); 284 286 } 285 287 … … 513 515 514 516 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 } 515 524 516 525 /* … … 4232 4241 g_pLed = pSetup->pLed; 4233 4242 4243 cr_server.ClientInfo = pSetup->CrClientInfo; 4244 4234 4245 pSetup->CrCmdServerInfo.hSvr = NULL; 4235 4246 pSetup->CrCmdServerInfo.pfnEnable = crVBoxCrCmdEnable; -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_presenter.cpp
r52384 r52429 46 46 #include "render/renderspu.h" 47 47 48 //#define CR_SERVER_WITH_CLIENT_CALLOUTS 49 48 50 class ICrFbDisplay 49 51 { … … 72 74 class CrFbDisplayWindowRootVr; 73 75 class CrFbDisplayVrdp; 76 class CrFbWindow; 74 77 75 78 typedef struct CR_FRAMEBUFFER … … 126 129 CrFbDisplayWindowRootVr *pDpWinRootVr; 127 130 CrFbDisplayVrdp *pDpVrdp; 131 CrFbWindow *pWindow; 132 uint32_t u32DisplayMode; 128 133 uint32_t u32Id; 129 134 int32_t iFb; … … 152 157 } CR_PRESENTER_GLOBALS; 153 158 159 static int crPMgrFbConnectTargetDisplays(HCR_FRAMEBUFFER hFb, CR_FBDISPLAY_INFO *pDpInfo, uint32_t u32ModeAdd); 160 154 161 static CR_PRESENTER_GLOBALS g_CrPresenter; 155 162 … … 2656 2663 virtual int UpdateBegin(struct CR_FRAMEBUFFER *pFb) 2657 2664 { 2658 int rc = mpWindow ->UpdateBegin();2665 int rc = mpWindow ? mpWindow->UpdateBegin() : VINF_SUCCESS; 2659 2666 if (RT_SUCCESS(rc)) 2660 2667 { … … 2663 2670 return VINF_SUCCESS; 2664 2671 else 2672 { 2665 2673 WARN(("err")); 2674 if (mpWindow) 2675 mpWindow->UpdateEnd(); 2676 } 2666 2677 } 2667 2678 else … … 2675 2686 CrFbDisplayBase::UpdateEnd(pFb); 2676 2687 2677 mpWindow->UpdateEnd(); 2688 if (mpWindow) 2689 mpWindow->UpdateEnd(); 2678 2690 } 2679 2691 … … 2687 2699 } 2688 2700 2689 if (mpWindow ->GetParentId())2701 if (mpWindow && mpWindow->GetParentId()) 2690 2702 { 2691 2703 rc = mpWindow->Create(); … … 2709 2721 } 2710 2722 2711 if (mpWindow ->GetParentId())2723 if (mpWindow && mpWindow->GetParentId()) 2712 2724 { 2713 2725 rc = mpWindow->Create(); … … 2731 2743 } 2732 2744 2733 if (mpWindow ->GetParentId())2745 if (mpWindow && mpWindow->GetParentId()) 2734 2746 { 2735 2747 rc = mpWindow->Create(); … … 2753 2765 } 2754 2766 2755 if (mpWindow ->GetParentId())2767 if (mpWindow && mpWindow->GetParentId()) 2756 2768 { 2757 2769 rc = mpWindow->Create(); … … 2793 2805 // always call SetPosition to ensure window is adjustep properly 2794 2806 // if (pViewportRect->xLeft != mViewportRect.xLeft || pViewportRect->yTop != mViewportRect.yTop) 2807 if (mpWindow) 2795 2808 { 2796 2809 const RTRECT* pRect = getRect(); … … 2808 2821 } 2809 2822 2810 virtual CrFbWindow * windowDetach( )2823 virtual CrFbWindow * windowDetach(bool fCleanup = true) 2811 2824 { 2812 2825 if (isUpdating()) … … 2819 2832 if (mpWindow) 2820 2833 { 2821 windowCleanup(); 2834 if (fCleanup) 2835 windowCleanup(); 2822 2836 mpWindow = NULL; 2823 2837 } … … 2848 2862 mDefaultParentId = parentId; 2849 2863 2850 if (!isActive() )2864 if (!isActive() && mpWindow) 2851 2865 { 2852 2866 int rc = mpWindow->Reparent(parentId); … … 2872 2886 int rc = VINF_SUCCESS; 2873 2887 2874 if (isActive() )2888 if (isActive() && mpWindow) 2875 2889 { 2876 2890 rc = mpWindow->Reparent(parentId); … … 2898 2912 if (!hFb || !CrFbIsEnabled(hFb)) 2899 2913 { 2900 Assert(!mpWindow ->IsVisivle());2914 Assert(!mpWindow || !mpWindow->IsVisivle()); 2901 2915 return VINF_SUCCESS; 2902 2916 } 2903 2917 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 } 2915 2934 2916 2935 return rc; 2917 2936 } 2918 2937 2938 CrFbWindow* getWindow() {return mpWindow;} 2919 2939 protected: 2920 2940 virtual void onUpdateEnd() … … 2932 2952 virtual void ueRegions() 2933 2953 { 2934 mpWindow->SetVisibleRegionsChanged(); 2954 if (mpWindow) 2955 mpWindow->SetVisibleRegionsChanged(); 2935 2956 } 2936 2957 … … 2955 2976 virtual int windowSetCompositor(bool fSet) 2956 2977 { 2978 if (!mpWindow) 2979 return VINF_SUCCESS; 2980 2957 2981 if (fSet) 2958 2982 { … … 2965 2989 virtual int windowCleanup() 2966 2990 { 2991 if (!mpWindow) 2992 return VINF_SUCCESS; 2993 2967 2994 int rc = mpWindow->UpdateBegin(); 2968 2995 if (!RT_SUCCESS(rc)) … … 3013 3040 { 3014 3041 int rc = VINF_SUCCESS; 3042 3043 if (!mpWindow) 3044 return VINF_SUCCESS; 3015 3045 3016 3046 // HCR_FRAMEBUFFER hFb = getFramebuffer(); … … 3061 3091 } 3062 3092 3093 #if 0 3063 3094 rc = mpWindow->Reparent(mDefaultParentId); 3064 3095 if (!RT_SUCCESS(rc)) … … 3067 3098 return rc; 3068 3099 } 3100 #endif 3069 3101 } 3070 3102 … … 3074 3106 virtual int windowSync() 3075 3107 { 3108 if (!mpWindow) 3109 return VINF_SUCCESS; 3110 3076 3111 int rc = mpWindow->UpdateBegin(); 3077 3112 if (!RT_SUCCESS(rc)) … … 3124 3159 if (CrFbHas3DData(hFb)) 3125 3160 { 3126 if (mpWindow ->GetParentId())3161 if (mpWindow && mpWindow->GetParentId()) 3127 3162 { 3128 3163 rc = mpWindow->Create(); … … 3144 3179 } 3145 3180 3146 CrFbWindow* getWindow() {return mpWindow;}3147 3181 private: 3148 3182 CrFbWindow *mpWindow; … … 4166 4200 } 4167 4201 4202 static 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 4168 4220 int CrPMgrScreenChanged(uint32_t idScreen) 4169 4221 { … … 4176 4228 int rc = VINF_SUCCESS; 4177 4229 CR_FBDISPLAY_INFO *pDpInfo; 4230 #if 0 4178 4231 bool fDefaultParentChange = (idScreen == 0); 4179 4232 if (fDefaultParentChange) … … 4217 4270 } 4218 4271 } 4272 #endif 4219 4273 4220 4274 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 4221 4284 if (pDpInfo->pDpWin) 4222 4285 { 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()); 4230 4287 4231 4288 rc = pDpInfo->pDpWin->UpdateBegin(hFb); … … 4239 4296 WARN(("UpdateBegin failed %d", rc)); 4240 4297 } 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 } 4242 4335 end: 4243 4336 #if 0 4244 4337 if (fDefaultParentChange) 4245 4338 { … … 4254 4347 } 4255 4348 } 4256 4349 #endif 4257 4350 return rc; 4258 4351 } … … 4276 4369 } 4277 4370 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 } 4286 4383 } 4287 4384 … … 4399 4496 if (pDpInfo->pDpWinRootVr) 4400 4497 { 4498 #ifdef CR_SERVER_WITH_CLIENT_CALLOUTS 4499 CrFbWindow *pWindow = pDpInfo->pDpWinRootVr->windowDetach(false); 4500 Assert(pWindow == pDpInfo->pWindow); 4501 #endif 4401 4502 rc = crPMgrFbDisconnectDisplay(hFb, pDpInfo->pDpWinRootVr); 4402 4503 if (RT_FAILURE(rc)) … … 4406 4507 } 4407 4508 } 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 4411 4515 rc = crPMgrFbDisconnectDisplay(hFb, pDpInfo->pDpWin); 4412 4516 if (RT_FAILURE(rc)) … … 4427 4531 if (!pDpInfo->pDpWinRootVr) 4428 4532 { 4429 CrFbWindow *pWin = NULL;4430 4533 if (pDpInfo->pDpWin) 4431 4534 { 4432 pWin = pDpInfo->pDpWin->windowDetach();4535 CrFbWindow *pWin = pDpInfo->pDpWin->windowDetach(); 4433 4536 CRASSERT(pWin); 4537 Assert(pWin == pDpInfo->pWindow); 4434 4538 delete pDpInfo->pDpWin; 4435 4539 pDpInfo->pDpWin = NULL; 4436 4540 } 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); 4441 4547 pDpInfo->pDpWin = pDpInfo->pDpWinRootVr; 4442 pDpInfo->pDpWinRootVr->windowAttach(p Win);4548 pDpInfo->pDpWinRootVr->windowAttach(pDpInfo->pWindow); 4443 4549 } 4444 4550 } … … 4446 4552 static void crPMgrDpWinCreate(CR_FBDISPLAY_INFO *pDpInfo) 4447 4553 { 4448 CrFbWindow *pWin = NULL;4449 4554 if (pDpInfo->pDpWinRootVr) 4450 4555 { 4451 4556 CRASSERT(pDpInfo->pDpWinRootVr == pDpInfo->pDpWin); 4452 pWin = pDpInfo->pDpWin->windowDetach();4557 CrFbWindow *pWin = pDpInfo->pDpWin->windowDetach(); 4453 4558 CRASSERT(pWin); 4559 Assert(pWin == pDpInfo->pWindow); 4454 4560 delete pDpInfo->pDpWinRootVr; 4455 4561 pDpInfo->pDpWinRootVr = NULL; … … 4459 4565 if (!pDpInfo->pDpWin) 4460 4566 { 4461 if (!p Win)4462 p Win= 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(p Win);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); 4466 4572 } 4467 4573 } … … 4472 4578 if (u32ModeRemove & CR_PMGR_MODE_ROOTVR) 4473 4579 { 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 } 4481 4593 } 4482 4594 } … … 4484 4596 { 4485 4597 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 } 4492 4610 } 4493 4611 } … … 4495 4613 if (u32ModeRemove & CR_PMGR_MODE_VRDP) 4496 4614 { 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; 4505 4627 4506 4628 return VINF_SUCCESS; … … 4546 4668 } 4547 4669 } 4670 4671 pDpInfo->u32DisplayMode |= u32ModeAdd; 4548 4672 4549 4673 return VINF_SUCCESS; … … 4579 4703 } 4580 4704 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 ); 4582 4710 if (RT_FAILURE(rc)) 4583 4711 { … … 4678 4806 if (!pDpInfo->pDpWinRootVr->getFramebuffer()) 4679 4807 { 4808 pDpInfo->pDpWinRootVr->windowDetach(false); 4680 4809 delete pDpInfo->pDpWinRootVr; 4681 4810 pDpInfo->pDpWinRootVr = NULL; 4682 4811 pDpInfo->pDpWin = NULL; 4812 if (pDpInfo->pWindow) 4813 { 4814 delete pDpInfo->pWindow; 4815 pDpInfo->pWindow = NULL; 4816 } 4683 4817 } 4684 4818 else … … 4689 4823 if (!pDpInfo->pDpWin->getFramebuffer()) 4690 4824 { 4825 pDpInfo->pDpWin->windowDetach(false); 4691 4826 delete pDpInfo->pDpWin; 4692 4827 pDpInfo->pDpWin = NULL; 4828 if (pDpInfo->pWindow) 4829 { 4830 delete pDpInfo->pWindow; 4831 pDpInfo->pWindow = NULL; 4832 } 4693 4833 } 4694 4834 else … … 4981 5121 if (fFbInfoChanged) 4982 5122 { 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 4983 5131 rc = CrFbUpdateBegin(hFb); 4984 5132 if (!RT_SUCCESS(rc)) … … 6206 6354 return 0; 6207 6355 } 6356 6357 typedef struct CRSERVER_CLIENT_CALLOUT 6358 { 6359 VBOXCRCMDCTL_CALLOUT_LISTENTRY Entry; 6360 PFNVCRSERVER_CLIENT_CALLOUT_CB pfnCb; 6361 void*pvCb; 6362 } CRSERVER_CLIENT_CALLOUT; 6363 6364 static 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 6373 static 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 6387 DECLEXPORT(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 6397 extern 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 36 36 if (fGuestWindow) 37 37 { 38 CRMuralInfo *dummy = crServerGetDummyMural( visBits);38 CRMuralInfo *dummy = crServerGetDummyMural(realVisBits); 39 39 if (!dummy) 40 40 { … … 44 44 spuWindow = dummy->spuWindow; 45 45 mural->fIsDummyRefference = GL_TRUE; 46 47 dims[0] = dummy->width; 48 dims[1] = dummy->height; 46 49 } 47 50 else … … 56 59 } 57 60 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 } 62 65 63 66 defaultMural = (CRMuralInfo *) crHashtableSearch(cr_server.muralTable, 0); -
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.c
r52368 r52429 1444 1444 } 1445 1445 1446 bool renderspuCalloutAvailable() 1447 { 1448 return render_spu.pfnClientCallout != NULL; 1449 } 1450 1451 bool renderspuCalloutClient(PFNVCRSERVER_CLIENT_CALLOUT_CB pfnCb, void *pvCb) 1452 { 1453 if (render_spu.pfnClientCallout) 1454 { 1455 pfnCb(pvCb); 1456 return true; 1457 } 1458 return false; 1459 } 1446 1460 1447 1461 static void RENDER_APIENTRY … … 1455 1469 1456 1470 switch (target) { 1457 1471 case GL_HH_SET_CLIENT_CALLOUT: 1472 render_spu.pfnClientCallout = (PFNVCRSERVER_CLIENT_CALLOUT)values; 1473 break; 1458 1474 case GL_GATHER_CONNECT_CR: 1459 1475 if (render_spu.gather_userbuf_size) -
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.h
r51442 r52429 219 219 #endif 220 220 221 typedef DECLCALLBACKPTR(void, PFNVCRSERVER_CLIENT_CALLOUT_CB)(void *pvCb); 222 typedef DECLCALLBACKPTR(void, PFNVCRSERVER_CLIENT_CALLOUT)(PFNVCRSERVER_CLIENT_CALLOUT_CB pfnCb, void*pvCb); 223 224 221 225 /** 222 226 * Renderspu state info … … 287 291 SPUDispatchTable blitterDispatch; 288 292 CRHashTable *blitterTable; 293 294 PFNVCRSERVER_CLIENT_CALLOUT pfnClientCallout; 289 295 290 296 #ifdef USE_OSMESA … … 454 460 uint32_t renderspuContextRetain(ContextInfo *context); 455 461 462 bool renderspuCalloutAvailable(); 463 bool renderspuCalloutClient(PFNVCRSERVER_CLIENT_CALLOUT_CB pfnCb, void *pvCb); 464 465 456 466 #ifdef __cplusplus 457 467 extern "C" { -
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.m
r52398 r52429 115 115 #endif 116 116 117 #define DEBUG_FUNC_ENTER() do { \ 118 DEBUG_MSG(("==>%s\n", __PRETTY_FUNCTION__)); \ 119 } while (0) 120 121 #define DEBUG_FUNC_LEAVE() do { \ 122 DEBUG_MSG(("<==%s\n", __PRETTY_FUNCTION__)); \ 123 } while (0) 124 125 117 126 #ifdef DEBUG_poetzsch 118 127 # define CHECK_GL_ERROR()\ … … 361 370 - (NSWindow*)overlayWin; 362 371 363 - (void)setPos:(NSPoint)pos; 372 - (void)vboxSetPos:(NSPoint)pos; 373 - (void)vboxSetPosUI:(NSPoint)pos; 374 - (void)vboxSetPosUIObj:(NSValue*)pPos; 364 375 - (NSPoint)pos; 365 376 - (bool)isEverSized; 366 - (void)setSize:(NSSize)size; 377 - (void)vboxDestroy; 378 - (void)vboxSetSizeUI:(NSSize)size; 379 - (void)vboxSetSizeUIObj:(NSValue*)pSize; 380 - (void)vboxSetSize:(NSSize)size; 367 381 - (NSSize)size; 368 382 - (void)updateViewportCS; … … 376 390 - (void)makeCurrentFBO; 377 391 - (void)swapFBO; 378 - (void)vboxS ubmitVisible:(GLboolean)fVisible;379 - (void)vboxSetVisibleUI ;380 - (void)vboxSet HiddenUI;392 - (void)vboxSetVisible:(GLboolean)fVisible; 393 - (void)vboxSetVisibleUIObj:(NSNumber*)pVisible; 394 - (void)vboxSetVisibleUI:(GLboolean)fVisible; 381 395 - (void)vboxTryDraw; 382 396 - (void)vboxTryDrawUI; 397 - (void)vboxReparent:(NSView*)pParentView; 398 - (void)vboxReparentUI:(NSView*)pParentView; 383 399 - (void)vboxPresent:(const VBOXVR_SCR_COMPOSITOR*)pCompositor; 384 400 - (void)vboxPresentCS:(const VBOXVR_SCR_COMPOSITOR*)pCompositor; … … 451 467 - (id)init 452 468 { 469 DEBUG_FUNC_ENTER(); 453 470 self = [super init]; 454 471 … … 461 478 } 462 479 480 DEBUG_FUNC_LEAVE(); 481 463 482 return self; 464 483 } … … 466 485 - (void)dealloc 467 486 { 487 DEBUG_FUNC_ENTER(); 488 468 489 [self cleanup]; 469 490 [m_Lock release]; 470 491 471 492 [super dealloc]; 493 494 DEBUG_FUNC_LEAVE(); 472 495 } 473 496 474 497 - (void)cleanup 475 498 { 499 DEBUG_FUNC_ENTER(); 500 476 501 if (m_ThumbImage != nil) 477 502 { … … 484 509 m_ThumbBitmap = nil; 485 510 } 511 512 DEBUG_FUNC_LEAVE(); 486 513 } 487 514 488 515 - (void)lock 489 516 { 517 DEBUG_FUNC_ENTER(); 490 518 [m_Lock lock]; 519 DEBUG_FUNC_LEAVE(); 491 520 } 492 521 493 522 - (void)unlock 494 523 { 524 DEBUG_FUNC_ENTER(); 495 525 [m_Lock unlock]; 526 DEBUG_FUNC_LEAVE(); 496 527 } 497 528 498 529 - (void)setFrame:(NSRect)frame 499 530 { 531 DEBUG_FUNC_ENTER(); 500 532 [super setFrame:frame]; 501 533 … … 522 554 } 523 555 [self unlock]; 556 DEBUG_FUNC_LEAVE(); 524 557 } 525 558 526 559 - (BOOL)isFlipped 527 560 { 561 DEBUG_FUNC_ENTER(); 562 DEBUG_FUNC_LEAVE(); 528 563 return YES; 529 564 } … … 531 566 - (void)drawRect:(NSRect)aRect 532 567 { 568 DEBUG_FUNC_ENTER(); 533 569 NSRect frame; 534 570 … … 542 578 [m_ThumbImage drawAtPoint:NSMakePoint(0, 0) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0]; 543 579 [self unlock]; 580 DEBUG_FUNC_LEAVE(); 544 581 } 545 582 546 583 - (NSBitmapImageRep*)thumbBitmap 547 584 { 585 DEBUG_FUNC_ENTER(); 586 DEBUG_FUNC_LEAVE(); 548 587 return m_ThumbBitmap; 549 588 } … … 551 590 - (NSImage*)thumbImage 552 591 { 592 DEBUG_FUNC_ENTER(); 593 DEBUG_FUNC_LEAVE(); 594 553 595 return m_ThumbImage; 554 596 } … … 564 606 -(id)initWithFormat:(NSOpenGLPixelFormat*)format shareContext:(NSOpenGLContext*)share 565 607 { 608 DEBUG_FUNC_ENTER(); 609 566 610 m_pPixelFormat = NULL; 567 611 m_pView = NULL; … … 573 617 DEBUG_MSG(("OCTX(%p): init OverlayOpenGLContext\n", (void*)self)); 574 618 619 DEBUG_FUNC_LEAVE(); 620 575 621 return self; 576 622 } … … 578 624 - (void)dealloc 579 625 { 626 DEBUG_FUNC_ENTER(); 627 580 628 DEBUG_MSG(("OCTX(%p): dealloc OverlayOpenGLContext\n", (void*)self)); 581 629 … … 583 631 584 632 [super dealloc]; 633 634 DEBUG_FUNC_LEAVE(); 585 635 } 586 636 587 637 -(bool)isDoubleBuffer 588 638 { 639 DEBUG_FUNC_ENTER(); 640 589 641 GLint val; 590 642 [m_pPixelFormat getValues:&val forAttribute:NSOpenGLPFADoubleBuffer forVirtualScreen:0]; 643 644 DEBUG_FUNC_LEAVE(); 645 591 646 return val == GL_TRUE ? YES : NO; 592 647 } … … 594 649 -(void)setView:(NSView*)view 595 650 { 651 DEBUG_FUNC_ENTER(); 652 596 653 DEBUG_MSG(("OCTX(%p): setView: new view: %p\n", (void*)self, (void*)view)); 597 654 … … 601 658 [super setView: view]; 602 659 #endif 660 661 DEBUG_FUNC_LEAVE(); 603 662 } 604 663 605 664 -(NSView*)view 606 665 { 666 DEBUG_FUNC_ENTER(); 667 DEBUG_FUNC_LEAVE(); 668 607 669 #if 1 /* def FBO */ 608 670 return m_pView; … … 614 676 -(void)clearDrawable 615 677 { 678 DEBUG_FUNC_ENTER(); 679 616 680 DEBUG_MSG(("OCTX(%p): clearDrawable\n", (void*)self)); 617 681 618 682 m_pView = NULL;; 619 683 [super clearDrawable]; 684 685 DEBUG_FUNC_LEAVE(); 620 686 } 621 687 622 688 -(NSOpenGLPixelFormat*)openGLPixelFormat 623 689 { 690 DEBUG_FUNC_ENTER(); 691 DEBUG_FUNC_LEAVE(); 692 624 693 return m_pPixelFormat; 625 694 } … … 636 705 -(id)initWithOverlayWindow:(OverlayWindow*)pOverlayWindow 637 706 { 707 DEBUG_FUNC_ENTER(); 708 638 709 self = [super initWithFrame:NSZeroRect]; 639 710 … … 642 713 DEBUG_MSG(("OHVW(%p): init OverlayHelperView\n", (void*)self)); 643 714 715 DEBUG_FUNC_LEAVE(); 716 644 717 return self; 645 718 } … … 647 720 -(void)viewDidMoveToWindow 648 721 { 722 DEBUG_FUNC_ENTER(); 723 649 724 DEBUG_MSG(("OHVW(%p): viewDidMoveToWindow: new win: %p\n", (void*)self, (void*)[self window])); 650 725 651 726 [m_pOverlayWindow parentWindowChanged:[self window]]; 727 728 DEBUG_FUNC_LEAVE(); 652 729 } 653 730 … … 663 740 - (id)initWithParentView:(NSView*)pParentView overlayView:(OverlayView*)pOverlayView 664 741 { 742 DEBUG_FUNC_ENTER(); 743 665 744 NSWindow *pParentWin = nil; 666 745 … … 706 785 DEBUG_MSG(("OWIN(%p): init OverlayWindow\n", (void*)self)); 707 786 787 DEBUG_FUNC_LEAVE(); 788 708 789 return self; 709 790 } … … 711 792 - (void)dealloc 712 793 { 794 DEBUG_FUNC_ENTER(); 795 713 796 DEBUG_MSG(("OWIN(%p): dealloc OverlayWindow\n", (void*)self)); 714 797 … … 719 802 720 803 [super dealloc]; 804 805 DEBUG_FUNC_LEAVE(); 721 806 } 722 807 723 808 - (void)parentWindowFrameChanged:(NSNotification*)pNote 724 809 { 810 DEBUG_FUNC_ENTER(); 811 725 812 DEBUG_MSG(("OWIN(%p): parentWindowFrameChanged\n", (void*)self)); 726 813 … … 738 825 [self performSelectorOnMainThread:@selector(vboxReshapePerform) withObject:nil waitUntilDone:NO]; 739 826 } 827 828 DEBUG_FUNC_LEAVE(); 740 829 } 741 830 742 831 - (void)parentWindowChanged:(NSWindow*)pWindow 743 832 { 833 DEBUG_FUNC_ENTER(); 834 744 835 DEBUG_MSG(("OWIN(%p): parentWindowChanged\n", (void*)self)); 745 836 … … 771 862 } 772 863 } 864 865 DEBUG_FUNC_LEAVE(); 773 866 } 774 867 … … 784 877 - (id)initWithFrame:(NSRect)frame thread:(RTTHREAD)aThread parentView:(NSView*)pParentView winInfo:(WindowInfo*)pWinInfo 785 878 { 879 DEBUG_FUNC_ENTER(); 880 786 881 m_pParentView = pParentView; 787 882 /* Make some reasonable defaults */ … … 808 903 DEBUG_MSG(("OVIW(%p): init OverlayView\n", (void*)self)); 809 904 905 DEBUG_FUNC_LEAVE(); 906 810 907 return self; 811 908 } … … 813 910 - (void)cleanupData 814 911 { 912 DEBUG_FUNC_ENTER(); 913 815 914 [self deleteDockTile]; 816 915 … … 834 933 835 934 [self clearVisibleRegions]; 935 936 DEBUG_FUNC_LEAVE(); 836 937 } 837 938 838 939 - (void)dealloc 839 940 { 941 DEBUG_FUNC_ENTER(); 942 840 943 DEBUG_MSG(("OVIW(%p): dealloc OverlayView\n", (void*)self)); 841 944 … … 843 946 844 947 [super dealloc]; 948 949 DEBUG_FUNC_LEAVE(); 845 950 } 846 951 … … 852 957 - (void)setGLCtx:(NSOpenGLContext*)pCtx 853 958 { 959 DEBUG_FUNC_ENTER(); 960 854 961 DEBUG_MSG(("OVIW(%p): setGLCtx: new ctx: %p\n", (void*)self, (void*)pCtx)); 855 962 if (m_pGLCtx == pCtx) 963 { 964 DEBUG_FUNC_LEAVE(); 856 965 return; 966 } 857 967 858 968 /* ensure the context drawable is cleared to avoid holding a reference to inexistent view */ … … 867 977 if (pCtx) 868 978 [pCtx retain]; 979 980 DEBUG_FUNC_LEAVE(); 869 981 } 870 982 871 983 - (NSOpenGLContext*)glCtx 872 984 { 985 DEBUG_FUNC_ENTER(); 986 DEBUG_FUNC_LEAVE(); 987 873 988 return m_pGLCtx; 874 989 } … … 876 991 - (NSView*)parentView 877 992 { 993 DEBUG_FUNC_ENTER(); 994 DEBUG_FUNC_LEAVE(); 995 878 996 return m_pParentView; 879 997 } … … 881 999 - (void)setParentView:(NSView*)pView 882 1000 { 1001 DEBUG_FUNC_ENTER(); 1002 883 1003 DEBUG_MSG(("OVIW(%p): setParentView: new view: %p\n", (void*)self, (void*)pView)); 884 1004 885 1005 m_pParentView = pView; 1006 1007 DEBUG_FUNC_LEAVE(); 886 1008 } 887 1009 888 1010 - (void)setOverlayWin:(NSWindow*)pWin 889 1011 { 1012 DEBUG_FUNC_ENTER(); 1013 890 1014 DEBUG_MSG(("OVIW(%p): setOverlayWin: new win: %p\n", (void*)self, (void*)pWin)); 891 1015 892 1016 m_pOverlayWin = pWin; 1017 1018 DEBUG_FUNC_LEAVE(); 893 1019 } 894 1020 895 1021 - (NSWindow*)overlayWin 896 1022 { 1023 DEBUG_FUNC_ENTER(); 1024 DEBUG_FUNC_LEAVE(); 1025 897 1026 return m_pOverlayWin; 898 1027 } 899 1028 900 - (void) setPos:(NSPoint)pos901 { 902 DEBUG_ MSG(("OVIW(%p): setPos: new pos: %d, %d\n", (void*)self, (int)pos.x, (int)pos.y));1029 - (void)vboxSetPosUI:(NSPoint)pos 1030 { 1031 DEBUG_FUNC_ENTER(); 903 1032 904 1033 m_Pos = pos; 905 1034 906 1035 if (m_fEverSized) 907 [self performSelectorOnMainThread:@selector(vboxReshapePerform) withObject:nil waitUntilDone:NO]; 1036 [self vboxReshapePerform]; 1037 1038 DEBUG_FUNC_LEAVE(); 1039 } 1040 1041 - (void)vboxSetPosUIObj:(NSValue*)pPos 1042 { 1043 DEBUG_FUNC_ENTER(); 1044 1045 NSPoint pos = [pPos pointValue]; 1046 [self vboxSetPosUI:pos]; 1047 [pPos release]; 1048 1049 DEBUG_FUNC_LEAVE(); 1050 } 1051 1052 typedef struct CR_RCD_SETPOS 1053 { 1054 OverlayView *pView; 1055 NSPoint pos; 1056 } CR_RCD_SETPOS; 1057 1058 static DECLCALLBACK(void) vboxRcdSetPos(void *pvCb) 1059 { 1060 DEBUG_FUNC_ENTER(); 1061 1062 CR_RCD_SETPOS * pReparent = (CR_RCD_SETPOS*)pvCb; 1063 [pReparent->pView vboxSetPosUI:pReparent->pos]; 1064 1065 DEBUG_FUNC_LEAVE(); 1066 } 1067 1068 - (void)vboxSetPos:(NSPoint)pos 1069 { 1070 DEBUG_FUNC_ENTER(); 1071 1072 DEBUG_MSG(("OVIW(%p): vboxSetPos: new pos: %d, %d\n", (void*)self, (int)pos.x, (int)pos.y)); 1073 1074 if (renderspuCalloutAvailable()) 1075 { 1076 CR_RCD_SETPOS SetPos; 1077 SetPos.pView = self; 1078 SetPos.pos = pos; 1079 renderspuCalloutClient(vboxRcdSetPos, &SetPos); 1080 } 1081 else 1082 { 1083 DEBUG_MSG(("no callout available on setPos\n")); 1084 NSValue *pPos = [NSValue valueWithPoint:pos]; 1085 [pPos retain]; 1086 [self performSelectorOnMainThread:@selector(vboxSetPosUIObj:) withObject:pPos waitUntilDone:NO]; 1087 } 1088 1089 DEBUG_FUNC_LEAVE(); 908 1090 } 909 1091 910 1092 - (NSPoint)pos 911 1093 { 1094 DEBUG_FUNC_ENTER(); 1095 DEBUG_FUNC_LEAVE(); 912 1096 return m_Pos; 913 1097 } … … 915 1099 - (bool)isEverSized 916 1100 { 1101 DEBUG_FUNC_ENTER(); 1102 DEBUG_FUNC_LEAVE(); 917 1103 return m_fEverSized; 918 1104 } 919 1105 920 - (void)setSize:(NSSize)size 921 { 922 NSOpenGLContext *pCurCtx; 923 NSView *pCurView; 1106 - (void)vboxDestroy 1107 { 1108 DEBUG_FUNC_ENTER(); 1109 BOOL fIsMain = [NSThread isMainThread]; 1110 NSWindow *pWin = nil; 1111 1112 /* Hide the view early */ 1113 [self setHidden: YES]; 1114 1115 pWin = [self window]; 1116 [[NSNotificationCenter defaultCenter] removeObserver:pWin]; 1117 [pWin setContentView: nil]; 1118 [[pWin parentWindow] removeChildWindow: pWin]; 1119 1120 if (fIsMain) 1121 [pWin release]; 1122 else 1123 { 1124 /* We can NOT run synchronously with the main thread since this may lead to a deadlock, 1125 caused by main thread waiting xpcom thread, xpcom thread waiting to main hgcm thread, 1126 and main hgcm thread waiting for us, this is why use waitUntilDone:NO, 1127 which should cause no harm */ 1128 [pWin performSelectorOnMainThread:@selector(release) withObject:nil waitUntilDone:NO]; 1129 } 1130 1131 [self cleanupData]; 1132 1133 if (fIsMain) 1134 [self release]; 1135 else 1136 { 1137 /* We can NOT run synchronously with the main thread since this may lead to a deadlock, 1138 caused by main thread waiting xpcom thread, xpcom thread waiting to main hgcm thread, 1139 and main hgcm thread waiting for us, this is why use waitUntilDone:NO. 1140 We need to avoid concurrency though, so we cleanup some data right away via a cleanupData call */ 1141 [self performSelectorOnMainThread:@selector(release) withObject:nil waitUntilDone:NO]; 1142 } 1143 DEBUG_FUNC_LEAVE(); 1144 } 1145 1146 - (void)vboxSetSizeUIObj:(NSValue*)pSize 1147 { 1148 DEBUG_FUNC_ENTER(); 1149 NSSize size = [pSize sizeValue]; 1150 [self vboxSetSizeUI:size]; 1151 // [pSize release]; 1152 DEBUG_FUNC_LEAVE(); 1153 } 1154 1155 - (void)vboxSetSizeUI:(NSSize)size 1156 { 1157 DEBUG_FUNC_ENTER(); 924 1158 m_Size = size; 925 1159 926 1160 m_fEverSized = true; 927 1161 928 DEBUG_MSG(("OVIW(%p): setSize: new size: %dx%d\n", (void*)self, (int)size.width, (int)size.height));929 [self performSelectorOnMainThread:@selector(vboxReshapeOnResizePerform) withObject:nil waitUntilDone:NO];1162 DEBUG_MSG(("OVIW(%p): vboxSetSize: new size: %dx%d\n", (void*)self, (int)m_Size.width, (int)m_Size.height)); 1163 [self vboxReshapeOnResizePerform]; 930 1164 931 1165 /* ensure window contents is updated after that */ 932 [self performSelectorOnMainThread:@selector(vboxTryDrawUI) withObject:nil waitUntilDone:NO]; 1166 [self vboxTryDrawUI]; 1167 DEBUG_FUNC_LEAVE(); 1168 } 1169 1170 typedef struct CR_RCD_SETSIZE 1171 { 1172 OverlayView *pView; 1173 NSSize size; 1174 } CR_RCD_SETSIZE; 1175 1176 static DECLCALLBACK(void) vboxRcdSetSize(void *pvCb) 1177 { 1178 DEBUG_FUNC_ENTER(); 1179 CR_RCD_SETSIZE * pSetSize = (CR_RCD_SETSIZE*)pvCb; 1180 [pSetSize->pView vboxSetSizeUI:pSetSize->size]; 1181 DEBUG_FUNC_LEAVE(); 1182 } 1183 1184 - (void)vboxSetSize:(NSSize)size 1185 { 1186 DEBUG_FUNC_ENTER(); 1187 if (renderspuCalloutAvailable()) 1188 { 1189 CR_RCD_SETSIZE SetSize; 1190 SetSize.pView = self; 1191 SetSize.size = size; 1192 renderspuCalloutClient(vboxRcdSetSize, &SetSize); 1193 } 1194 else 1195 { 1196 NSValue *pSize = [NSValue valueWithSize:size]; 1197 [pSize retain]; 1198 DEBUG_MSG(("no callout available on setSize\n")); 1199 [self performSelectorOnMainThread:@selector(vboxSetSizeUIObj:) withObject:pSize waitUntilDone:NO]; 1200 } 1201 DEBUG_FUNC_LEAVE(); 933 1202 } 934 1203 935 1204 - (NSSize)size 936 1205 { 1206 DEBUG_FUNC_ENTER(); 937 1207 return m_Size; 1208 DEBUG_FUNC_LEAVE(); 938 1209 } 939 1210 940 1211 - (void)updateViewportCS 941 1212 { 1213 DEBUG_FUNC_ENTER(); 942 1214 DEBUG_MSG(("OVIW(%p): updateViewport\n", (void*)self)); 943 1215 … … 949 1221 /* Clear background to transparent */ 950 1222 glClearColor(0.0f, 0.0f, 0.0f, 0.0f); 1223 DEBUG_FUNC_LEAVE(); 951 1224 } 952 1225 953 1226 - (void)vboxReshapeOnResizePerform 954 1227 { 1228 DEBUG_FUNC_ENTER(); 955 1229 [self vboxReshapePerform]; 956 1230 … … 971 1245 } 972 1246 #endif 1247 DEBUG_FUNC_LEAVE(); 973 1248 } 974 1249 975 1250 - (void)vboxReshapeOnReparentPerform 976 1251 { 1252 DEBUG_FUNC_ENTER(); 977 1253 [self createDockTile]; 1254 DEBUG_FUNC_LEAVE(); 978 1255 } 979 1256 980 1257 - (void)vboxReshapePerform 981 1258 { 1259 DEBUG_FUNC_ENTER(); 982 1260 NSRect parentFrame = NSZeroRect; 983 1261 NSPoint parentPos = NSZeroPoint; … … 1071 1349 vboxCtxLeave(&CtxInfo); 1072 1350 } 1351 DEBUG_FUNC_LEAVE(); 1073 1352 } 1074 1353 1075 1354 - (void)createDockTile 1076 1355 { 1356 DEBUG_FUNC_ENTER(); 1077 1357 NSView *pDockScreen = nil; 1078 1358 [self deleteDockTile]; … … 1087 1367 [pDockScreen addSubview:m_DockTileView]; 1088 1368 } 1369 DEBUG_FUNC_LEAVE(); 1089 1370 } 1090 1371 1091 1372 - (void)deleteDockTile 1092 1373 { 1374 DEBUG_FUNC_ENTER(); 1093 1375 if (m_DockTileView != nil) 1094 1376 { … … 1097 1379 m_DockTileView = nil; 1098 1380 } 1381 DEBUG_FUNC_LEAVE(); 1099 1382 } 1100 1383 … … 1137 1420 - (bool)vboxSharedCtxCreate 1138 1421 { 1422 DEBUG_FUNC_ENTER(); 1139 1423 if (m_pSharedGLCtx) 1424 { 1425 DEBUG_FUNC_LEAVE(); 1140 1426 return true; 1427 } 1141 1428 1142 1429 Assert(!m_pBlitter); … … 1145 1432 { 1146 1433 DEBUG_WARN(("m_pBlitter allocation failed")); 1434 DEBUG_FUNC_LEAVE(); 1147 1435 return false; 1148 1436 } … … 1158 1446 RTMemFree(m_pBlitter); 1159 1447 m_pBlitter = NULL; 1448 DEBUG_FUNC_LEAVE(); 1160 1449 return false; 1161 1450 } … … 1173 1462 m_pSharedGLCtx = pSharedGLCtx; 1174 1463 1464 DEBUG_FUNC_LEAVE(); 1175 1465 return true; 1176 1466 } … … 1185 1475 } 1186 1476 1187 - (void)vboxSubmitVisible:(GLboolean)fVisible 1188 { 1189 if (fVisible) 1190 [self performSelectorOnMainThread:@selector(vboxSetVisibleUI) withObject:nil waitUntilDone:NO]; 1477 typedef struct CR_RCD_SETVISIBLE 1478 { 1479 OverlayView *pView; 1480 BOOL fVisible; 1481 } CR_RCD_SETVISIBLE; 1482 1483 static DECLCALLBACK(void) vboxRcdSetVisible(void *pvCb) 1484 { 1485 DEBUG_FUNC_ENTER(); 1486 CR_RCD_SETVISIBLE * pVisible = (CR_RCD_SETVISIBLE*)pvCb; 1487 1488 [pVisible->pView vboxSetVisibleUI:pVisible->fVisible]; 1489 DEBUG_FUNC_LEAVE(); 1490 } 1491 1492 - (void)vboxSetVisible:(GLboolean)fVisible 1493 { 1494 DEBUG_FUNC_ENTER(); 1495 if (renderspuCalloutAvailable()) 1496 { 1497 CR_RCD_SETVISIBLE Visible; 1498 Visible.pView = self; 1499 Visible.fVisible = fVisible; 1500 renderspuCalloutClient(vboxRcdSetVisible, &Visible); 1501 } 1191 1502 else 1192 [self performSelectorOnMainThread:@selector(vboxSetHiddenUI) withObject:nil waitUntilDone:NO]; 1193 } 1194 1195 - (void)vboxSetVisibleUI 1196 { 1197 [self setHidden: NO]; 1198 } 1199 1200 - (void)vboxSetHiddenUI 1201 { 1202 [self setHidden: YES]; 1503 { 1504 DEBUG_MSG(("no callout available on setVisible\n")); 1505 NSNumber* pVisObj = [NSNumber numberWithBool:fVisible]; 1506 [pVisObj retain]; 1507 [self performSelectorOnMainThread:@selector(vboxSetVisibleUIObj:) withObject:pVisObj waitUntilDone:NO]; 1508 } 1509 DEBUG_FUNC_LEAVE(); 1510 } 1511 1512 - (void)vboxSetVisibleUI:(GLboolean)fVisible 1513 { 1514 DEBUG_FUNC_ENTER(); 1515 [self setHidden: !fVisible]; 1516 DEBUG_FUNC_LEAVE(); 1517 } 1518 1519 - (void)vboxSetVisibleUIObj:(NSNumber*)pVisible 1520 { 1521 DEBUG_FUNC_ENTER(); 1522 BOOL fVisible = [pVisible boolValue]; 1523 [self vboxSetVisibleUI:fVisible]; 1524 [pVisible release]; 1525 DEBUG_FUNC_LEAVE(); 1526 } 1527 1528 typedef struct CR_RCD_REPARENT 1529 { 1530 OverlayView *pView; 1531 NSView *pParent; 1532 } CR_RCD_REPARENT; 1533 1534 static DECLCALLBACK(void) vboxRcdReparent(void *pvCb) 1535 { 1536 DEBUG_FUNC_ENTER(); 1537 CR_RCD_REPARENT * pReparent = (CR_RCD_REPARENT*)pvCb; 1538 [pReparent->pView vboxReparentUI:pReparent->pParent]; 1539 DEBUG_FUNC_LEAVE(); 1540 } 1541 1542 - (void)vboxReparent:(NSView*)pParentView 1543 { 1544 DEBUG_FUNC_ENTER(); 1545 [pParentView retain]; 1546 if (renderspuCalloutAvailable()) 1547 { 1548 CR_RCD_REPARENT Reparent; 1549 Reparent.pView = self; 1550 Reparent.pParent = pParentView; 1551 renderspuCalloutClient(vboxRcdReparent, &Reparent); 1552 } 1553 else 1554 { 1555 DEBUG_MSG(("no callout available on reparent %p %p\n", self, pParentView)); 1556 [self performSelectorOnMainThread:@selector(vboxReparentUI:) withObject:pParentView waitUntilDone:NO]; 1557 } 1558 DEBUG_FUNC_LEAVE(); 1559 } 1560 1561 - (void)vboxReparentUI:(NSView*)pParentView 1562 { 1563 DEBUG_FUNC_ENTER(); 1564 /* Make sure the window is removed from any previous parent window. */ 1565 if ([[self overlayWin] parentWindow] != nil) 1566 { 1567 [[[self overlayWin] parentWindow] removeChildWindow:[self overlayWin]]; 1568 } 1569 1570 /* Set the new parent view */ 1571 [self setParentView: pParentView]; 1572 1573 /* Add the overlay window as a child to the new parent window */ 1574 if (pParentView != nil) 1575 { 1576 [[pParentView window] addChildWindow:[self overlayWin] ordered:NSWindowAbove]; 1577 if ([self isEverSized]) 1578 [self vboxReshapeOnReparentPerform]; 1579 } 1580 1581 [pParentView release]; 1582 1583 DEBUG_FUNC_LEAVE(); 1203 1584 } 1204 1585 … … 1274 1655 - (void)swapFBO 1275 1656 { 1657 DEBUG_FUNC_ENTER(); 1276 1658 [m_pGLCtx flushBuffer]; 1659 DEBUG_FUNC_LEAVE(); 1277 1660 } 1278 1661 … … 1596 1979 - (void)clearVisibleRegions 1597 1980 { 1981 DEBUG_FUNC_ENTER(); 1598 1982 if(m_paClipRects) 1599 1983 { … … 1602 1986 } 1603 1987 m_cClipRects = 0; 1988 DEBUG_FUNC_LEAVE(); 1604 1989 } 1605 1990 … … 1617 2002 - (void)setVisibleRegions:(GLint)cRects paRects:(const GLint*)paRects 1618 2003 { 2004 DEBUG_FUNC_ENTER(); 1619 2005 GLint cOldRects = m_cClipRects; 1620 2006 … … 1635 2021 memcpy(m_paClipRects, paRects, sizeof(GLint) * 4 * cRects); 1636 2022 } 2023 2024 DEBUG_FUNC_LEAVE(); 1637 2025 } 1638 2026 1639 2027 - (NSView*)dockTileScreen 1640 2028 { 2029 DEBUG_FUNC_ENTER(); 1641 2030 NSView *contentView = [[[NSApplication sharedApplication] dockTile] contentView]; 1642 2031 NSView *screenContent = nil; … … 1648 2037 else if ([contentView respondsToSelector:@selector(screenContent)]) 1649 2038 screenContent = [contentView performSelector:@selector(screenContent)]; 2039 2040 DEBUG_FUNC_LEAVE(); 1650 2041 return screenContent; 1651 2042 } … … 1653 2044 - (void)reshapeDockTile 1654 2045 { 2046 DEBUG_FUNC_ENTER(); 1655 2047 NSRect newFrame = NSZeroRect; 1656 2048 … … 1672 2064 [m_DockTileView setFrame: newFrame]; 1673 2065 } 2066 DEBUG_FUNC_LEAVE(); 1674 2067 } 1675 2068 … … 1683 2076 void cocoaGLCtxCreate(NativeNSOpenGLContextRef *ppCtx, GLbitfield fVisParams, NativeNSOpenGLContextRef pSharedCtx) 1684 2077 { 2078 DEBUG_FUNC_ENTER(); 1685 2079 NSOpenGLPixelFormat *pFmt = nil; 1686 2080 … … 1766 2160 1767 2161 [pPool release]; 2162 2163 DEBUG_FUNC_LEAVE(); 1768 2164 } 1769 2165 1770 2166 void cocoaGLCtxDestroy(NativeNSOpenGLContextRef pCtx) 1771 2167 { 2168 DEBUG_FUNC_ENTER(); 1772 2169 NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init]; 1773 2170 … … 1776 2173 1777 2174 [pPool release]; 2175 DEBUG_FUNC_LEAVE(); 1778 2176 } 1779 2177 … … 1783 2181 * 1784 2182 ********************************************************************************/ 1785 void cocoaViewCreate(NativeNSViewRef *ppView, WindowInfo *pWinInfo, NativeNSViewRef pParentView, GLbitfield fVisParams) 1786 { 1787 NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init]; 1788 2183 typedef struct CR_RCD_CREATEVIEW 2184 { 2185 WindowInfo *pWinInfo; 2186 NSView *pParentView; 2187 GLbitfield fVisParams; 2188 /* out */ 2189 OverlayView *pView; 2190 } CR_RCD_CREATEVIEW; 2191 2192 static OverlayView * vboxViewCreate(WindowInfo *pWinInfo, NativeNSViewRef pParentView, GLbitfield fVisParams) 2193 { 2194 DEBUG_FUNC_ENTER(); 1789 2195 /* Create our worker view */ 1790 2196 OverlayView* pView = [[OverlayView alloc] initWithFrame:NSZeroRect thread:RTThreadSelf() parentView:pParentView winInfo:pWinInfo]; … … 1795 2201 [[OverlayWindow alloc] initWithParentView:pParentView overlayView:pView]; 1796 2202 /* Return the freshly created overlay view */ 1797 *ppView = pView; 1798 } 1799 2203 DEBUG_FUNC_LEAVE(); 2204 return pView; 2205 } 2206 2207 DEBUG_FUNC_LEAVE(); 2208 return NULL; 2209 } 2210 2211 static DECLCALLBACK(void) vboxRcdCreateView(void *pvCb) 2212 { 2213 DEBUG_FUNC_ENTER(); 2214 CR_RCD_CREATEVIEW * pCreateView = (CR_RCD_CREATEVIEW*)pvCb; 2215 pCreateView->pView = vboxViewCreate(pCreateView->pWinInfo, pCreateView->pParentView, pCreateView->fVisParams); 2216 DEBUG_FUNC_LEAVE(); 2217 } 2218 2219 void cocoaViewCreate(NativeNSViewRef *ppView, WindowInfo *pWinInfo, NativeNSViewRef pParentView, GLbitfield fVisParams) 2220 { 2221 DEBUG_FUNC_ENTER(); 2222 NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init]; 2223 2224 if (renderspuCalloutAvailable()) 2225 { 2226 CR_RCD_CREATEVIEW CreateView; 2227 CreateView.pWinInfo = pWinInfo; 2228 CreateView.pParentView = pParentView; 2229 CreateView.fVisParams = fVisParams; 2230 CreateView.pView = NULL; 2231 renderspuCalloutClient(vboxRcdCreateView, &CreateView); 2232 *ppView = CreateView.pView; 2233 } 2234 else 2235 { 2236 DEBUG_MSG(("no callout available on createWindow\n")); 2237 #if 0 2238 dispatch_sync(dispatch_get_main_queue(), ^{ 2239 #endif 2240 *ppView = vboxViewCreate(pWinInfo, pParentView, fVisParams); 2241 #if 0 2242 }); 2243 #endif 2244 } 2245 1800 2246 [pPool release]; 2247 2248 DEBUG_FUNC_LEAVE(); 1801 2249 } 1802 2250 1803 2251 void cocoaViewReparent(NativeNSViewRef pView, NativeNSViewRef pParentView) 1804 2252 { 2253 DEBUG_FUNC_ENTER(); 1805 2254 NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init]; 1806 2255 … … 1809 2258 if (pOView) 1810 2259 { 1811 /* Make sure the window is removed from any previous parent window. */ 1812 if ([[pOView overlayWin] parentWindow] != nil) 1813 { 1814 [[[pOView overlayWin] parentWindow] removeChildWindow:[pOView overlayWin]]; 1815 } 1816 1817 /* Set the new parent view */ 1818 [pOView setParentView: pParentView]; 1819 1820 /* Add the overlay window as a child to the new parent window */ 1821 if (pParentView != nil) 1822 { 1823 [[pParentView window] addChildWindow:[pOView overlayWin] ordered:NSWindowAbove]; 1824 if ([pOView isEverSized]) 1825 [pOView performSelectorOnMainThread:@selector(vboxReshapeOnReparentPerform) withObject:nil waitUntilDone:NO]; 1826 } 2260 [pOView vboxReparent:pParentView]; 1827 2261 } 1828 2262 1829 2263 [pPool release]; 2264 2265 DEBUG_FUNC_LEAVE(); 2266 } 2267 2268 typedef struct CR_RCD_DESTROYVIEW 2269 { 2270 OverlayView *pView; 2271 } CR_RCD_DESTROYVIEW; 2272 2273 static DECLCALLBACK(void) vboxRcdDestroyView(void *pvCb) 2274 { 2275 DEBUG_FUNC_ENTER(); 2276 CR_RCD_DESTROYVIEW * pDestroyView = (CR_RCD_DESTROYVIEW*)pvCb; 2277 [pDestroyView->pView vboxDestroy]; 2278 DEBUG_FUNC_LEAVE(); 1830 2279 } 1831 2280 1832 2281 void cocoaViewDestroy(NativeNSViewRef pView) 1833 2282 { 1834 NSWindow *pWin = nil; 1835 2283 DEBUG_FUNC_ENTER(); 1836 2284 NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init]; 1837 2285 1838 /* Hide the view early */ 1839 [pView setHidden: YES]; 1840 1841 pWin = [pView window]; 1842 [[NSNotificationCenter defaultCenter] removeObserver:pWin]; 1843 [pWin setContentView: nil]; 1844 [[pWin parentWindow] removeChildWindow: pWin]; 1845 1846 /* 1847 a = [pWin retainCount]; 1848 for (; a > 1; --a) 1849 [pWin performSelector:@selector(release)] 1850 */ 1851 /* We can NOT run synchronously with the main thread since this may lead to a deadlock, 1852 caused by main thread waiting xpcom thread, xpcom thread waiting to main hgcm thread, 1853 and main hgcm thread waiting for us, this is why use waitUntilDone:NO, 1854 which should cause no harm */ 1855 [pWin performSelectorOnMainThread:@selector(release) withObject:nil waitUntilDone:NO]; 1856 /* 1857 [pWin release]; 1858 */ 1859 1860 /* We can NOT run synchronously with the main thread since this may lead to a deadlock, 1861 caused by main thread waiting xpcom thread, xpcom thread waiting to main hgcm thread, 1862 and main hgcm thread waiting for us, this is why use waitUntilDone:NO. 1863 We need to avoid concurrency though, so we cleanup some data right away via a cleanupData call */ 1864 [(OverlayView*)pView cleanupData]; 1865 1866 /* There seems to be a bug in the performSelector method which is called in 1867 * parentWindowChanged above. The object is retained but not released. This 1868 * results in an unbalanced reference count, which is here manually 1869 * decremented. */ 1870 /* 1871 a = [pView retainCount]; 1872 for (; a > 1; --a) 1873 */ 1874 [pView performSelectorOnMainThread:@selector(release) withObject:nil waitUntilDone:NO]; 1875 /* 1876 [pView release]; 1877 */ 2286 if (renderspuCalloutAvailable()) 2287 { 2288 CR_RCD_DESTROYVIEW DestroyView; 2289 DestroyView.pView = (OverlayView*)pView; 2290 renderspuCalloutClient(vboxRcdDestroyView, &DestroyView); 2291 } 2292 else 2293 { 2294 DEBUG_MSG(("no callout available on destroyView\n")); 2295 [(OverlayView*)pView performSelectorOnMainThread:@selector(vboxDestroy) withObject:nil waitUntilDone:NO]; 2296 } 1878 2297 1879 2298 [pPool release]; 2299 DEBUG_FUNC_LEAVE(); 1880 2300 } 1881 2301 1882 2302 void cocoaViewShow(NativeNSViewRef pView, GLboolean fShowIt) 1883 2303 { 2304 DEBUG_FUNC_ENTER(); 1884 2305 NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init]; 1885 2306 1886 [ pView vboxSubmitVisible:fShowIt];2307 [(OverlayView*)pView vboxSetVisible:fShowIt]; 1887 2308 1888 2309 [pPool release]; 2310 DEBUG_FUNC_LEAVE(); 1889 2311 } 1890 2312 1891 2313 void cocoaViewDisplay(NativeNSViewRef pView) 1892 2314 { 2315 DEBUG_FUNC_ENTER(); 1893 2316 NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init]; 1894 2317 2318 DEBUG_WARN(("cocoaViewDisplay should never happen!\n")); 1895 2319 DEBUG_MSG_1(("cocoaViewDisplay %p\n", (void*)pView)); 1896 2320 [(OverlayView*)pView swapFBO]; 1897 2321 1898 2322 [pPool release]; 1899 2323 2324 DEBUG_FUNC_LEAVE(); 1900 2325 } 1901 2326 1902 2327 void cocoaViewSetPosition(NativeNSViewRef pView, NativeNSViewRef pParentView, int x, int y) 1903 2328 { 2329 DEBUG_FUNC_ENTER(); 1904 2330 NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init]; 1905 2331 1906 [(OverlayView*)pView setPos:NSMakePoint(x, y)];2332 [(OverlayView*)pView vboxSetPos:NSMakePoint(x, y)]; 1907 2333 1908 2334 [pPool release]; 2335 2336 DEBUG_FUNC_LEAVE(); 1909 2337 } 1910 2338 1911 2339 void cocoaViewSetSize(NativeNSViewRef pView, int w, int h) 1912 2340 { 2341 DEBUG_FUNC_ENTER(); 1913 2342 NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init]; 1914 2343 1915 [(OverlayView*)pView setSize:NSMakeSize(w, h)];2344 [(OverlayView*)pView vboxSetSize:NSMakeSize(w, h)]; 1916 2345 1917 2346 [pPool release]; 2347 2348 DEBUG_FUNC_LEAVE(); 2349 } 2350 2351 typedef struct CR_RCD_GETGEOMETRY 2352 { 2353 OverlayView *pView; 2354 NSRect rect; 2355 } CR_RCD_GETGEOMETRY; 2356 2357 static DECLCALLBACK(void) vboxRcdGetGeomerty(void *pvCb) 2358 { 2359 DEBUG_FUNC_ENTER(); 2360 CR_RCD_GETGEOMETRY * pGetGeometry = (CR_RCD_GETGEOMETRY*)pvCb; 2361 pGetGeometry->rect = [[pGetGeometry->pView window] frame]; 2362 DEBUG_FUNC_LEAVE(); 1918 2363 } 1919 2364 1920 2365 void cocoaViewGetGeometry(NativeNSViewRef pView, int *pX, int *pY, int *pW, int *pH) 1921 2366 { 2367 DEBUG_FUNC_ENTER(); 1922 2368 NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init]; 1923 2369 1924 NSRect frame = [[pView window] frame]; 2370 NSRect frame; 2371 2372 if (renderspuCalloutAvailable()) 2373 { 2374 CR_RCD_GETGEOMETRY GetGeometry; 2375 GetGeometry.pView = (OverlayView*)pView; 2376 renderspuCalloutClient(vboxRcdGetGeomerty, &GetGeometry); 2377 frame = GetGeometry.rect; 2378 } 2379 else 2380 { 2381 DEBUG_MSG(("no callout available on getGeometry\n")); 2382 frame = [[pView window] frame]; 2383 } 2384 1925 2385 *pX = frame.origin.x; 1926 2386 *pY = frame.origin.y; … … 1929 2389 1930 2390 [pPool release]; 2391 2392 DEBUG_FUNC_LEAVE(); 1931 2393 } 1932 2394 1933 2395 void cocoaViewPresentComposition(NativeNSViewRef pView, const struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry) 1934 2396 { 2397 DEBUG_FUNC_ENTER(); 1935 2398 NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init]; 1936 2399 NSOpenGLContext *pCtx; … … 1946 2409 1947 2410 [pPool release]; 2411 DEBUG_FUNC_LEAVE(); 1948 2412 return; 1949 2413 } … … 1957 2421 1958 2422 [pPool release]; 2423 2424 DEBUG_FUNC_LEAVE(); 1959 2425 } 1960 2426 1961 2427 void cocoaViewMakeCurrentContext(NativeNSViewRef pView, NativeNSOpenGLContextRef pCtx) 1962 2428 { 2429 DEBUG_FUNC_ENTER(); 1963 2430 NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init]; 1964 2431 … … 1976 2443 1977 2444 [pPool release]; 2445 2446 DEBUG_FUNC_LEAVE(); 1978 2447 } 1979 2448 1980 2449 GLboolean cocoaViewNeedsEmptyPresent(NativeNSViewRef pView) 1981 2450 { 2451 DEBUG_FUNC_ENTER(); 2452 1982 2453 NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init]; 1983 2454 … … 1986 2457 [pPool release]; 1987 2458 2459 DEBUG_FUNC_LEAVE(); 2460 1988 2461 return fNeedsPresent; 1989 2462 } … … 1991 2464 void cocoaViewSetVisibleRegion(NativeNSViewRef pView, GLint cRects, const GLint* paRects) 1992 2465 { 2466 DEBUG_FUNC_ENTER(); 1993 2467 NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init]; 1994 2468 … … 1996 2470 1997 2471 [pPool release]; 1998 } 2472 2473 DEBUG_FUNC_LEAVE(); 2474 }
Note:
See TracChangeset
for help on using the changeset viewer.