Changeset 47599 in vbox for trunk/src/VBox/HostServices/SharedOpenGL/crserverlib
- Timestamp:
- Aug 7, 2013 6:02:07 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
r47577 r47599 115 115 GLint crServerMuralInit(CRMuralInfo *mural, const char *dpyName, GLint visBits, GLint preloadWinID, GLboolean fUseDefaultDEntry); 116 116 void crServerMuralTerm(CRMuralInfo *mural); 117 voidcrServerMuralSize(CRMuralInfo *mural, GLint width, GLint height);118 void crServerMu talPosition(CRMuralInfo *mural, GLint x, GLinty);117 GLboolean crServerMuralSize(CRMuralInfo *mural, GLint width, GLint height); 118 void crServerMuralPosition(CRMuralInfo *mural, GLint x, GLint y, GLboolean fSkipCheckGeometry); 119 119 void crServerMuralVisibleRegion( CRMuralInfo *mural, GLint cRects, const GLint *pRects ); 120 120 void crServerMuralShow( CRMuralInfo *mural, GLint state ); … … 141 141 void crServerWindowShow(CRMuralInfo *pMural); 142 142 void crServerWindowVisibleRegion(CRMuralInfo *pMural); 143 void crServerWindowReparent(CRMuralInfo *pMural); 143 144 144 145 void crServerWindowSetIsVisible(CRMuralInfo *pMural, GLboolean fIsVisible); … … 415 416 int CrDpLoadState(PCR_DISPLAY pDisplay, PSSMHANDLE pSSM, uint32_t version); 416 417 418 void CrDpReparent(PCR_DISPLAY pDisplay, CRScreenInfo *pScreen); 419 417 420 void CrDpResize(PCR_DISPLAY pDisplay, int32_t xPos, int32_t yPos, uint32_t width, uint32_t height); 418 421 void CrDpEntryInit(PCR_DISPLAY_ENTRY pEntry, const VBOXVR_TEXTURE *pTextureData); -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c
r47577 r47599 2701 2701 if (pMI->screenId == *sIndex) 2702 2702 { 2703 crServerVBoxCompositionDisableEnter(pMI); 2704 2705 pMI->fHasParentWindow = !!cr_server.screen[pMI->screenId].winID; 2706 2707 renderspuReparentWindow(pMI->spuWindow); 2708 2709 crServerVBoxCompositionDisableLeave(pMI, GL_FALSE); 2703 crServerWindowReparent(pMI); 2710 2704 } 2711 2705 } … … 2753 2747 if (MAPPED(SCREEN(sIndex))) 2754 2748 { 2749 PCR_DISPLAY pDisplay = crServerDisplayGetInitialized(sIndex); 2750 2755 2751 SCREEN(sIndex).winID = 0; 2756 2752 renderspuSetWindowId(0); … … 2759 2755 2760 2756 crHashtableWalk(cr_server.dummyMuralTable, crVBoxServerReparentMuralCB, &sIndex); 2757 2758 if (pDisplay) 2759 CrDpReparent(pDisplay, &SCREEN(sIndex)); 2761 2760 } 2762 2761 … … 2831 2830 PCR_DISPLAY pDisplay = crServerDisplayGetInitialized(sIndex); 2832 2831 if (pDisplay) 2833 CrDpRe size(pDisplay, x, y, w, h);2832 CrDpReparent(pDisplay, &SCREEN(sIndex)); 2834 2833 } 2835 2834 … … 3036 3035 3037 3036 /* no need to do anything here actually */ 3037 } 3038 3039 if (fPosChanged || fSizeChanged) 3040 { 3041 PCR_DISPLAY pDisplay = crServerDisplayGetInitialized(sIndex); 3042 if (pDisplay) 3043 CrDpResize(pDisplay, SCREEN(sIndex).x, SCREEN(sIndex).y, SCREEN(sIndex).w, SCREEN(sIndex).h); 3038 3044 } 3039 3045 return VINF_SUCCESS; -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_muralfbo.c
r47577 r47599 762 762 void crServerVBoxCompositionDisableLeave(CRMuralInfo *mural, GLboolean fForcePresentOnEnabled) 763 763 { 764 mural->fForcePresentState = fForcePresentOnEnabled;764 mural->fForcePresentState |= fForcePresentOnEnabled; 765 765 --mural->cDisabled; 766 766 Assert(mural->cDisabled < UINT32_MAX/2); … … 788 788 DECLEXPORT(void) crServerVBoxCompositionSetEnableStateGlobal(GLboolean fEnable) 789 789 { 790 int i; 791 790 792 crHashtableWalk(cr_server.muralTable, crServerVBoxCompositionSetEnableStateGlobalCB, (void*)(uintptr_t)fEnable); 791 793 792 794 crHashtableWalk(cr_server.dummyMuralTable, crServerVBoxCompositionSetEnableStateGlobalCB, (void*)(uintptr_t)fEnable); 795 796 for (i = 0; i < cr_server.screenCount; ++i) 797 { 798 PCR_DISPLAY pDisplay = crServerDisplayGetInitialized((uint32_t)i); 799 if (!pDisplay) 800 continue; 801 802 if (!fEnable) 803 CrDpEnter(pDisplay); 804 else 805 CrDpLeave(pDisplay); 806 } 793 807 } 794 808 -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_presenter.cpp
r47566 r47599 34 34 #include <iprt/memcache.h> 35 35 36 #include "render/renderspu.h" 36 37 37 38 /* DISPLAY */ … … 70 71 return VERR_GENERAL_FAILURE; 71 72 } 73 74 crServerMuralVisibleRegion(&pDisplay->Mural, 0, NULL); 75 crServerMuralShow(&pDisplay->Mural, GL_TRUE); 76 72 77 pDisplay->fForcePresent = GL_FALSE; 73 78 return VINF_SUCCESS; … … 81 86 void CrDpResize(PCR_DISPLAY pDisplay, int32_t xPos, int32_t yPos, uint32_t width, uint32_t height) 82 87 { 83 crServerMuralVisibleRegion(&pDisplay->Mural, 0, NULL); 84 crServerMutalPosition(&pDisplay->Mural, xPos, yPos); 85 crServerMuralSize(&pDisplay->Mural, width, height); 86 crServerMuralShow(&pDisplay->Mural, GL_TRUE); 87 CrVrScrCompositorSetStretching(&pDisplay->Mural.Compositor, 1., 1.); 88 } 88 if (xPos != pDisplay->Mural.gX 89 || yPos != pDisplay->Mural.gY 90 || width != pDisplay->Mural.width 91 || height != pDisplay->Mural.height) 92 { 93 crServerMuralPosition(&pDisplay->Mural, xPos, yPos, GL_TRUE); 94 if (!crServerMuralSize(&pDisplay->Mural, width, height)) 95 crServerCheckMuralGeometry(&pDisplay->Mural); 96 } 97 else 98 crServerCheckMuralGeometry(&pDisplay->Mural); 99 } 100 101 void CrDpReparent(PCR_DISPLAY pDisplay, CRScreenInfo *pScreen) 102 { 103 renderspuSetWindowId(pScreen->winID); 104 crServerWindowReparent(&pDisplay->Mural); 105 renderspuSetWindowId(cr_server.screen[0].winID); 106 107 CrDpResize(pDisplay, pScreen->x, pScreen->y, pScreen->w, pScreen->h); 108 } 109 89 110 90 111 int CrDpSaveState(PCR_DISPLAY pDisplay, PSSMHANDLE pSSM) … … 270 291 void CrDpEnter(PCR_DISPLAY pDisplay) 271 292 { 272 pDisplay->fForcePresent = crServerVBoxCompositionPresentNeeded(&pDisplay->Mural);293 pDisplay->fForcePresent |= crServerVBoxCompositionPresentNeeded(&pDisplay->Mural); 273 294 crServerVBoxCompositionDisableEnter(&pDisplay->Mural); 274 295 } … … 278 299 pDisplay->Mural.fDataPresented = GL_TRUE; 279 300 crServerVBoxCompositionDisableLeave(&pDisplay->Mural, pDisplay->fForcePresent); 301 pDisplay->fForcePresent = GL_FALSE; 280 302 } 281 303 … … 503 525 PCR_DISPLAY crServerDisplayGetInitialized(uint32_t idScreen) 504 526 { 505 if (ASMBitTest(cr_server.DisplaysInitMap, idScreen))506 return &cr_server.aDispplays[idScreen];507 return NULL;508 }509 510 static PCR_DISPLAY crServerDisplayGet(uint32_t idScreen)511 {512 527 if (idScreen >= CR_MAX_GUEST_MONITORS) 513 528 { … … 517 532 518 533 if (ASMBitTest(cr_server.DisplaysInitMap, idScreen)) 534 { 535 Assert(cr_server.aDispplays[idScreen].Mural.screenId == idScreen); 519 536 return &cr_server.aDispplays[idScreen]; 537 } 538 return NULL; 539 } 540 541 static PCR_DISPLAY crServerDisplayGet(uint32_t idScreen) 542 { 543 if (idScreen >= CR_MAX_GUEST_MONITORS) 544 { 545 crWarning("invalid idScreen %d", idScreen); 546 return NULL; 547 } 548 549 if (ASMBitTest(cr_server.DisplaysInitMap, idScreen)) 550 { 551 Assert(cr_server.aDispplays[idScreen].Mural.screenId == idScreen); 552 return &cr_server.aDispplays[idScreen]; 553 } 520 554 521 555 int rc = CrDpInit(&cr_server.aDispplays[idScreen]); … … 549 583 AssertRCReturn(rc, rc); 550 584 585 if (!cDisplays) 586 return VINF_SUCCESS; 587 588 rc = SSMR3PutS32(pSSM, cr_server.screenCount); 589 AssertRCReturn(rc, rc); 590 591 for (i = 0; i < cr_server.screenCount; ++i) 592 { 593 rc = SSMR3PutS32(pSSM, cr_server.screen[i].x); 594 AssertRCReturn(rc, rc); 595 596 rc = SSMR3PutS32(pSSM, cr_server.screen[i].y); 597 AssertRCReturn(rc, rc); 598 599 rc = SSMR3PutU32(pSSM, cr_server.screen[i].w); 600 AssertRCReturn(rc, rc); 601 602 rc = SSMR3PutU32(pSSM, cr_server.screen[i].h); 603 AssertRCReturn(rc, rc); 604 } 605 551 606 for (i = 0; i < cr_server.screenCount; ++i) 552 607 { … … 567 622 { 568 623 int rc; 569 int s32, i;570 571 rc = SSMR3GetS32(pSSM, & s32);624 int cDisplays, screenCount, i; 625 626 rc = SSMR3GetS32(pSSM, &cDisplays); 572 627 AssertRCReturn(rc, rc); 573 628 574 for (i = 0; i < s32; ++i) 629 if (!cDisplays) 630 return VINF_SUCCESS; 631 632 rc = SSMR3GetS32(pSSM, &screenCount); 633 AssertRCReturn(rc, rc); 634 635 CRASSERT(screenCount == cr_server.screenCount); 636 637 crServerVBoxCompositionSetEnableStateGlobal(GL_FALSE); 638 639 for (i = 0; i < cr_server.screenCount; ++i) 640 { 641 int32_t x, y; 642 uint32_t w, h; 643 rc = SSMR3GetS32(pSSM, &x); 644 AssertRCReturn(rc, rc); 645 646 rc = SSMR3GetS32(pSSM, &y); 647 AssertRCReturn(rc, rc); 648 649 rc = SSMR3GetU32(pSSM, &w); 650 AssertRCReturn(rc, rc); 651 652 rc = SSMR3GetU32(pSSM, &h); 653 AssertRCReturn(rc, rc); 654 655 rc = crVBoxServerMapScreen(i, x, y, w, h, cr_server.screen[i].winID); 656 AssertRCReturn(rc, rc); 657 } 658 659 crServerVBoxCompositionSetEnableStateGlobal(GL_TRUE); 660 661 for (i = 0; i < cDisplays; ++i) 575 662 { 576 663 int iScreen; … … 716 803 { 717 804 uint32_t idScreen = CR_PRESENT_GET_SCREEN(cfg); 718 PCR_DISPLAY pDisplay = crServerDisplayGet(idScreen); 719 if (!pDisplay) 720 { 721 crWarning("crServerDisplayGet Failed"); 805 if (idScreen >= CR_MAX_GUEST_MONITORS) 806 { 807 crWarning("Invalid guest screen"); 722 808 return; 723 809 } 724 810 811 PCR_DISPLAY pDisplay; 725 812 PCR_DISPLAY_ENTRY pEntry = NULL; 813 726 814 if (texture) 727 815 { … … 730 818 { 731 819 crWarning("CrDemEntryAcquire Failed"); 820 return; 821 } 822 823 pDisplay = crServerDisplayGet(idScreen); 824 if (!pDisplay) 825 { 826 crWarning("crServerDisplayGet Failed"); 827 return; 828 } 829 } 830 else 831 { 832 pDisplay = crServerDisplayGetInitialized(idScreen); 833 if (!pDisplay) 834 { 835 /* no display initialized, and nothing to present */ 732 836 return; 733 837 }
Note:
See TracChangeset
for help on using the changeset viewer.