VirtualBox

Ignore:
Timestamp:
Aug 7, 2013 10:13:47 AM (11 years ago)
Author:
vboxsync
Message:

crOpenGL: postpone event notification until data is presented (needed for OSX hosts)

Location:
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server.h

    r47566 r47577  
    134134
    135135void crVBoxServerNotifyEvent(int32_t idScreen, uint32_t uEvent, void*pvData);
     136void crVBoxServerCheckVisibilityEvent(int32_t idScreen);
     137
    136138void crServerDisplayTermAll();
    137139
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_config.c

    r47485 r47577  
    5959    cr_server.bWindowsInitiallyHidden = GL_FALSE;
    6060
    61     memset(cr_server.acVisibleWindows, 0, sizeof (cr_server.acVisibleWindows));
     61    cr_server.cDisableEvents = 0;
     62    memset(cr_server.aWinVisibilityInfos, 0, sizeof (cr_server.aWinVisibilityInfos));
    6263
    6364    cr_server.pfnNotifyEventCB = NULL;
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c

    r47566 r47577  
    26662666}
    26672667
     2668void crVBoxServerCheckVisibilityEvent(int32_t idScreen)
     2669{
     2670    if (cr_server.cDisableEvents)
     2671        return;
     2672
     2673    if (idScreen < 0)
     2674    {
     2675        int32_t i = 0;
     2676        for (; i < cr_server.screenCount; ++i)
     2677        {
     2678            crVBoxServerCheckVisibilityEvent(i);
     2679        }
     2680        return;
     2681    }
     2682
     2683    CRASSERT(idScreen < cr_server.screenCount);
     2684
     2685    if (!cr_server.aWinVisibilityInfos[idScreen].cVisibleWindows == !cr_server.aWinVisibilityInfos[idScreen].fLastReportedVisible)
     2686        return;
     2687
     2688    crVBoxServerNotifyEvent(idScreen, VBOX3D_NOTIFY_EVENT_TYPE_VISIBLE_3DDATA,
     2689            cr_server.aWinVisibilityInfos[idScreen].cVisibleWindows ? (void*)1 : NULL);
     2690
     2691    cr_server.aWinVisibilityInfos[idScreen].fLastReportedVisible = cr_server.aWinVisibilityInfos[idScreen].cVisibleWindows ? 1 : 0;
     2692}
     2693
    26682694static void crVBoxServerReparentMuralCB(unsigned long key, void *data1, void *data2)
    26692695{
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_muralfbo.c

    r47485 r47577  
    749749void crServerVBoxCompositionDisableEnter(CRMuralInfo *mural)
    750750{
     751    ++cr_server.cDisableEvents;
     752    Assert(cr_server.cDisableEvents);
     753
    751754    ++mural->cDisabled;
    752755    Assert(mural->cDisabled);
     
    767770        mural->fForcePresentState = GL_FALSE;
    768771    }
     772
     773    --cr_server.cDisableEvents;
     774    Assert(cr_server.cDisableEvents < UINT32_MAX/2);
     775    crVBoxServerCheckVisibilityEvent(-1);
    769776}
    770777
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_window.c

    r47566 r47577  
    4141    pMural->fIsVisible = fIsVisible;
    4242
    43     CRASSERT(pMural->screenId < RT_ELEMENTS(cr_server.acVisibleWindows));
     43    CRASSERT(pMural->screenId < cr_server.screenCount);
    4444
    4545    if (fIsVisible)
    4646    {
    47         ++cr_server.acVisibleWindows[pMural->screenId];
    48         if (cr_server.acVisibleWindows[pMural->screenId] == 1)
    49             crVBoxServerNotifyEvent(pMural->screenId, VBOX3D_NOTIFY_EVENT_TYPE_VISIBLE_3DDATA, (void*)1);
     47        ++cr_server.aWinVisibilityInfos[pMural->screenId].cVisibleWindows;
    5048    }
    5149    else
    5250    {
    53         --cr_server.acVisibleWindows[pMural->screenId];
    54         CRASSERT(cr_server.acVisibleWindows[pMural->screenId] < UINT32_MAX/2);
    55         if (cr_server.acVisibleWindows[pMural->screenId] == 0)
    56             crVBoxServerNotifyEvent(pMural->screenId, VBOX3D_NOTIFY_EVENT_TYPE_VISIBLE_3DDATA, NULL);
    57     }
     51        --cr_server.aWinVisibilityInfos[pMural->screenId].cVisibleWindows;
     52        CRASSERT(cr_server.aWinVisibilityInfos[pMural->screenId].cVisibleWindows < UINT32_MAX/2);
     53    }
     54
     55    crVBoxServerCheckVisibilityEvent(pMural->screenId);
    5856}
    5957
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette