VirtualBox

Ignore:
Timestamp:
Mar 11, 2013 4:37:50 PM (12 years ago)
Author:
vboxsync
Message:

crOpenGL/win: fix redraw concurrency

Location:
trunk/src/VBox/HostServices/SharedOpenGL/render
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.c

    r44922 r44997  
    769769}
    770770
    771 int renderspuVBoxPresentBlitterEnter( PCR_BLITTER pBlitter )
     771int renderspuVBoxPresentBlitterEnter( PCR_BLITTER pBlitter, int32_t i32MakeCurrentUserData)
    772772{
    773773    int rc;
     
    785785    }
    786786
     787    CrBltSetMakeCurrentUserData(pBlitter, i32MakeCurrentUserData);
     788
    787789    rc = CrBltEnter(pBlitter, pCtxInfo, pWindowInfo);
    788790    if (!RT_SUCCESS(rc))
     
    794796}
    795797
    796 PCR_BLITTER renderspuVBoxPresentBlitterGetAndEnter( WindowInfo *window )
     798PCR_BLITTER renderspuVBoxPresentBlitterGetAndEnter( WindowInfo *window, int32_t i32MakeCurrentUserData )
    797799{
    798800    PCR_BLITTER pBlitter = renderspuVBoxPresentBlitterGet(window);
    799801    if (pBlitter)
    800802    {
    801         int rc = renderspuVBoxPresentBlitterEnter(pBlitter);
     803        int rc = renderspuVBoxPresentBlitterEnter(pBlitter, i32MakeCurrentUserData);
    802804        if (RT_SUCCESS(rc))
    803805        {
     
    808810}
    809811
    810 PCR_BLITTER renderspuVBoxPresentBlitterEnsureCreated( WindowInfo *window )
     812PCR_BLITTER renderspuVBoxPresentBlitterEnsureCreated( WindowInfo *window, int32_t i32MakeCurrentUserData )
    811813{
    812814    if (!window->pBlitter)
     
    823825                if (!CrBltIsEverEntered(pBlitter))
    824826                {
    825                     int rc = renderspuVBoxPresentBlitterEnter(pBlitter);
     827                    int rc = renderspuVBoxPresentBlitterEnter(pBlitter, i32MakeCurrentUserData);
    826828                    if (RT_SUCCESS(rc))
    827829                    {
     
    849851}
    850852
    851 void renderspuVBoxPresentCompositionGeneric( WindowInfo *window, struct VBOXVR_SCR_COMPOSITOR * pCompositor, struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry )
    852 {
    853     PCR_BLITTER pBlitter = renderspuVBoxPresentBlitterGetAndEnter(window);
     853void renderspuVBoxPresentCompositionGeneric( WindowInfo *window, struct VBOXVR_SCR_COMPOSITOR * pCompositor, struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry, int32_t i32MakeCurrentUserData )
     854{
     855    PCR_BLITTER pBlitter = renderspuVBoxPresentBlitterGetAndEnter(window, i32MakeCurrentUserData);
    854856    if (!pBlitter)
    855857        return;
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.h

    r44922 r44997  
    114114    HWND hWnd;
    115115    HDC device_context;
     116    HDC redraw_device_context;
    116117    HRGN hRgn;
    117118#elif defined(DARWIN)
     
    400401extern int renderspuVBoxCompositorTryAcquire(WindowInfo *window, struct VBOXVR_SCR_COMPOSITOR **ppCompositor);
    401402extern void renderspuVBoxCompositorRelease( WindowInfo *window);
    402 extern void renderspuVBoxPresentCompositionGeneric( WindowInfo *window, struct VBOXVR_SCR_COMPOSITOR * pCompositor, struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry );
     403extern void renderspuVBoxPresentCompositionGeneric( WindowInfo *window, struct VBOXVR_SCR_COMPOSITOR * pCompositor, struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry, int32_t i32MakeCurrentUserData );
    403404extern PCR_BLITTER renderspuVBoxPresentBlitterGet( WindowInfo *window );
    404405void renderspuVBoxPresentBlitterCleanup( WindowInfo *window );
    405 extern int renderspuVBoxPresentBlitterEnter( PCR_BLITTER pBlitter );
    406 extern PCR_BLITTER renderspuVBoxPresentBlitterGetAndEnter( WindowInfo *window );
    407 extern PCR_BLITTER renderspuVBoxPresentBlitterEnsureCreated( WindowInfo *window );
     406extern int renderspuVBoxPresentBlitterEnter( PCR_BLITTER pBlitter, int32_t i32MakeCurrentUserData );
     407extern PCR_BLITTER renderspuVBoxPresentBlitterGetAndEnter( WindowInfo *window, int32_t i32MakeCurrentUserData );
     408extern PCR_BLITTER renderspuVBoxPresentBlitterEnsureCreated( WindowInfo *window, int32_t i32MakeCurrentUserData );
    408409extern void renderspuWindowTerm( WindowInfo *window );
    409410extern GLboolean renderspuWindowInit( WindowInfo *window, VisualInfo *visual, GLboolean showIt, GLint id );
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_agl.c

    r44740 r44997  
    609609void renderspu_SystemVBoxPresentComposition( WindowInfo *window, struct VBOXVR_SCR_COMPOSITOR * pCompositor, struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry )
    610610{
    611     renderspuVBoxPresentCompositionGeneric(window, pCompositor, pChangedEntry);
     611    renderspuVBoxPresentCompositionGeneric(window, pCompositor, pChangedEntry, 0);
    612612}
    613613
     
    621621    CRASSERT(render_spu.ws.aglSetCurrentContext);
    622622    //crDebug( "renderspu_SystemMakeCurrent( %x, %i, %x )", window, nativeWindow, context );
     623
     624    nativeWindow = 0;
    623625
    624626    if(window && context)
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa.c

    r44784 r44997  
    162162/*        printf ("visual mismatch .....................\n");*/
    163163
     164    nativeWindow = 0;
     165
    164166    if (pWinInfo && pCtxInfo)
    165167        cocoaViewMakeCurrentContext(pWinInfo->window, pCtxInfo->context);
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_glx.c

    r44860 r44997  
    584584                        if (pCompositor)
    585585                        {
    586                             renderspuVBoxPresentCompositionGeneric(pWindow, pCompositor, NULL);
     586                            renderspuVBoxPresentCompositionGeneric(pWindow, pCompositor, NULL, 0);
    587587                            renderspuVBoxCompositorRelease(pWindow);
    588588                        }
     
    15081508    }
    15091509#endif
     1510
     1511    nativeWindow = 0;
    15101512
    15111513    if (window && context) {
     
    19671969    {
    19681970        Assert(pCurCompositor == pCompositor);
    1969         renderspuVBoxPresentCompositionGeneric(window, pCompositor, pChangedEntry);
     1971        renderspuVBoxPresentCompositionGeneric(window, pCompositor, pChangedEntry, 0);
    19701972        renderspuVBoxCompositorRelease(window);
    19711973    }
     
    19761978        XEvent event;
    19771979        render_spu.self.Flush();
    1978         renderspuVBoxPresentBlitterEnsureCreated(window);
     1980        renderspuVBoxPresentBlitterEnsureCreated(window, 0);
    19791981
    19801982        crMemset(&event, 0, sizeof (event));
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_wgl.c

    r44950 r44997  
    436436                if (pCompositor)
    437437                {
    438                     HDC hDC, hOldDC = pWindow->device_context;
     438                    HDC hDC;
    439439                    PAINTSTRUCT Paint;
    440440
     
    444444                    {
    445445                        BOOL bRc;
    446                         pWindow->device_context = hDC;
    447 
    448                         renderspuVBoxPresentCompositionGeneric(pWindow, pCompositor, NULL);
     446                        pWindow->redraw_device_context = hDC;
     447
     448                        renderspuVBoxPresentCompositionGeneric(pWindow, pCompositor, NULL, 1);
    449449                        renderspuVBoxCompositorRelease(pWindow);
    450450
     
    456456                        }
    457457
    458                         pWindow->device_context = hOldDC;
     458                        pWindow->redraw_device_context = NULL;
    459459                    }
    460460                    else
     
    12581258    {
    12591259        Assert(pCurCompositor == pCompositor);
    1260         renderspuVBoxPresentCompositionGeneric(window, pCompositor, pChangedEntry);
     1260        renderspuVBoxPresentCompositionGeneric(window, pCompositor, pChangedEntry, 0);
    12611261        renderspuVBoxCompositorRelease(window);
    12621262    }
     
    12651265    {
    12661266        render_spu.self.Flush();
    1267         renderspuVBoxPresentBlitterEnsureCreated(window);
     1267        renderspuVBoxPresentBlitterEnsureCreated(window, 0);
    12681268        RedrawWindow(window->hWnd, NULL, NULL, RDW_INTERNALPAINT);
    12691269    }
     
    13721372        }
    13731373
    1374         if (render_spu.render_to_app_window && nativeWindow)
     1374        if (0/*render_spu.render_to_app_window && nativeWindow*/)
    13751375        {
    13761376            /* The render_to_app_window option
     
    14131413        {
    14141414            if (!context->hRC) {
     1415                CRASSERT(!nativeWindow);
    14151416                if (context->shared)
    14161417                {
     
    14641465
    14651466            /*crDebug("MakeCurrent 0x%x, 0x%x", window->device_context, context->hRC);*/
    1466             if (!render_spu.ws.wglMakeCurrent(window->device_context, context->hRC))
     1467            if (!render_spu.ws.wglMakeCurrent(!nativeWindow ? window->device_context : window->redraw_device_context, context->hRC))
    14671468            {
    14681469                DWORD err = GetLastError();
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