Changeset 45940 in vbox for trunk/src/VBox/HostServices/SharedOpenGL
- Timestamp:
- May 7, 2013 8:16:31 PM (12 years ago)
- Location:
- trunk/src/VBox/HostServices/SharedOpenGL
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedOpenGL/crserver/crservice.cpp
r45148 r45940 244 244 return rc; 245 245 } 246 247 static DECLCALLBACK(void) svcNotifyEventCB(int32_t screenId, uint32_t uEvent, void*pvData) 248 { 249 ComPtr<IDisplay> pDisplay; 250 ComPtr<IFramebuffer> pFramebuffer; 251 LONG xo, yo; 252 LONG64 winId = 0; 253 ULONG monitorCount, i, w, h; 254 255 if (!g_pConsole) 256 { 257 crWarning("Console not defined!"); 258 return; 259 } 260 261 CHECK_ERROR2_STMT(g_pConsole, COMGETTER(Display)(pDisplay.asOutParam()), return); 262 263 CHECK_ERROR2_STMT(pDisplay, GetFramebuffer(screenId, pFramebuffer.asOutParam(), &xo, &yo), return); 264 265 if (!pFramebuffer) 266 return; 267 268 CHECK_ERROR2_STMT(pFramebuffer, Notify3DEvent(VBOX3D_NOTIFY_EVENT_TYPE_VISIBLE_WINDOW, NULL), return); 269 } 270 246 271 247 272 static DECLCALLBACK(int) svcUnload (void *) … … 1281 1306 1282 1307 rc = svcPresentFBOInit(); 1308 1309 crServerVBoxSetNotifyEventCB(svcNotifyEventCB); 1283 1310 } 1284 1311 } -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server.h
r45386 r45940 129 129 void crServerCheckMuralGeometry(CRMuralInfo *mural); 130 130 GLboolean crServerSupportRedirMuralFBO(void); 131 132 void crVBoxServerNotifyEvent(int32_t idScreen); 131 133 132 134 #define CR_SERVER_REDIR_F_NONE 0x00 -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_config.c
r45577 r45940 58 58 cr_server.bUseOutputRedirect = GL_FALSE; 59 59 cr_server.bWindowsInitiallyHidden = GL_FALSE; 60 61 memset(cr_server.NotifyEventMap, 0, sizeof (cr_server.NotifyEventMap)); 62 cr_server.cDisableEvent = 0; 63 cr_server.pfnNotifyEventCB = NULL; 60 64 } 61 65 -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c
r45635 r45940 2574 2574 #define MAPPED(screen) ((screen).winID != 0) 2575 2575 2576 extern DECLEXPORT(void) crServerVBoxSetNotifyEventCB(PFNCRSERVERNOTIFYEVENT pfnCb) 2577 { 2578 cr_server.pfnNotifyEventCB = pfnCb; 2579 } 2580 2581 void crVBoxServerNotifyEvent(int32_t idScreen) 2582 { 2583 /* this is something unexpected, but just in case */ 2584 if (idScreen >= cr_server.screenCount) 2585 { 2586 crWarning("invalid screen id %d", idScreen); 2587 return; 2588 } 2589 2590 if (!cr_server.cDisableEvent) 2591 cr_server.pfnNotifyEventCB(idScreen, VBOX3D_NOTIFY_EVENT_TYPE_VISIBLE_WINDOW, NULL); 2592 else 2593 ASMBitSet(cr_server.NotifyEventMap, idScreen); 2594 } 2595 2576 2596 static void crVBoxServerReparentMuralCB(unsigned long key, void *data1, void *data2) 2577 2597 { … … 2586 2606 2587 2607 renderspuReparentWindow(pMI->spuWindow); 2608 2609 if (pMI->bVisible && (pMI->fPresentMode & CR_SERVER_REDIR_F_DISPLAY)) 2610 crVBoxServerNotifyEvent(pMI->screenId); 2588 2611 2589 2612 crServerVBoxCompositionDisableLeave(pMI, GL_FALSE); … … 2722 2745 uint32_t cRects; 2723 2746 const RTRECT *pRects; 2724 int rc ;2747 int rc = VINF_SUCCESS; 2725 2748 2726 2749 fForcePresent = crServerVBoxCompositionPresentNeeded(pMI); -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_muralfbo.c
r45920 r45940 193 193 renderspuReparentWindow(mural->spuWindow); 194 194 renderspuSetWindowId(cr_server.screen[0].winID); 195 196 if (mural->bVisible && (mural->fPresentMode & CR_SERVER_REDIR_F_DISPLAY)) 197 crVBoxServerNotifyEvent(mural->screenId); 195 198 } 196 199 … … 349 352 { 350 353 if (mural->bVisible) 354 { 351 355 cr_server.head_spu->dispatch_table.WindowShow(mural->spuWindow, GL_TRUE); 356 crVBoxServerNotifyEvent(mural->screenId); 357 } 352 358 mural->fPresentMode |= CR_SERVER_REDIR_F_DISPLAY; 353 359 } … … 748 754 DECLEXPORT(void) crServerVBoxCompositionSetEnableStateGlobal(GLboolean fEnable) 749 755 { 756 if (!fEnable) 757 ++cr_server.cDisableEvent; 758 750 759 crHashtableWalk(cr_server.muralTable, crServerVBoxCompositionSetEnableStateGlobalCB, (void*)fEnable); 751 760 752 761 crHashtableWalk(cr_server.dummyMuralTable, crServerVBoxCompositionSetEnableStateGlobalCB, (void*)fEnable); 762 763 if (fEnable) 764 { 765 --cr_server.cDisableEvent; 766 CRASSERT(cr_server.cDisableEvent < UINT32_MAX/2); 767 if(!cr_server.cDisableEvent) 768 { 769 int i; 770 for (i = 0; i < cr_server.screenCount; ++i) 771 { 772 if (!ASMBitTest(cr_server.NotifyEventMap, i)) 773 continue; 774 775 cr_server.pfnNotifyEventCB(i, VBOX3D_NOTIFY_EVENT_TYPE_VISIBLE_WINDOW, NULL); 776 777 ASMBitClear(cr_server.NotifyEventMap, i); 778 } 779 } 780 } 753 781 } 754 782 … … 907 935 cr_serverCtxSwitchPostprocess(&CtxSwitch); 908 936 937 #if 1 909 938 if (RT_SUCCESS(rc)) 910 939 { … … 916 945 } 917 946 } 918 947 #endif 919 948 return; 920 949 } -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_window.c
r45636 r45940 807 807 { 808 808 cr_server.head_spu->dispatch_table.WindowShow(mural->spuWindow, state); 809 } 810 811 mural->bVisible = state; 809 810 if (state) 811 crVBoxServerNotifyEvent(mural->screenId); 812 } 813 814 mural->bVisible = !!state; 812 815 } 813 816
Note:
See TracChangeset
for help on using the changeset viewer.